\[1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq -4600000000 \lor \neg \left(y \leq 52000000000\right):\\
\;\;\;\;x + \frac{1}{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 -4600000000.0) (not (<= y 52000000000.0)))
(+ x (/ 1.0 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 <= -4600000000.0) || !(y <= 52000000000.0)) {
tmp = x + (1.0 / 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 <= (-4600000000.0d0)) .or. (.not. (y <= 52000000000.0d0))) then
tmp = x + (1.0d0 / 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 <= -4600000000.0) || !(y <= 52000000000.0)) {
tmp = x + (1.0 / 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 <= -4600000000.0) or not (y <= 52000000000.0):
tmp = x + (1.0 / 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 <= -4600000000.0) || !(y <= 52000000000.0))
tmp = Float64(x + Float64(1.0 / 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 <= -4600000000.0) || ~((y <= 52000000000.0)))
tmp = x + (1.0 / 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, -4600000000.0], N[Not[LessEqual[y, 52000000000.0]], $MachinePrecision]], N[(x + N[(1.0 / 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 -4600000000 \lor \neg \left(y \leq 52000000000\right):\\
\;\;\;\;x + \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot \left(x + -1\right)}{y + 1}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.3% |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -215000000:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{elif}\;y \leq 410000000000:\\
\;\;\;\;1 + y \cdot \frac{x + -1}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.78% |
|---|
| 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 + y \cdot \left(x + -1\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 1.64% |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x + \frac{1 - x}{y}\\
\mathbf{elif}\;y \leq 0.78:\\
\;\;\;\;1 + y \cdot \left(x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{y}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.64% |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_0 := x + \frac{1}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t_0 - \frac{x}{y}\\
\mathbf{elif}\;y \leq 0.82:\\
\;\;\;\;1 + y \cdot \left(x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 13.73% |
|---|
| Cost | 585 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 0.11\right):\\
\;\;\;\;x + \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - y\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 2.02% |
|---|
| 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 7 |
|---|
| Error | 25.95% |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.95:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 26.19% |
|---|
| Cost | 328 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.485:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 61.59% |
|---|
| Cost | 64 |
|---|
\[1
\]