Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[x \cdot \left(y + z\right) + z \cdot 5
\]
↓
\[\left(z \cdot \left(5 + x\right) + y \cdot \left(x \cdot 2\right)\right) - y \cdot x
\]
(FPCore (x y z) :precision binary64 (+ (* x (+ y z)) (* z 5.0))) ↓
(FPCore (x y z)
:precision binary64
(- (+ (* z (+ 5.0 x)) (* y (* x 2.0))) (* y x))) double code(double x, double y, double z) {
return (x * (y + z)) + (z * 5.0);
}
↓
double code(double x, double y, double z) {
return ((z * (5.0 + x)) + (y * (x * 2.0))) - (y * 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 + z)) + (z * 5.0d0)
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 * (5.0d0 + x)) + (y * (x * 2.0d0))) - (y * x)
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) + (z * 5.0);
}
↓
public static double code(double x, double y, double z) {
return ((z * (5.0 + x)) + (y * (x * 2.0))) - (y * x);
}
def code(x, y, z):
return (x * (y + z)) + (z * 5.0)
↓
def code(x, y, z):
return ((z * (5.0 + x)) + (y * (x * 2.0))) - (y * x)
function code(x, y, z)
return Float64(Float64(x * Float64(y + z)) + Float64(z * 5.0))
end
↓
function code(x, y, z)
return Float64(Float64(Float64(z * Float64(5.0 + x)) + Float64(y * Float64(x * 2.0))) - Float64(y * x))
end
function tmp = code(x, y, z)
tmp = (x * (y + z)) + (z * 5.0);
end
↓
function tmp = code(x, y, z)
tmp = ((z * (5.0 + x)) + (y * (x * 2.0))) - (y * x);
end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := N[(N[(N[(z * N[(5.0 + x), $MachinePrecision]), $MachinePrecision] + N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * x), $MachinePrecision]), $MachinePrecision]
x \cdot \left(y + z\right) + z \cdot 5
↓
\left(z \cdot \left(5 + x\right) + y \cdot \left(x \cdot 2\right)\right) - y \cdot x
Alternatives Alternative 1 Error 26.1 Cost 1248
\[\begin{array}{l}
\mathbf{if}\;z \leq -0.72:\\
\;\;\;\;5 \cdot z\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-65}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-79}:\\
\;\;\;\;5 \cdot z\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-156}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;z \leq 10^{-122}:\\
\;\;\;\;5 \cdot z\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-100}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-73}:\\
\;\;\;\;5 \cdot z\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-20}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;5 \cdot z\\
\end{array}
\]
Alternative 2 Error 14.2 Cost 1112
\[\begin{array}{l}
t_0 := z \cdot \left(5 + x\right)\\
t_1 := \left(z + y\right) \cdot x\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{-76}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-155}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{-129}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-97}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-71}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 3 Error 25.4 Cost 984
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-78}:\\
\;\;\;\;5 \cdot z\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-156}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-130}:\\
\;\;\;\;5 \cdot z\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-101}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-73}:\\
\;\;\;\;5 \cdot z\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-17}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;5 \cdot z\\
\end{array}
\]
Alternative 4 Error 16.3 Cost 848
\[\begin{array}{l}
t_0 := z \cdot \left(5 + x\right)\\
\mathbf{if}\;z \leq -9.8 \cdot 10^{-86}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-156}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-126}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-97}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 0.1 Cost 576
\[x \cdot \left(y + z\right) + z \cdot 5
\]
Alternative 6 Error 34.6 Cost 192
\[5 \cdot z
\]