
(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 9 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 (- (log z) z)) y (* x 0.5)))
double code(double x, double y, double z) {
return fma((1.0 + (log(z) - z)), y, (x * 0.5));
}
function code(x, y, z) return fma(Float64(1.0 + Float64(log(z) - z)), y, Float64(x * 0.5)) end
code[x_, y_, z_] := N[(N[(1.0 + N[(N[Log[z], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] * y + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(1 + \left(\log z - z\right), y, x \cdot 0.5\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
sub-neg99.9%
associate-+l+99.9%
+-commutative99.9%
sub-neg99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= (* x 0.5) -5e-217) (not (<= (* x 0.5) 5e-290))) (- (* x 0.5) (* z y)) (* y (+ 1.0 (log z)))))
double code(double x, double y, double z) {
double tmp;
if (((x * 0.5) <= -5e-217) || !((x * 0.5) <= 5e-290)) {
tmp = (x * 0.5) - (z * y);
} else {
tmp = y * (1.0 + log(z));
}
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) :: tmp
if (((x * 0.5d0) <= (-5d-217)) .or. (.not. ((x * 0.5d0) <= 5d-290))) then
tmp = (x * 0.5d0) - (z * y)
else
tmp = y * (1.0d0 + log(z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (((x * 0.5) <= -5e-217) || !((x * 0.5) <= 5e-290)) {
tmp = (x * 0.5) - (z * y);
} else {
tmp = y * (1.0 + Math.log(z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if ((x * 0.5) <= -5e-217) or not ((x * 0.5) <= 5e-290): tmp = (x * 0.5) - (z * y) else: tmp = y * (1.0 + math.log(z)) return tmp
function code(x, y, z) tmp = 0.0 if ((Float64(x * 0.5) <= -5e-217) || !(Float64(x * 0.5) <= 5e-290)) tmp = Float64(Float64(x * 0.5) - Float64(z * y)); else tmp = Float64(y * Float64(1.0 + log(z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (((x * 0.5) <= -5e-217) || ~(((x * 0.5) <= 5e-290))) tmp = (x * 0.5) - (z * y); else tmp = y * (1.0 + log(z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[N[(x * 0.5), $MachinePrecision], -5e-217], N[Not[LessEqual[N[(x * 0.5), $MachinePrecision], 5e-290]], $MachinePrecision]], N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision], N[(y * N[(1.0 + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot 0.5 \leq -5 \cdot 10^{-217} \lor \neg \left(x \cdot 0.5 \leq 5 \cdot 10^{-290}\right):\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 + \log z\right)\\
\end{array}
\end{array}
if (*.f64 x 1/2) < -5.0000000000000002e-217 or 5.0000000000000001e-290 < (*.f64 x 1/2) Initial program 99.9%
Taylor expanded in z around inf 79.7%
mul-1-neg79.7%
distribute-rgt-neg-out79.7%
Simplified79.7%
distribute-rgt-neg-out79.7%
unsub-neg79.7%
Applied egg-rr79.7%
if -5.0000000000000002e-217 < (*.f64 x 1/2) < 5.0000000000000001e-290Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
distribute-lft-in99.7%
*-rgt-identity99.7%
associate-+r+99.7%
fma-def99.7%
+-commutative99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in z around 0 71.8%
Taylor expanded in y around inf 71.8%
Final simplification79.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -115000000000.0) (not (<= y 4.1e+29))) (* (+ 1.0 (- (log z) z)) y) (- (* x 0.5) (* z y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -115000000000.0) || !(y <= 4.1e+29)) {
tmp = (1.0 + (log(z) - z)) * y;
} else {
tmp = (x * 0.5) - (z * y);
}
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) :: tmp
if ((y <= (-115000000000.0d0)) .or. (.not. (y <= 4.1d+29))) then
tmp = (1.0d0 + (log(z) - z)) * y
else
tmp = (x * 0.5d0) - (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -115000000000.0) || !(y <= 4.1e+29)) {
tmp = (1.0 + (Math.log(z) - z)) * y;
} else {
tmp = (x * 0.5) - (z * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -115000000000.0) or not (y <= 4.1e+29): tmp = (1.0 + (math.log(z) - z)) * y else: tmp = (x * 0.5) - (z * y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -115000000000.0) || !(y <= 4.1e+29)) tmp = Float64(Float64(1.0 + Float64(log(z) - z)) * y); else tmp = Float64(Float64(x * 0.5) - Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -115000000000.0) || ~((y <= 4.1e+29))) tmp = (1.0 + (log(z) - z)) * y; else tmp = (x * 0.5) - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -115000000000.0], N[Not[LessEqual[y, 4.1e+29]], $MachinePrecision]], N[(N[(1.0 + N[(N[Log[z], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -115000000000 \lor \neg \left(y \leq 4.1 \cdot 10^{+29}\right):\\
\;\;\;\;\left(1 + \left(\log z - z\right)\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\end{array}
\end{array}
if y < -1.15e11 or 4.1000000000000003e29 < y Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
distribute-lft-in99.8%
*-rgt-identity99.8%
associate-+r+99.8%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 88.2%
*-commutative88.2%
distribute-rgt1-in88.3%
+-commutative88.3%
Applied egg-rr88.3%
if -1.15e11 < y < 4.1000000000000003e29Initial program 99.9%
Taylor expanded in z around inf 87.7%
mul-1-neg87.7%
distribute-rgt-neg-out87.7%
Simplified87.7%
distribute-rgt-neg-out87.7%
unsub-neg87.7%
Applied egg-rr87.7%
Final simplification88.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (log z) z)))
(if (<= y -3.5e+14)
(+ y (* t_0 y))
(if (<= y 5.8e+34) (- (* x 0.5) (* z y)) (* (+ 1.0 t_0) y)))))
double code(double x, double y, double z) {
double t_0 = log(z) - z;
double tmp;
if (y <= -3.5e+14) {
tmp = y + (t_0 * y);
} else if (y <= 5.8e+34) {
tmp = (x * 0.5) - (z * y);
} else {
tmp = (1.0 + t_0) * y;
}
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 = log(z) - z
if (y <= (-3.5d+14)) then
tmp = y + (t_0 * y)
else if (y <= 5.8d+34) then
tmp = (x * 0.5d0) - (z * y)
else
tmp = (1.0d0 + t_0) * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.log(z) - z;
double tmp;
if (y <= -3.5e+14) {
tmp = y + (t_0 * y);
} else if (y <= 5.8e+34) {
tmp = (x * 0.5) - (z * y);
} else {
tmp = (1.0 + t_0) * y;
}
return tmp;
}
def code(x, y, z): t_0 = math.log(z) - z tmp = 0 if y <= -3.5e+14: tmp = y + (t_0 * y) elif y <= 5.8e+34: tmp = (x * 0.5) - (z * y) else: tmp = (1.0 + t_0) * y return tmp
function code(x, y, z) t_0 = Float64(log(z) - z) tmp = 0.0 if (y <= -3.5e+14) tmp = Float64(y + Float64(t_0 * y)); elseif (y <= 5.8e+34) tmp = Float64(Float64(x * 0.5) - Float64(z * y)); else tmp = Float64(Float64(1.0 + t_0) * y); end return tmp end
function tmp_2 = code(x, y, z) t_0 = log(z) - z; tmp = 0.0; if (y <= -3.5e+14) tmp = y + (t_0 * y); elseif (y <= 5.8e+34) tmp = (x * 0.5) - (z * y); else tmp = (1.0 + t_0) * y; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[z], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, -3.5e+14], N[(y + N[(t$95$0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e+34], N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + t$95$0), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log z - z\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+14}:\\
\;\;\;\;y + t_0 \cdot y\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+34}:\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t_0\right) \cdot y\\
\end{array}
\end{array}
if y < -3.5e14Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
distribute-lft-in99.9%
*-rgt-identity99.9%
associate-+r+99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 86.8%
if -3.5e14 < y < 5.8000000000000003e34Initial program 99.9%
Taylor expanded in z around inf 87.7%
mul-1-neg87.7%
distribute-rgt-neg-out87.7%
Simplified87.7%
distribute-rgt-neg-out87.7%
unsub-neg87.7%
Applied egg-rr87.7%
if 5.8000000000000003e34 < y Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
distribute-lft-in99.8%
*-rgt-identity99.8%
associate-+r+99.8%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 89.4%
*-commutative89.4%
distribute-rgt1-in89.5%
+-commutative89.5%
Applied egg-rr89.5%
Final simplification88.0%
(FPCore (x y z) :precision binary64 (if (<= z 0.28) (+ (* (log z) y) (+ y (* x 0.5))) (- (* x 0.5) (* z y))))
double code(double x, double y, double z) {
double tmp;
if (z <= 0.28) {
tmp = (log(z) * y) + (y + (x * 0.5));
} else {
tmp = (x * 0.5) - (z * y);
}
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) :: tmp
if (z <= 0.28d0) then
tmp = (log(z) * y) + (y + (x * 0.5d0))
else
tmp = (x * 0.5d0) - (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 0.28) {
tmp = (Math.log(z) * y) + (y + (x * 0.5));
} else {
tmp = (x * 0.5) - (z * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 0.28: tmp = (math.log(z) * y) + (y + (x * 0.5)) else: tmp = (x * 0.5) - (z * y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 0.28) tmp = Float64(Float64(log(z) * y) + Float64(y + Float64(x * 0.5))); else tmp = Float64(Float64(x * 0.5) - Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 0.28) tmp = (log(z) * y) + (y + (x * 0.5)); else tmp = (x * 0.5) - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 0.28], N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] + N[(y + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.28:\\
\;\;\;\;\log z \cdot y + \left(y + x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\end{array}
\end{array}
if z < 0.28000000000000003Initial program 99.9%
sub-neg99.9%
associate-+l+99.9%
distribute-lft-in99.8%
*-rgt-identity99.8%
associate-+r+99.8%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in z around 0 98.4%
if 0.28000000000000003 < z Initial program 100.0%
Taylor expanded in z around inf 99.1%
mul-1-neg99.1%
distribute-rgt-neg-out99.1%
Simplified99.1%
distribute-rgt-neg-out99.1%
unsub-neg99.1%
Applied egg-rr99.1%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (+ (* x 0.5) (* y (+ (log z) (- 1.0 z)))))
double code(double x, double y, double z) {
return (x * 0.5) + (y * (log(z) + (1.0 - 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 * (log(z) + (1.0d0 - z)))
end function
public static double code(double x, double y, double z) {
return (x * 0.5) + (y * (Math.log(z) + (1.0 - z)));
}
def code(x, y, z): return (x * 0.5) + (y * (math.log(z) + (1.0 - z)))
function code(x, y, z) return Float64(Float64(x * 0.5) + Float64(y * Float64(log(z) + Float64(1.0 - z)))) end
function tmp = code(x, y, z) tmp = (x * 0.5) + (y * (log(z) + (1.0 - z))); end
code[x_, y_, z_] := N[(N[(x * 0.5), $MachinePrecision] + N[(y * N[(N[Log[z], $MachinePrecision] + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 0.5 + y \cdot \left(\log z + \left(1 - z\right)\right)
\end{array}
Initial program 99.9%
Final simplification99.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.9%
Taylor expanded in z around inf 75.0%
mul-1-neg75.0%
distribute-rgt-neg-out75.0%
Simplified75.0%
distribute-rgt-neg-out75.0%
unsub-neg75.0%
Applied egg-rr75.0%
Final simplification75.0%
(FPCore (x y z) :precision binary64 (if (<= z 2.6e+21) (* x 0.5) (* z (- y))))
double code(double x, double y, double z) {
double tmp;
if (z <= 2.6e+21) {
tmp = x * 0.5;
} else {
tmp = z * -y;
}
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) :: tmp
if (z <= 2.6d+21) then
tmp = x * 0.5d0
else
tmp = z * -y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 2.6e+21) {
tmp = x * 0.5;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 2.6e+21: tmp = x * 0.5 else: tmp = z * -y return tmp
function code(x, y, z) tmp = 0.0 if (z <= 2.6e+21) tmp = Float64(x * 0.5); else tmp = Float64(z * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 2.6e+21) tmp = x * 0.5; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 2.6e+21], N[(x * 0.5), $MachinePrecision], N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.6 \cdot 10^{+21}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if z < 2.6e21Initial program 99.9%
Taylor expanded in x around inf 54.1%
if 2.6e21 < z Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
fma-def100.0%
sub-neg100.0%
associate-+l+100.0%
+-commutative100.0%
sub-neg100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 74.3%
mul-1-neg74.3%
*-commutative74.3%
distribute-rgt-neg-in74.3%
Simplified74.3%
Final simplification62.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.9%
Taylor expanded in x around inf 42.7%
Final simplification42.7%
(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 2023215
(FPCore (x y z)
:name "System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2"
:precision binary64
:herbie-target
(- (+ y (* 0.5 x)) (* y (- z (log z))))
(+ (* x 0.5) (* y (+ (- 1.0 z) (log z)))))