
(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 (- (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
(let* ((t_0 (* y (+ 1.0 (log z)))) (t_1 (- (* x 0.5) (* z y))))
(if (<= z 2.9e-198)
t_1
(if (<= z 3.8e-146)
t_0
(if (<= z 3.4e-123)
t_1
(if (<= z 5e-70) t_0 (fma (- z) y (* x 0.5))))))))
double code(double x, double y, double z) {
double t_0 = y * (1.0 + log(z));
double t_1 = (x * 0.5) - (z * y);
double tmp;
if (z <= 2.9e-198) {
tmp = t_1;
} else if (z <= 3.8e-146) {
tmp = t_0;
} else if (z <= 3.4e-123) {
tmp = t_1;
} else if (z <= 5e-70) {
tmp = t_0;
} else {
tmp = fma(-z, y, (x * 0.5));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(y * Float64(1.0 + log(z))) t_1 = Float64(Float64(x * 0.5) - Float64(z * y)) tmp = 0.0 if (z <= 2.9e-198) tmp = t_1; elseif (z <= 3.8e-146) tmp = t_0; elseif (z <= 3.4e-123) tmp = t_1; elseif (z <= 5e-70) tmp = t_0; else tmp = fma(Float64(-z), y, Float64(x * 0.5)); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(1.0 + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.9e-198], t$95$1, If[LessEqual[z, 3.8e-146], t$95$0, If[LessEqual[z, 3.4e-123], t$95$1, If[LessEqual[z, 5e-70], t$95$0, N[((-z) * y + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(1 + \log z\right)\\
t_1 := x \cdot 0.5 - z \cdot y\\
\mathbf{if}\;z \leq 2.9 \cdot 10^{-198}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-146}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-70}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, x \cdot 0.5\right)\\
\end{array}
\end{array}
if z < 2.90000000000000001e-198 or 3.79999999999999994e-146 < z < 3.4000000000000001e-123Initial program 99.8%
Taylor expanded in z around inf 65.3%
mul-1-neg65.3%
distribute-rgt-neg-out65.3%
Simplified65.3%
if 2.90000000000000001e-198 < z < 3.79999999999999994e-146 or 3.4000000000000001e-123 < z < 4.9999999999999998e-70Initial program 99.6%
sub-neg99.6%
associate-+l+99.6%
distribute-lft-in99.6%
*-rgt-identity99.6%
associate-+r+99.6%
fma-def99.6%
+-commutative99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in y around -inf 75.1%
mul-1-neg75.1%
distribute-rgt-neg-in75.1%
sub-neg75.1%
mul-1-neg75.1%
sub-neg75.1%
+-commutative75.1%
distribute-neg-in75.1%
remove-double-neg75.1%
sub-neg75.1%
metadata-eval75.1%
+-commutative75.1%
Simplified75.1%
Taylor expanded in z around 0 75.1%
if 4.9999999999999998e-70 < z Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
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 90.8%
neg-mul-190.8%
Simplified90.8%
Final simplification82.4%
(FPCore (x y z)
:precision binary64
(if (or (<= z 2.95e-198)
(not
(or (<= z 9.4e-147) (and (not (<= z 3.3e-124)) (<= z 1.95e-66)))))
(- (* x 0.5) (* z y))
(* y (+ 1.0 (log z)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= 2.95e-198) || !((z <= 9.4e-147) || (!(z <= 3.3e-124) && (z <= 1.95e-66)))) {
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 ((z <= 2.95d-198) .or. (.not. (z <= 9.4d-147) .or. (.not. (z <= 3.3d-124)) .and. (z <= 1.95d-66))) 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 ((z <= 2.95e-198) || !((z <= 9.4e-147) || (!(z <= 3.3e-124) && (z <= 1.95e-66)))) {
tmp = (x * 0.5) - (z * y);
} else {
tmp = y * (1.0 + Math.log(z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= 2.95e-198) or not ((z <= 9.4e-147) or (not (z <= 3.3e-124) and (z <= 1.95e-66))): 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 ((z <= 2.95e-198) || !((z <= 9.4e-147) || (!(z <= 3.3e-124) && (z <= 1.95e-66)))) 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 ((z <= 2.95e-198) || ~(((z <= 9.4e-147) || (~((z <= 3.3e-124)) && (z <= 1.95e-66))))) 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[z, 2.95e-198], N[Not[Or[LessEqual[z, 9.4e-147], And[N[Not[LessEqual[z, 3.3e-124]], $MachinePrecision], LessEqual[z, 1.95e-66]]]], $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}\;z \leq 2.95 \cdot 10^{-198} \lor \neg \left(z \leq 9.4 \cdot 10^{-147} \lor \neg \left(z \leq 3.3 \cdot 10^{-124}\right) \land z \leq 1.95 \cdot 10^{-66}\right):\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 + \log z\right)\\
\end{array}
\end{array}
if z < 2.94999999999999987e-198 or 9.39999999999999978e-147 < z < 3.29999999999999984e-124 or 1.94999999999999991e-66 < z Initial program 99.9%
Taylor expanded in z around inf 84.1%
mul-1-neg84.1%
distribute-rgt-neg-out84.1%
Simplified84.1%
if 2.94999999999999987e-198 < z < 9.39999999999999978e-147 or 3.29999999999999984e-124 < z < 1.94999999999999991e-66Initial program 99.6%
sub-neg99.6%
associate-+l+99.6%
distribute-lft-in99.6%
*-rgt-identity99.6%
associate-+r+99.6%
fma-def99.6%
+-commutative99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in y around -inf 75.1%
mul-1-neg75.1%
distribute-rgt-neg-in75.1%
sub-neg75.1%
mul-1-neg75.1%
sub-neg75.1%
+-commutative75.1%
distribute-neg-in75.1%
remove-double-neg75.1%
sub-neg75.1%
metadata-eval75.1%
+-commutative75.1%
Simplified75.1%
Taylor expanded in z around 0 75.1%
Final simplification82.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.3e+16) (not (<= y 1.28e+63))) (* y (- (+ 1.0 (log z)) z)) (fma (- z) y (* x 0.5))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.3e+16) || !(y <= 1.28e+63)) {
tmp = y * ((1.0 + log(z)) - z);
} else {
tmp = fma(-z, y, (x * 0.5));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((y <= -3.3e+16) || !(y <= 1.28e+63)) tmp = Float64(y * Float64(Float64(1.0 + log(z)) - z)); else tmp = fma(Float64(-z), y, Float64(x * 0.5)); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.3e+16], N[Not[LessEqual[y, 1.28e+63]], $MachinePrecision]], N[(y * N[(N[(1.0 + N[Log[z], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[((-z) * y + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+16} \lor \neg \left(y \leq 1.28 \cdot 10^{+63}\right):\\
\;\;\;\;y \cdot \left(\left(1 + \log z\right) - z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, x \cdot 0.5\right)\\
\end{array}
\end{array}
if y < -3.3e16 or 1.27999999999999994e63 < y Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
fma-def99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
sub-neg99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 86.3%
if -3.3e16 < y < 1.27999999999999994e63Initial 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%
Taylor expanded in z around inf 87.0%
neg-mul-187.0%
Simplified87.0%
Final simplification86.7%
(FPCore (x y z) :precision binary64 (if (<= z 0.28) (+ (* (log z) y) (+ y (* x 0.5))) (fma (- z) y (* x 0.5))))
double code(double x, double y, double z) {
double tmp;
if (z <= 0.28) {
tmp = (log(z) * y) + (y + (x * 0.5));
} else {
tmp = fma(-z, y, (x * 0.5));
}
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 = fma(Float64(-z), y, Float64(x * 0.5)); end return 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[((-z) * y + N[(x * 0.5), $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}:\\
\;\;\;\;\mathsf{fma}\left(-z, y, x \cdot 0.5\right)\\
\end{array}
\end{array}
if z < 0.28000000000000003Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
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 98.9%
if 0.28000000000000003 < 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 96.9%
neg-mul-196.9%
Simplified96.9%
Final simplification97.9%
(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 73.4%
mul-1-neg73.4%
distribute-rgt-neg-out73.4%
Simplified73.4%
Final simplification73.4%
(FPCore (x y z) :precision binary64 (if (<= z 3.5e+45) (* x 0.5) (* z (- y))))
double code(double x, double y, double z) {
double tmp;
if (z <= 3.5e+45) {
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 <= 3.5d+45) 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 <= 3.5e+45) {
tmp = x * 0.5;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 3.5e+45: tmp = x * 0.5 else: tmp = z * -y return tmp
function code(x, y, z) tmp = 0.0 if (z <= 3.5e+45) 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 <= 3.5e+45) tmp = x * 0.5; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 3.5e+45], N[(x * 0.5), $MachinePrecision], N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.5 \cdot 10^{+45}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if z < 3.50000000000000023e45Initial program 99.8%
Taylor expanded in x around inf 50.5%
if 3.50000000000000023e45 < 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 77.1%
mul-1-neg77.1%
*-commutative77.1%
distribute-rgt-neg-in77.1%
Simplified77.1%
Final simplification61.5%
(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 39.5%
Final simplification39.5%
(FPCore (x y z) :precision binary64 y)
double code(double x, double y, double z) {
return y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y
end function
public static double code(double x, double y, double z) {
return y;
}
def code(x, y, z): return y
function code(x, y, z) return y end
function tmp = code(x, y, z) tmp = y; end
code[x_, y_, z_] := y
\begin{array}{l}
\\
y
\end{array}
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 y around -inf 61.4%
mul-1-neg61.4%
distribute-rgt-neg-in61.4%
sub-neg61.4%
mul-1-neg61.4%
sub-neg61.4%
+-commutative61.4%
distribute-neg-in61.4%
remove-double-neg61.4%
sub-neg61.4%
metadata-eval61.4%
+-commutative61.4%
Simplified61.4%
add-exp-log58.9%
Applied egg-rr58.9%
Taylor expanded in z around inf 35.2%
Taylor expanded in z around 0 1.8%
Final simplification1.8%
(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 2023207
(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)))))