
(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)));
}
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)));
}
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 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]
\begin{array}{l}
\\
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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)));
}
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)));
}
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 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]
\begin{array}{l}
\\
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- 1.0 z) y (fma y (log z) (* x 0.5))))
double code(double x, double y, double z) {
return fma((1.0 - z), y, fma(y, log(z), (x * 0.5)));
}
function code(x, y, z) return fma(Float64(1.0 - z), y, fma(y, log(z), Float64(x * 0.5))) end
code[x_, y_, z_] := N[(N[(1.0 - z), $MachinePrecision] * y + N[(y * N[Log[z], $MachinePrecision] + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1 - z, y, \mathsf{fma}\left(y, \log z, x \cdot 0.5\right)\right)
\end{array}
Initial program 99.8%
lift-*.f64N/A
lift--.f64N/A
lift-log.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied egg-rr99.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* y (+ (- 1.0 z) (log z)))) (t_1 (* z (- y)))) (if (<= t_0 -500000.0) t_1 (if (<= t_0 2e+41) (* x 0.5) t_1))))
double code(double x, double y, double z) {
double t_0 = y * ((1.0 - z) + log(z));
double t_1 = z * -y;
double tmp;
if (t_0 <= -500000.0) {
tmp = t_1;
} else if (t_0 <= 2e+41) {
tmp = x * 0.5;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * ((1.0d0 - z) + log(z))
t_1 = z * -y
if (t_0 <= (-500000.0d0)) then
tmp = t_1
else if (t_0 <= 2d+41) then
tmp = x * 0.5d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * ((1.0 - z) + Math.log(z));
double t_1 = z * -y;
double tmp;
if (t_0 <= -500000.0) {
tmp = t_1;
} else if (t_0 <= 2e+41) {
tmp = x * 0.5;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * ((1.0 - z) + math.log(z)) t_1 = z * -y tmp = 0 if t_0 <= -500000.0: tmp = t_1 elif t_0 <= 2e+41: tmp = x * 0.5 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(Float64(1.0 - z) + log(z))) t_1 = Float64(z * Float64(-y)) tmp = 0.0 if (t_0 <= -500000.0) tmp = t_1; elseif (t_0 <= 2e+41) tmp = Float64(x * 0.5); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * ((1.0 - z) + log(z)); t_1 = z * -y; tmp = 0.0; if (t_0 <= -500000.0) tmp = t_1; elseif (t_0 <= 2e+41) tmp = x * 0.5; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(N[(1.0 - z), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * (-y)), $MachinePrecision]}, If[LessEqual[t$95$0, -500000.0], t$95$1, If[LessEqual[t$95$0, 2e+41], N[(x * 0.5), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(\left(1 - z\right) + \log z\right)\\
t_1 := z \cdot \left(-y\right)\\
\mathbf{if}\;t\_0 \leq -500000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+41}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 y (+.f64 (-.f64 #s(literal 1 binary64) z) (log.f64 z))) < -5e5 or 2.00000000000000001e41 < (*.f64 y (+.f64 (-.f64 #s(literal 1 binary64) z) (log.f64 z))) Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6462.1
Simplified62.1%
if -5e5 < (*.f64 y (+.f64 (-.f64 #s(literal 1 binary64) z) (log.f64 z))) < 2.00000000000000001e41Initial program 99.9%
Taylor expanded in x around inf
lower-*.f6472.8
Simplified72.8%
Final simplification66.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* x 0.5) (* z y))))
(if (<= (* x 0.5) -2e-138)
t_0
(if (<= (* x 0.5) 5e-103) (+ y (* y (- (log z) z))) t_0))))
double code(double x, double y, double z) {
double t_0 = (x * 0.5) - (z * y);
double tmp;
if ((x * 0.5) <= -2e-138) {
tmp = t_0;
} else if ((x * 0.5) <= 5e-103) {
tmp = y + (y * (log(z) - z));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (x * 0.5d0) - (z * y)
if ((x * 0.5d0) <= (-2d-138)) then
tmp = t_0
else if ((x * 0.5d0) <= 5d-103) then
tmp = y + (y * (log(z) - z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x * 0.5) - (z * y);
double tmp;
if ((x * 0.5) <= -2e-138) {
tmp = t_0;
} else if ((x * 0.5) <= 5e-103) {
tmp = y + (y * (Math.log(z) - z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (x * 0.5) - (z * y) tmp = 0 if (x * 0.5) <= -2e-138: tmp = t_0 elif (x * 0.5) <= 5e-103: tmp = y + (y * (math.log(z) - z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(x * 0.5) - Float64(z * y)) tmp = 0.0 if (Float64(x * 0.5) <= -2e-138) tmp = t_0; elseif (Float64(x * 0.5) <= 5e-103) tmp = Float64(y + Float64(y * Float64(log(z) - z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x * 0.5) - (z * y); tmp = 0.0; if ((x * 0.5) <= -2e-138) tmp = t_0; elseif ((x * 0.5) <= 5e-103) tmp = y + (y * (log(z) - z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * 0.5), $MachinePrecision], -2e-138], t$95$0, If[LessEqual[N[(x * 0.5), $MachinePrecision], 5e-103], N[(y + N[(y * N[(N[Log[z], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot 0.5 - z \cdot y\\
\mathbf{if}\;x \cdot 0.5 \leq -2 \cdot 10^{-138}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \cdot 0.5 \leq 5 \cdot 10^{-103}:\\
\;\;\;\;y + y \cdot \left(\log z - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 x #s(literal 1/2 binary64)) < -2.00000000000000013e-138 or 4.99999999999999966e-103 < (*.f64 x #s(literal 1/2 binary64)) Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6486.4
Simplified86.4%
if -2.00000000000000013e-138 < (*.f64 x #s(literal 1/2 binary64)) < 4.99999999999999966e-103Initial program 99.7%
Taylor expanded in x around 0
sub-negN/A
associate-+r+N/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f6493.9
Simplified93.9%
lift-log.f64N/A
lift--.f64N/A
lower-+.f64N/A
lower-*.f6493.9
Applied egg-rr93.9%
Final simplification88.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* x 0.5) (* z y))))
(if (<= (* x 0.5) -2e-138)
t_0
(if (<= (* x 0.5) 5e-103) (fma y (- (log z) z) y) t_0))))
double code(double x, double y, double z) {
double t_0 = (x * 0.5) - (z * y);
double tmp;
if ((x * 0.5) <= -2e-138) {
tmp = t_0;
} else if ((x * 0.5) <= 5e-103) {
tmp = fma(y, (log(z) - z), y);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(x * 0.5) - Float64(z * y)) tmp = 0.0 if (Float64(x * 0.5) <= -2e-138) tmp = t_0; elseif (Float64(x * 0.5) <= 5e-103) tmp = fma(y, Float64(log(z) - z), y); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * 0.5), $MachinePrecision], -2e-138], t$95$0, If[LessEqual[N[(x * 0.5), $MachinePrecision], 5e-103], N[(y * N[(N[Log[z], $MachinePrecision] - z), $MachinePrecision] + y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot 0.5 - z \cdot y\\
\mathbf{if}\;x \cdot 0.5 \leq -2 \cdot 10^{-138}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \cdot 0.5 \leq 5 \cdot 10^{-103}:\\
\;\;\;\;\mathsf{fma}\left(y, \log z - z, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 x #s(literal 1/2 binary64)) < -2.00000000000000013e-138 or 4.99999999999999966e-103 < (*.f64 x #s(literal 1/2 binary64)) Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6486.4
Simplified86.4%
if -2.00000000000000013e-138 < (*.f64 x #s(literal 1/2 binary64)) < 4.99999999999999966e-103Initial program 99.7%
Taylor expanded in x around 0
sub-negN/A
associate-+r+N/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-log.f6493.9
Simplified93.9%
Final simplification88.7%
(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)));
}
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)));
}
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 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]
\begin{array}{l}
\\
x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\end{array}
Initial program 99.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- (* x 0.5) (* z y)))) (if (<= z 6e-232) t_0 (if (<= z 9.5e-56) (fma y (log z) y) t_0))))
double code(double x, double y, double z) {
double t_0 = (x * 0.5) - (z * y);
double tmp;
if (z <= 6e-232) {
tmp = t_0;
} else if (z <= 9.5e-56) {
tmp = fma(y, log(z), y);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(x * 0.5) - Float64(z * y)) tmp = 0.0 if (z <= 6e-232) tmp = t_0; elseif (z <= 9.5e-56) tmp = fma(y, log(z), y); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 6e-232], t$95$0, If[LessEqual[z, 9.5e-56], N[(y * N[Log[z], $MachinePrecision] + y), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot 0.5 - z \cdot y\\
\mathbf{if}\;z \leq 6 \cdot 10^{-232}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-56}:\\
\;\;\;\;\mathsf{fma}\left(y, \log z, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < 5.99999999999999979e-232 or 9.4999999999999991e-56 < z Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6489.7
Simplified89.7%
if 5.99999999999999979e-232 < z < 9.4999999999999991e-56Initial program 99.6%
Taylor expanded in z around 0
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-fma.f6499.6
Simplified99.6%
Taylor expanded in y around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-log.f6463.3
Simplified63.3%
Final simplification82.2%
(FPCore (x y z) :precision binary64 (if (<= z 0.56) (fma x 0.5 (fma y (log z) y)) (fma (- 1.0 z) y (* x 0.5))))
double code(double x, double y, double z) {
double tmp;
if (z <= 0.56) {
tmp = fma(x, 0.5, fma(y, log(z), y));
} else {
tmp = fma((1.0 - z), y, (x * 0.5));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= 0.56) tmp = fma(x, 0.5, fma(y, log(z), y)); else tmp = fma(Float64(1.0 - z), y, Float64(x * 0.5)); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, 0.56], N[(x * 0.5 + N[(y * N[Log[z], $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - z), $MachinePrecision] * y + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.56:\\
\;\;\;\;\mathsf{fma}\left(x, 0.5, \mathsf{fma}\left(y, \log z, y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - z, y, x \cdot 0.5\right)\\
\end{array}
\end{array}
if z < 0.56000000000000005Initial program 99.7%
Taylor expanded in z around 0
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-fma.f6498.9
Simplified98.9%
lift-log.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-fma.f6498.9
Applied egg-rr98.9%
if 0.56000000000000005 < z Initial program 100.0%
lift-*.f64N/A
lift--.f64N/A
lift-log.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f64100.0
Applied egg-rr100.0%
Taylor expanded in y around 0
lower-*.f6498.6
Simplified98.6%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (fma (- 1.0 z) y (* x 0.5)))
double code(double x, double y, double z) {
return fma((1.0 - z), y, (x * 0.5));
}
function code(x, y, z) return fma(Float64(1.0 - z), y, Float64(x * 0.5)) end
code[x_, y_, z_] := N[(N[(1.0 - z), $MachinePrecision] * y + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1 - z, y, x \cdot 0.5\right)
\end{array}
Initial program 99.8%
lift-*.f64N/A
lift--.f64N/A
lift-log.f64N/A
lift-+.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied egg-rr99.8%
Taylor expanded in y around 0
lower-*.f6473.9
Simplified73.9%
Final simplification73.9%
(FPCore (x y z) :precision binary64 (- (* x 0.5) (* z y)))
double code(double x, double y, double z) {
return (x * 0.5) - (z * y);
}
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) - (z * y)
end function
public static double code(double x, double y, double z) {
return (x * 0.5) - (z * y);
}
def code(x, y, z): return (x * 0.5) - (z * y)
function code(x, y, z) return Float64(Float64(x * 0.5) - Float64(z * y)) end
function tmp = code(x, y, z) tmp = (x * 0.5) - (z * y); end
code[x_, y_, z_] := N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 0.5 - z \cdot y
\end{array}
Initial program 99.8%
Taylor expanded in z around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6474.9
Simplified74.9%
Final simplification74.9%
(FPCore (x y z) :precision binary64 (* x 0.5))
double code(double x, double y, double z) {
return 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
end function
public static double code(double x, double y, double z) {
return x * 0.5;
}
def code(x, y, z): return x * 0.5
function code(x, y, z) return Float64(x * 0.5) end
function tmp = code(x, y, z) tmp = x * 0.5; end
code[x_, y_, z_] := N[(x * 0.5), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 0.5
\end{array}
Initial program 99.8%
Taylor expanded in x around inf
lower-*.f6438.3
Simplified38.3%
Final simplification38.3%
(FPCore (x y z) :precision binary64 (- (+ y (* 0.5 x)) (* y (- z (log z)))))
double code(double x, double y, double z) {
return (y + (0.5 * x)) - (y * (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 = (y + (0.5d0 * x)) - (y * (z - log(z)))
end function
public static double code(double x, double y, double z) {
return (y + (0.5 * x)) - (y * (z - Math.log(z)));
}
def code(x, y, z): return (y + (0.5 * x)) - (y * (z - math.log(z)))
function code(x, y, z) return Float64(Float64(y + Float64(0.5 * x)) - Float64(y * Float64(z - log(z)))) end
function tmp = code(x, y, z) tmp = (y + (0.5 * x)) - (y * (z - log(z))); end
code[x_, y_, z_] := N[(N[(y + N[(0.5 * x), $MachinePrecision]), $MachinePrecision] - N[(y * N[(z - N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y + 0.5 \cdot x\right) - y \cdot \left(z - \log z\right)
\end{array}
herbie shell --seed 2024207
(FPCore (x y z)
:name "System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2"
:precision binary64
:alt
(! :herbie-platform default (- (+ y (* 1/2 x)) (* y (- z (log z)))))
(+ (* x 0.5) (* y (+ (- 1.0 z) (log z)))))