Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq -9500000000 \lor \neg \left(y \leq 280000\right):\\
\;\;\;\;\left(x + \frac{x + -1}{y \cdot y}\right) + \frac{1 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot \left(x + -1\right)}{y + 1}\\
\end{array}
\]
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0)))) ↓
(FPCore (x y)
:precision binary64
(if (or (<= y -9500000000.0) (not (<= y 280000.0)))
(+ (+ x (/ (+ x -1.0) (* y y))) (/ (- 1.0 x) y))
(+ 1.0 (/ (* y (+ x -1.0)) (+ y 1.0))))) double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
↓
double code(double x, double y) {
double tmp;
if ((y <= -9500000000.0) || !(y <= 280000.0)) {
tmp = (x + ((x + -1.0) / (y * y))) + ((1.0 - x) / y);
} else {
tmp = 1.0 + ((y * (x + -1.0)) / (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-9500000000.0d0)) .or. (.not. (y <= 280000.0d0))) then
tmp = (x + ((x + (-1.0d0)) / (y * y))) + ((1.0d0 - x) / y)
else
tmp = 1.0d0 + ((y * (x + (-1.0d0))) / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
↓
public static double code(double x, double y) {
double tmp;
if ((y <= -9500000000.0) || !(y <= 280000.0)) {
tmp = (x + ((x + -1.0) / (y * y))) + ((1.0 - x) / y);
} else {
tmp = 1.0 + ((y * (x + -1.0)) / (y + 1.0));
}
return tmp;
}
def code(x, y):
return 1.0 - (((1.0 - x) * y) / (y + 1.0))
↓
def code(x, y):
tmp = 0
if (y <= -9500000000.0) or not (y <= 280000.0):
tmp = (x + ((x + -1.0) / (y * y))) + ((1.0 - x) / y)
else:
tmp = 1.0 + ((y * (x + -1.0)) / (y + 1.0))
return tmp
function code(x, y)
return Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0)))
end
↓
function code(x, y)
tmp = 0.0
if ((y <= -9500000000.0) || !(y <= 280000.0))
tmp = Float64(Float64(x + Float64(Float64(x + -1.0) / Float64(y * y))) + Float64(Float64(1.0 - x) / y));
else
tmp = Float64(1.0 + Float64(Float64(y * Float64(x + -1.0)) / Float64(y + 1.0)));
end
return tmp
end
function tmp = code(x, y)
tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
end
↓
function tmp_2 = code(x, y)
tmp = 0.0;
if ((y <= -9500000000.0) || ~((y <= 280000.0)))
tmp = (x + ((x + -1.0) / (y * y))) + ((1.0 - x) / y);
else
tmp = 1.0 + ((y * (x + -1.0)) / (y + 1.0));
end
tmp_2 = tmp;
end
code[x_, y_] := N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := If[Or[LessEqual[y, -9500000000.0], N[Not[LessEqual[y, 280000.0]], $MachinePrecision]], N[(N[(x + N[(N[(x + -1.0), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
↓
\begin{array}{l}
\mathbf{if}\;y \leq -9500000000 \lor \neg \left(y \leq 280000\right):\\
\;\;\;\;\left(x + \frac{x + -1}{y \cdot y}\right) + \frac{1 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot \left(x + -1\right)}{y + 1}\\
\end{array}
Alternatives Alternative 1 Accuracy 99.7% Cost 968
\[\begin{array}{l}
\mathbf{if}\;y \leq -35000000000:\\
\;\;\;\;x - \frac{-1}{y}\\
\mathbf{elif}\;y \leq 195000000:\\
\;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\end{array}
\]
Alternative 2 Accuracy 99.7% Cost 968
\[\begin{array}{l}
\mathbf{if}\;y \leq -22000000000:\\
\;\;\;\;x - \frac{-1}{y}\\
\mathbf{elif}\;y \leq 195000000:\\
\;\;\;\;1 + \frac{y \cdot \left(x + -1\right)}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\end{array}
\]
Alternative 3 Accuracy 98.3% Cost 713
\[\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 0.8\right):\\
\;\;\;\;x - \frac{-1}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(y \cdot x - y\right)\\
\end{array}
\]
Alternative 4 Accuracy 98.5% Cost 713
\[\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(y \cdot x - y\right)\\
\end{array}
\]
Alternative 5 Accuracy 98.0% Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;x - \frac{-1}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot x\\
\end{array}
\]
Alternative 6 Accuracy 86.4% Cost 584
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 88:\\
\;\;\;\;1 + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 7 Accuracy 74.0% Cost 456
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.00165:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 8 Accuracy 73.7% Cost 328
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.00152:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 9 Accuracy 38.4% Cost 64
\[1
\]