Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\]
↓
\[y \cdot \left(1 - \left(z - \log z\right)\right) + 0.5 \cdot x
\]
(FPCore (x y z) :precision binary64 (+ (* x 0.5) (* y (+ (- 1.0 z) (log z))))) ↓
(FPCore (x y z) :precision binary64 (+ (* y (- 1.0 (- z (log z)))) (* 0.5 x))) double code(double x, double y, double z) {
return (x * 0.5) + (y * ((1.0 - z) + log(z)));
}
↓
double code(double x, double y, double z) {
return (y * (1.0 - (z - log(z)))) + (0.5 * 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 * 0.5d0) + (y * ((1.0d0 - z) + log(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 * (1.0d0 - (z - log(z)))) + (0.5d0 * x)
end function
public static double code(double x, double y, double z) {
return (x * 0.5) + (y * ((1.0 - z) + Math.log(z)));
}
↓
public static double code(double x, double y, double z) {
return (y * (1.0 - (z - Math.log(z)))) + (0.5 * x);
}
def code(x, y, z):
return (x * 0.5) + (y * ((1.0 - z) + math.log(z)))
↓
def code(x, y, z):
return (y * (1.0 - (z - math.log(z)))) + (0.5 * x)
function code(x, y, z)
return Float64(Float64(x * 0.5) + Float64(y * Float64(Float64(1.0 - z) + log(z))))
end
↓
function code(x, y, z)
return Float64(Float64(y * Float64(1.0 - Float64(z - log(z)))) + Float64(0.5 * x))
end
function tmp = code(x, y, z)
tmp = (x * 0.5) + (y * ((1.0 - z) + log(z)));
end
↓
function tmp = code(x, y, z)
tmp = (y * (1.0 - (z - log(z)))) + (0.5 * x);
end
code[x_, y_, z_] := N[(N[(x * 0.5), $MachinePrecision] + N[(y * N[(N[(1.0 - z), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := N[(N[(y * N[(1.0 - N[(z - N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * x), $MachinePrecision]), $MachinePrecision]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
↓
y \cdot \left(1 - \left(z - \log z\right)\right) + 0.5 \cdot x
Alternatives Alternative 1 Error 10.7 Cost 7368
\[\begin{array}{l}
t_0 := 0.5 \cdot x - y \cdot z\\
\mathbf{if}\;x \cdot 0.5 \leq -2 \cdot 10^{-88}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot 0.5 \leq 10^{-133}:\\
\;\;\;\;y \cdot \left(1 + \left(\log z - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 18.1 Cost 7248
\[\begin{array}{l}
t_0 := \left(1 + \log z\right) \cdot y\\
t_1 := 0.5 \cdot x - y \cdot z\\
\mathbf{if}\;z \leq 2.1 \cdot 10^{-266}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-236}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-178}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-119}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 3 Error 0.9 Cost 7108
\[\begin{array}{l}
\mathbf{if}\;z \leq 0.58:\\
\;\;\;\;y \cdot \left(1 + \log z\right) + 0.5 \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) + 0.5 \cdot x\\
\end{array}
\]
Alternative 4 Error 0.1 Cost 7104
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\]
Alternative 5 Error 29.0 Cost 1048
\[\begin{array}{l}
t_0 := y \cdot \left(-z\right)\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{-68}:\\
\;\;\;\;0.5 \cdot x\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-124}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-84}:\\
\;\;\;\;0.5 \cdot x\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-19}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+53}:\\
\;\;\;\;0.5 \cdot x\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+85}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot x\\
\end{array}
\]
Alternative 6 Error 18.2 Cost 448
\[0.5 \cdot x - y \cdot z
\]
Alternative 7 Error 34.5 Cost 192
\[0.5 \cdot x
\]