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 + y \cdot \left(\left(1 - z\right) + \log 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 z) (log 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 - z) + log(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 - z) + log(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 - z) + Math.log(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 - z) + math.log(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(y * Float64(Float64(1.0 - z) + log(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 - z) + log(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[(y * N[(N[(1.0 - z), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
↓
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
Alternatives Alternative 1 Error 10.7 Cost 7112
\[\begin{array}{l}
t_0 := y \cdot \left(\left(1 + \log z\right) - z\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{+80}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 10^{+90}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 0.9 Cost 7108
\[\begin{array}{l}
\mathbf{if}\;z \leq 0.006783654364408818:\\
\;\;\;\;x \cdot 0.5 + y \cdot \left(1 + \log z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, x \cdot 0.5\right)\\
\end{array}
\]
Alternative 3 Error 14.6 Cost 7048
\[\begin{array}{l}
t_0 := y \cdot \left(1 + \log z\right)\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+142}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 4 Error 14.7 Cost 6984
\[\begin{array}{l}
t_0 := y + y \cdot \log z\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+142}:\\
\;\;\;\;x \cdot 0.5 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 14.6 Cost 6984
\[\begin{array}{l}
t_0 := y \cdot \left(1 + \log z\right)\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+142}:\\
\;\;\;\;x \cdot 0.5 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 6 Error 29.2 Cost 784
\[\begin{array}{l}
t_0 := z \cdot \left(-y\right)\\
\mathbf{if}\;x \leq -1.3670290754380618 \cdot 10^{-55}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 1.2220893004562692 \cdot 10^{-57}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.888912824369937 \cdot 10^{-7}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 7.264271112857022 \cdot 10^{+71}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5\\
\end{array}
\]
Alternative 7 Error 18.4 Cost 448
\[x \cdot 0.5 - y \cdot z
\]
Alternative 8 Error 35.1 Cost 192
\[x \cdot 0.5
\]