Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\]
↓
\[x \cdot 0.5 + \left(y \cdot \left(1 + \log z\right) - y \cdot z\right)
\]
(FPCore (x y z) :precision binary64 (+ (* x 0.5) (* y (+ (- 1.0 z) (log z))))) ↓
(FPCore (x y z)
:precision binary64
(+ (* x 0.5) (- (* y (+ 1.0 (log z))) (* y z)))) 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 (x * 0.5) + ((y * (1.0 + log(z))) - (y * z));
}
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 = (x * 0.5d0) + ((y * (1.0d0 + log(z))) - (y * z))
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 (x * 0.5) + ((y * (1.0 + Math.log(z))) - (y * z));
}
def code(x, y, z):
return (x * 0.5) + (y * ((1.0 - z) + math.log(z)))
↓
def code(x, y, z):
return (x * 0.5) + ((y * (1.0 + math.log(z))) - (y * z))
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(x * 0.5) + Float64(Float64(y * Float64(1.0 + log(z))) - Float64(y * z)))
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 = (x * 0.5) + ((y * (1.0 + log(z))) - (y * z));
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[(x * 0.5), $MachinePrecision] + N[(N[(y * N[(1.0 + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
↓
x \cdot 0.5 + \left(y \cdot \left(1 + \log z\right) - y \cdot z\right)
Alternatives Alternative 1 Error 18.7 Cost 8280
\[\begin{array}{l}
t_0 := y + y \cdot \log z\\
t_1 := x \cdot 0.5 - y \cdot z\\
\mathbf{if}\;x \cdot 0.5 \leq -4 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot 0.5 \leq -2 \cdot 10^{-53}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot 0.5 \leq -5 \cdot 10^{-202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot 0.5 \leq 2 \cdot 10^{-289}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot 0.5 \leq 10^{-218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot 0.5 \leq 10^{-192}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 2 Error 18.7 Cost 8280
\[\begin{array}{l}
t_0 := x \cdot 0.5 - y \cdot z\\
t_1 := y + y \cdot \log z\\
\mathbf{if}\;x \cdot 0.5 \leq -4 \cdot 10^{-30}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot 0.5 \leq -2 \cdot 10^{-53}:\\
\;\;\;\;y \cdot \left(1 + \log z\right)\\
\mathbf{elif}\;x \cdot 0.5 \leq -5 \cdot 10^{-202}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot 0.5 \leq 2 \cdot 10^{-289}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot 0.5 \leq 10^{-218}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot 0.5 \leq 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 3 Error 11.4 Cost 7888
\[\begin{array}{l}
t_0 := y + y \cdot \left(\log z - z\right)\\
t_1 := x \cdot 0.5 - y \cdot z\\
\mathbf{if}\;x \cdot 0.5 \leq -4 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot 0.5 \leq -2 \cdot 10^{-53}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot 0.5 \leq -1 \cdot 10^{-121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot 0.5 \leq 1000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 11.4 Cost 7888
\[\begin{array}{l}
t_0 := x \cdot 0.5 - y \cdot z\\
\mathbf{if}\;x \cdot 0.5 \leq -4 \cdot 10^{-30}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot 0.5 \leq -2 \cdot 10^{-53}:\\
\;\;\;\;y \cdot \left(\left(1 + \log z\right) - z\right)\\
\mathbf{elif}\;x \cdot 0.5 \leq -1 \cdot 10^{-121}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot 0.5 \leq 1000000:\\
\;\;\;\;y + y \cdot \left(\log z - z\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 0.1 Cost 7232
\[\left(y \cdot \log z + \left(x \cdot 0.5 + y\right)\right) - y \cdot z
\]
Alternative 6 Error 1.0 Cost 7108
\[\begin{array}{l}
\mathbf{if}\;z \leq 0.0006746617405501257:\\
\;\;\;\;y \cdot \log z + \left(x \cdot 0.5 + y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5 + y \cdot \left(1 - z\right)\\
\end{array}
\]
Alternative 7 Error 1.0 Cost 7108
\[\begin{array}{l}
\mathbf{if}\;z \leq 0.0006746617405501257:\\
\;\;\;\;x \cdot 0.5 + \left(y + y \cdot \log z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5 + y \cdot \left(1 - z\right)\\
\end{array}
\]
Alternative 8 Error 0.1 Cost 7104
\[x \cdot 0.5 + y \cdot \left(\log z + \left(1 - z\right)\right)
\]
Alternative 9 Error 28.3 Cost 520
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.762612724927467 \cdot 10^{-6}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 5.35809792399716 \cdot 10^{-44}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5\\
\end{array}
\]
Alternative 10 Error 18.5 Cost 448
\[x \cdot 0.5 - y \cdot z
\]
Alternative 11 Error 34.6 Cost 192
\[x \cdot 0.5
\]