Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{x + y}{1 - \frac{y}{z}}
\]
↓
\[\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-217} \lor \neg \left(t_0 \leq 2 \cdot 10^{-240}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\end{array}
\]
(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z)))) ↓
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (+ x y) (- 1.0 (/ y z)))))
(if (or (<= t_0 -1e-217) (not (<= t_0 2e-240)))
t_0
(* z (- -1.0 (/ x y)))))) double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
↓
double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-217) || !(t_0 <= 2e-240)) {
tmp = t_0;
} else {
tmp = z * (-1.0 - (x / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + y) / (1.0d0 - (y / z))
end function
↓
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x + y) / (1.0d0 - (y / z))
if ((t_0 <= (-1d-217)) .or. (.not. (t_0 <= 2d-240))) then
tmp = t_0
else
tmp = z * ((-1.0d0) - (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
↓
public static double code(double x, double y, double z) {
double t_0 = (x + y) / (1.0 - (y / z));
double tmp;
if ((t_0 <= -1e-217) || !(t_0 <= 2e-240)) {
tmp = t_0;
} else {
tmp = z * (-1.0 - (x / y));
}
return tmp;
}
def code(x, y, z):
return (x + y) / (1.0 - (y / z))
↓
def code(x, y, z):
t_0 = (x + y) / (1.0 - (y / z))
tmp = 0
if (t_0 <= -1e-217) or not (t_0 <= 2e-240):
tmp = t_0
else:
tmp = z * (-1.0 - (x / y))
return tmp
function code(x, y, z)
return Float64(Float64(x + y) / Float64(1.0 - Float64(y / z)))
end
↓
function code(x, y, z)
t_0 = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z)))
tmp = 0.0
if ((t_0 <= -1e-217) || !(t_0 <= 2e-240))
tmp = t_0;
else
tmp = Float64(z * Float64(-1.0 - Float64(x / y)));
end
return tmp
end
function tmp = code(x, y, z)
tmp = (x + y) / (1.0 - (y / z));
end
↓
function tmp_2 = code(x, y, z)
t_0 = (x + y) / (1.0 - (y / z));
tmp = 0.0;
if ((t_0 <= -1e-217) || ~((t_0 <= 2e-240)))
tmp = t_0;
else
tmp = z * (-1.0 - (x / y));
end
tmp_2 = tmp;
end
code[x_, y_, z_] := N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -1e-217], N[Not[LessEqual[t$95$0, 2e-240]], $MachinePrecision]], t$95$0, N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{x + y}{1 - \frac{y}{z}}
↓
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{-217} \lor \neg \left(t_0 \leq 2 \cdot 10^{-240}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\end{array}
Alternatives Alternative 1 Error 28.61% Cost 1373
\[\begin{array}{l}
t_0 := z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+34}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{-11}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-53}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 10^{-269}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-78} \lor \neg \left(y \leq 5.2 \cdot 10^{+48}\right) \land y \leq 1.45 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 29.3% Cost 1243
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+34} \lor \neg \left(y \leq -1.6 \cdot 10^{-11} \lor \neg \left(y \leq -1.2 \cdot 10^{-61}\right) \land \left(y \leq 4.2 \cdot 10^{-76} \lor \neg \left(y \leq 4 \cdot 10^{+48}\right) \land y \leq 1.1 \cdot 10^{+136}\right)\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\]
Alternative 3 Error 34.11% Cost 780
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+47}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -5 \cdot 10^{-12}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -6.4 \cdot 10^{-58}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\]
Alternative 4 Error 34.19% Cost 780
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+47}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq -5.1 \cdot 10^{-12}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-58}:\\
\;\;\;\;\frac{-z}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+137}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\]
Alternative 5 Error 33.27% Cost 456
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+47}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\]
Alternative 6 Error 42.57% Cost 392
\[\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+18}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-64}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\]
Alternative 7 Error 59.56% Cost 328
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{-194}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-127}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 8 Error 65.68% Cost 64
\[x
\]