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(\left(1 - z\right) - \log \left(\frac{1}{z}\right)\right) + x \cdot 0.5
\]
(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 (/ 1.0 z)))) (* x 0.5))) 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((1.0 / z)))) + (x * 0.5);
}
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((1.0d0 / z)))) + (x * 0.5d0)
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((1.0 / z)))) + (x * 0.5);
}
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((1.0 / z)))) + (x * 0.5)
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(Float64(1.0 - z) - log(Float64(1.0 / z)))) + Float64(x * 0.5))
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((1.0 / z)))) + (x * 0.5);
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[(N[(1.0 - z), $MachinePrecision] - N[Log[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
↓
y \cdot \left(\left(1 - z\right) - \log \left(\frac{1}{z}\right)\right) + x \cdot 0.5
Alternatives Alternative 1 Error 10.4 Cost 7376
\[\begin{array}{l}
t_0 := y + y \cdot \left(\log z - z\right)\\
t_1 := x \cdot 0.5 - z \cdot y\\
\mathbf{if}\;y \leq -9.6 \cdot 10^{+127}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{+26}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 0.9 Cost 7108
\[\begin{array}{l}
\mathbf{if}\;z \leq 0.0026:\\
\;\;\;\;x \cdot 0.5 + \left(1 + \log z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5 + \left(y + \left(-z\right) \cdot y\right)\\
\end{array}
\]
Alternative 3 Error 0.1 Cost 7104
\[x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\]
Alternative 4 Error 14.1 Cost 6984
\[\begin{array}{l}
t_0 := \left(1 + \log z\right) \cdot y\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+171}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+127}:\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 28.8 Cost 652
\[\begin{array}{l}
t_0 := -y \cdot z\\
\mathbf{if}\;z \leq 6 \cdot 10^{+18}:\\
\;\;\;\;0.5 \cdot x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+70}:\\
\;\;\;\;0.5 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 6 Error 17.8 Cost 448
\[x \cdot 0.5 - z \cdot y
\]
Alternative 7 Error 34.2 Cost 192
\[0.5 \cdot x
\]