
(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 (if (or (<= z 3.7e-294) (and (not (<= z 2.6e-241)) (<= z 4e-158))) (* y (+ 1.0 (log z))) (- (* x 0.5) (* z y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= 3.7e-294) || (!(z <= 2.6e-241) && (z <= 4e-158))) {
tmp = y * (1.0 + log(z));
} 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 <= 3.7d-294) .or. (.not. (z <= 2.6d-241)) .and. (z <= 4d-158)) then
tmp = y * (1.0d0 + log(z))
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 <= 3.7e-294) || (!(z <= 2.6e-241) && (z <= 4e-158))) {
tmp = y * (1.0 + Math.log(z));
} else {
tmp = (x * 0.5) - (z * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= 3.7e-294) or (not (z <= 2.6e-241) and (z <= 4e-158)): tmp = y * (1.0 + math.log(z)) else: tmp = (x * 0.5) - (z * y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= 3.7e-294) || (!(z <= 2.6e-241) && (z <= 4e-158))) tmp = Float64(y * Float64(1.0 + log(z))); 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 <= 3.7e-294) || (~((z <= 2.6e-241)) && (z <= 4e-158))) tmp = y * (1.0 + log(z)); else tmp = (x * 0.5) - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, 3.7e-294], And[N[Not[LessEqual[z, 2.6e-241]], $MachinePrecision], LessEqual[z, 4e-158]]], N[(y * N[(1.0 + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.7 \cdot 10^{-294} \lor \neg \left(z \leq 2.6 \cdot 10^{-241}\right) \land z \leq 4 \cdot 10^{-158}:\\
\;\;\;\;y \cdot \left(1 + \log z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\end{array}
\end{array}
if z < 3.69999999999999994e-294 or 2.5999999999999999e-241 < z < 4.00000000000000026e-158Initial program 99.6%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around 0 67.6%
if 3.69999999999999994e-294 < z < 2.5999999999999999e-241 or 4.00000000000000026e-158 < z Initial program 99.9%
Taylor expanded in z around inf 88.6%
mul-1-neg88.6%
distribute-rgt-neg-out88.6%
Simplified88.6%
Final simplification85.0%
(FPCore (x y z)
:precision binary64
(if (<= z 4.6e-295)
(* y (+ 1.0 (log z)))
(if (or (<= z 2.9e-241) (not (<= z 4.4e-158)))
(- (* x 0.5) (* z y))
(+ y (* (log z) y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= 4.6e-295) {
tmp = y * (1.0 + log(z));
} else if ((z <= 2.9e-241) || !(z <= 4.4e-158)) {
tmp = (x * 0.5) - (z * y);
} else {
tmp = y + (log(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 <= 4.6d-295) then
tmp = y * (1.0d0 + log(z))
else if ((z <= 2.9d-241) .or. (.not. (z <= 4.4d-158))) then
tmp = (x * 0.5d0) - (z * y)
else
tmp = y + (log(z) * y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= 4.6e-295) {
tmp = y * (1.0 + Math.log(z));
} else if ((z <= 2.9e-241) || !(z <= 4.4e-158)) {
tmp = (x * 0.5) - (z * y);
} else {
tmp = y + (Math.log(z) * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 4.6e-295: tmp = y * (1.0 + math.log(z)) elif (z <= 2.9e-241) or not (z <= 4.4e-158): tmp = (x * 0.5) - (z * y) else: tmp = y + (math.log(z) * y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 4.6e-295) tmp = Float64(y * Float64(1.0 + log(z))); elseif ((z <= 2.9e-241) || !(z <= 4.4e-158)) tmp = Float64(Float64(x * 0.5) - Float64(z * y)); else tmp = Float64(y + Float64(log(z) * y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= 4.6e-295) tmp = y * (1.0 + log(z)); elseif ((z <= 2.9e-241) || ~((z <= 4.4e-158))) tmp = (x * 0.5) - (z * y); else tmp = y + (log(z) * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 4.6e-295], N[(y * N[(1.0 + N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.9e-241], N[Not[LessEqual[z, 4.4e-158]], $MachinePrecision]], N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision], N[(y + N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.6 \cdot 10^{-295}:\\
\;\;\;\;y \cdot \left(1 + \log z\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-241} \lor \neg \left(z \leq 4.4 \cdot 10^{-158}\right):\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\mathbf{else}:\\
\;\;\;\;y + \log z \cdot y\\
\end{array}
\end{array}
if z < 4.6e-295Initial program 99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 87.7%
if 4.6e-295 < z < 2.8999999999999999e-241 or 4.4000000000000002e-158 < z Initial program 99.9%
Taylor expanded in z around inf 88.6%
mul-1-neg88.6%
distribute-rgt-neg-out88.6%
Simplified88.6%
if 2.8999999999999999e-241 < z < 4.4000000000000002e-158Initial program 99.5%
sub-neg99.5%
associate-+l+99.5%
distribute-lft-in99.6%
*-rgt-identity99.6%
associate-+r+99.6%
fma-def99.6%
+-commutative99.6%
unsub-neg99.6%
Simplified99.6%
flip--99.4%
associate-*r/99.4%
pow299.4%
+-commutative99.4%
Applied egg-rr99.4%
*-commutative99.4%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in x around 0 63.0%
associate-/l*63.0%
unpow263.0%
+-commutative63.0%
Simplified63.0%
Taylor expanded in z around 0 63.1%
Final simplification85.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -3e+52) (not (<= y 1.9e+46))) (* y (- (+ 1.0 (log z)) z)) (- (* x 0.5) (* z y))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3e+52) || !(y <= 1.9e+46)) {
tmp = y * ((1.0 + log(z)) - z);
} 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 <= (-3d+52)) .or. (.not. (y <= 1.9d+46))) then
tmp = y * ((1.0d0 + log(z)) - z)
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 <= -3e+52) || !(y <= 1.9e+46)) {
tmp = y * ((1.0 + Math.log(z)) - z);
} else {
tmp = (x * 0.5) - (z * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3e+52) or not (y <= 1.9e+46): tmp = y * ((1.0 + math.log(z)) - z) else: tmp = (x * 0.5) - (z * y) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3e+52) || !(y <= 1.9e+46)) tmp = Float64(y * Float64(Float64(1.0 + log(z)) - z)); 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 <= -3e+52) || ~((y <= 1.9e+46))) tmp = y * ((1.0 + log(z)) - z); else tmp = (x * 0.5) - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3e+52], N[Not[LessEqual[y, 1.9e+46]], $MachinePrecision]], N[(y * N[(N[(1.0 + N[Log[z], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(x * 0.5), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+52} \lor \neg \left(y \leq 1.9 \cdot 10^{+46}\right):\\
\;\;\;\;y \cdot \left(\left(1 + \log z\right) - z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\end{array}
\end{array}
if y < -3e52 or 1.9e46 < 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 88.5%
if -3e52 < y < 1.9e46Initial program 99.9%
Taylor expanded in z around inf 91.7%
mul-1-neg91.7%
distribute-rgt-neg-out91.7%
Simplified91.7%
Final simplification90.4%
(FPCore (x y z) :precision binary64 (if (<= z 0.041) (+ (* x 0.5) (* y (+ 1.0 (log z)))) (- (* x 0.5) (* z y))))
double code(double x, double y, double z) {
double tmp;
if (z <= 0.041) {
tmp = (x * 0.5) + (y * (1.0 + log(z)));
} 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.041d0) then
tmp = (x * 0.5d0) + (y * (1.0d0 + log(z)))
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.041) {
tmp = (x * 0.5) + (y * (1.0 + Math.log(z)));
} else {
tmp = (x * 0.5) - (z * y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 0.041: tmp = (x * 0.5) + (y * (1.0 + math.log(z))) else: tmp = (x * 0.5) - (z * y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= 0.041) tmp = Float64(Float64(x * 0.5) + Float64(y * Float64(1.0 + log(z)))); 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.041) tmp = (x * 0.5) + (y * (1.0 + log(z))); else tmp = (x * 0.5) - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 0.041], N[(N[(x * 0.5), $MachinePrecision] + N[(y * N[(1.0 + N[Log[z], $MachinePrecision]), $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.041:\\
\;\;\;\;x \cdot 0.5 + y \cdot \left(1 + \log z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 0.5 - z \cdot y\\
\end{array}
\end{array}
if z < 0.0410000000000000017Initial program 99.7%
Taylor expanded in z around 0 98.8%
if 0.0410000000000000017 < z Initial program 100.0%
Taylor expanded in z around inf 99.6%
mul-1-neg99.6%
distribute-rgt-neg-out99.6%
Simplified99.6%
Final simplification99.3%
(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 79.3%
mul-1-neg79.3%
distribute-rgt-neg-out79.3%
Simplified79.3%
Final simplification79.3%
(FPCore (x y z) :precision binary64 (if (<= z 1.7e+94) (* x 0.5) (* z (- y))))
double code(double x, double y, double z) {
double tmp;
if (z <= 1.7e+94) {
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 <= 1.7d+94) 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 <= 1.7e+94) {
tmp = x * 0.5;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= 1.7e+94: tmp = x * 0.5 else: tmp = z * -y return tmp
function code(x, y, z) tmp = 0.0 if (z <= 1.7e+94) 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 <= 1.7e+94) tmp = x * 0.5; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, 1.7e+94], N[(x * 0.5), $MachinePrecision], N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.7 \cdot 10^{+94}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if z < 1.7000000000000001e94Initial program 99.8%
Taylor expanded in x around inf 55.6%
if 1.7000000000000001e94 < 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 82.4%
mul-1-neg82.4%
*-commutative82.4%
distribute-rgt-neg-in82.4%
Simplified82.4%
Final simplification65.6%
(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 41.7%
Final simplification41.7%
(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%
flip--82.3%
associate-*r/79.1%
pow279.1%
+-commutative79.1%
Applied egg-rr79.1%
*-commutative79.1%
associate-/l*80.8%
Simplified80.8%
add-cube-cbrt80.4%
pow380.4%
associate-/r/81.9%
unpow281.9%
+-commutative81.9%
flip--99.0%
Applied egg-rr99.0%
Taylor expanded in y around inf 2.0%
Final simplification2.0%
(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 2023174
(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)))))