Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\left(\frac{x}{2} + y \cdot x\right) + z
\]
↓
\[z - x \cdot \left(-0.5 - y\right)
\]
(FPCore (x y z) :precision binary64 (+ (+ (/ x 2.0) (* y x)) z)) ↓
(FPCore (x y z) :precision binary64 (- z (* x (- -0.5 y)))) double code(double x, double y, double z) {
return ((x / 2.0) + (y * x)) + z;
}
↓
double code(double x, double y, double z) {
return z - (x * (-0.5 - y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x / 2.0d0) + (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 = z - (x * ((-0.5d0) - y))
end function
public static double code(double x, double y, double z) {
return ((x / 2.0) + (y * x)) + z;
}
↓
public static double code(double x, double y, double z) {
return z - (x * (-0.5 - y));
}
def code(x, y, z):
return ((x / 2.0) + (y * x)) + z
↓
def code(x, y, z):
return z - (x * (-0.5 - y))
function code(x, y, z)
return Float64(Float64(Float64(x / 2.0) + Float64(y * x)) + z)
end
↓
function code(x, y, z)
return Float64(z - Float64(x * Float64(-0.5 - y)))
end
function tmp = code(x, y, z)
tmp = ((x / 2.0) + (y * x)) + z;
end
↓
function tmp = code(x, y, z)
tmp = z - (x * (-0.5 - y));
end
code[x_, y_, z_] := N[(N[(N[(x / 2.0), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]
↓
code[x_, y_, z_] := N[(z - N[(x * N[(-0.5 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\frac{x}{2} + y \cdot x\right) + z
↓
z - x \cdot \left(-0.5 - y\right)
Alternatives Alternative 1 Error 27.6 Cost 720
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.02 \cdot 10^{-25}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-172}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-135}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{+38}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
Alternative 2 Error 27.3 Cost 720
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-24}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-263}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-114}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+38}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
Alternative 3 Error 10.3 Cost 585
\[\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-25} \lor \neg \left(z \leq 540000\right):\\
\;\;\;\;z + x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\end{array}
\]
Alternative 4 Error 0.8 Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -0.5 \lor \neg \left(y \leq 0.0072\right):\\
\;\;\;\;z + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z + x \cdot 0.5\\
\end{array}
\]
Alternative 5 Error 14.9 Cost 584
\[\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+57}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+56}:\\
\;\;\;\;x \cdot \left(y + 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
Alternative 6 Error 34.3 Cost 64
\[z
\]