Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[x + \frac{y - x}{z}
\]
↓
\[\frac{y}{z} - \left(\frac{x}{z} - x\right)
\]
(FPCore (x y z) :precision binary64 (+ x (/ (- y x) z))) ↓
(FPCore (x y z) :precision binary64 (- (/ y z) (- (/ x z) x))) double code(double x, double y, double z) {
return x + ((y - x) / z);
}
↓
double code(double x, double y, double z) {
return (y / z) - ((x / z) - x);
}
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 - x) / 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
code = (y / z) - ((x / z) - x)
end function
public static double code(double x, double y, double z) {
return x + ((y - x) / z);
}
↓
public static double code(double x, double y, double z) {
return (y / z) - ((x / z) - x);
}
def code(x, y, z):
return x + ((y - x) / z)
↓
def code(x, y, z):
return (y / z) - ((x / z) - x)
function code(x, y, z)
return Float64(x + Float64(Float64(y - x) / z))
end
↓
function code(x, y, z)
return Float64(Float64(y / z) - Float64(Float64(x / z) - x))
end
function tmp = code(x, y, z)
tmp = x + ((y - x) / z);
end
↓
function tmp = code(x, y, z)
tmp = (y / z) - ((x / z) - x);
end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := N[(N[(y / z), $MachinePrecision] - N[(N[(x / z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]
x + \frac{y - x}{z}
↓
\frac{y}{z} - \left(\frac{x}{z} - x\right)
Alternatives Alternative 1 Error 12.5 Cost 848
\[\begin{array}{l}
t_0 := \frac{y}{z} + x\\
t_1 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-210}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-49}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 26.4 Cost 720
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-18}:\\
\;\;\;\;\frac{-x}{z}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-78}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-173}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 3 Error 7.5 Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{-75} \lor \neg \left(y \leq 2.45 \cdot 10^{-113}\right):\\
\;\;\;\;\frac{y}{z} + x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{z}\\
\end{array}
\]
Alternative 4 Error 0.9 Cost 585
\[\begin{array}{l}
\mathbf{if}\;z \leq -740 \lor \neg \left(z \leq 0.205\right):\\
\;\;\;\;\frac{y}{z} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{z}\\
\end{array}
\]
Alternative 5 Error 25.9 Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-78}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.65 \cdot 10^{-170}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
Alternative 6 Error 0.0 Cost 448
\[x + \frac{y - x}{z}
\]
Alternative 7 Error 34.8 Cost 64
\[x
\]