
(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ y 0.5) (log y))) y) z))
double code(double x, double y, double z) {
return ((x - ((y + 0.5) * log(y))) + y) - 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 - ((y + 0.5d0) * log(y))) + y) - z
end function
public static double code(double x, double y, double z) {
return ((x - ((y + 0.5) * Math.log(y))) + y) - z;
}
def code(x, y, z): return ((x - ((y + 0.5) * math.log(y))) + y) - z
function code(x, y, z) return Float64(Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y) - z) end
function tmp = code(x, y, z) tmp = ((x - ((y + 0.5) * log(y))) + y) - z; end
code[x_, y_, z_] := N[(N[(N[(x - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ y 0.5) (log y))) y) z))
double code(double x, double y, double z) {
return ((x - ((y + 0.5) * log(y))) + y) - 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 - ((y + 0.5d0) * log(y))) + y) - z
end function
public static double code(double x, double y, double z) {
return ((x - ((y + 0.5) * Math.log(y))) + y) - z;
}
def code(x, y, z): return ((x - ((y + 0.5) * math.log(y))) + y) - z
function code(x, y, z) return Float64(Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y) - z) end
function tmp = code(x, y, z) tmp = ((x - ((y + 0.5) * log(y))) + y) - z; end
code[x_, y_, z_] := N[(N[(N[(x - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\end{array}
(FPCore (x y z) :precision binary64 (+ x (- (fma (log y) (- -0.5 y) y) z)))
double code(double x, double y, double z) {
return x + (fma(log(y), (-0.5 - y), y) - z);
}
function code(x, y, z) return Float64(x + Float64(fma(log(y), Float64(-0.5 - y), y) - z)) end
code[x_, y_, z_] := N[(x + N[(N[(N[Log[y], $MachinePrecision] * N[(-0.5 - y), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\mathsf{fma}\left(\log y, -0.5 - y, y\right) - z\right)
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (- 1.0 (log y)))) (t_1 (+ x t_0)) (t_2 (- t_0 z)))
(if (<= z -4.4e+20)
t_2
(if (<= z 4.8e-177)
t_1
(if (<= z 1.05e-108)
(- x (* (log y) 0.5))
(if (<= z 2.3e+41) t_1 t_2))))))
double code(double x, double y, double z) {
double t_0 = y * (1.0 - log(y));
double t_1 = x + t_0;
double t_2 = t_0 - z;
double tmp;
if (z <= -4.4e+20) {
tmp = t_2;
} else if (z <= 4.8e-177) {
tmp = t_1;
} else if (z <= 1.05e-108) {
tmp = x - (log(y) * 0.5);
} else if (z <= 2.3e+41) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_0 = y * (1.0d0 - log(y))
t_1 = x + t_0
t_2 = t_0 - z
if (z <= (-4.4d+20)) then
tmp = t_2
else if (z <= 4.8d-177) then
tmp = t_1
else if (z <= 1.05d-108) then
tmp = x - (log(y) * 0.5d0)
else if (z <= 2.3d+41) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (1.0 - Math.log(y));
double t_1 = x + t_0;
double t_2 = t_0 - z;
double tmp;
if (z <= -4.4e+20) {
tmp = t_2;
} else if (z <= 4.8e-177) {
tmp = t_1;
} else if (z <= 1.05e-108) {
tmp = x - (Math.log(y) * 0.5);
} else if (z <= 2.3e+41) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z): t_0 = y * (1.0 - math.log(y)) t_1 = x + t_0 t_2 = t_0 - z tmp = 0 if z <= -4.4e+20: tmp = t_2 elif z <= 4.8e-177: tmp = t_1 elif z <= 1.05e-108: tmp = x - (math.log(y) * 0.5) elif z <= 2.3e+41: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(1.0 - log(y))) t_1 = Float64(x + t_0) t_2 = Float64(t_0 - z) tmp = 0.0 if (z <= -4.4e+20) tmp = t_2; elseif (z <= 4.8e-177) tmp = t_1; elseif (z <= 1.05e-108) tmp = Float64(x - Float64(log(y) * 0.5)); elseif (z <= 2.3e+41) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (1.0 - log(y)); t_1 = x + t_0; t_2 = t_0 - z; tmp = 0.0; if (z <= -4.4e+20) tmp = t_2; elseif (z <= 4.8e-177) tmp = t_1; elseif (z <= 1.05e-108) tmp = x - (log(y) * 0.5); elseif (z <= 2.3e+41) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - z), $MachinePrecision]}, If[LessEqual[z, -4.4e+20], t$95$2, If[LessEqual[z, 4.8e-177], t$95$1, If[LessEqual[z, 1.05e-108], N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+41], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(1 - \log y\right)\\
t_1 := x + t_0\\
t_2 := t_0 - z\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+20}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-108}:\\
\;\;\;\;x - \log y \cdot 0.5\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+41}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -1.7e+21) (not (<= z 2.15e+41))) (- (* y (- 1.0 (log y))) z) (+ x (- y (* (log y) (+ y 0.5))))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.7e+21) || !(z <= 2.15e+41)) {
tmp = (y * (1.0 - log(y))) - z;
} else {
tmp = x + (y - (log(y) * (y + 0.5)));
}
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+21)) .or. (.not. (z <= 2.15d+41))) then
tmp = (y * (1.0d0 - log(y))) - z
else
tmp = x + (y - (log(y) * (y + 0.5d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.7e+21) || !(z <= 2.15e+41)) {
tmp = (y * (1.0 - Math.log(y))) - z;
} else {
tmp = x + (y - (Math.log(y) * (y + 0.5)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.7e+21) or not (z <= 2.15e+41): tmp = (y * (1.0 - math.log(y))) - z else: tmp = x + (y - (math.log(y) * (y + 0.5))) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.7e+21) || !(z <= 2.15e+41)) tmp = Float64(Float64(y * Float64(1.0 - log(y))) - z); else tmp = Float64(x + Float64(y - Float64(log(y) * Float64(y + 0.5)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.7e+21) || ~((z <= 2.15e+41))) tmp = (y * (1.0 - log(y))) - z; else tmp = x + (y - (log(y) * (y + 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.7e+21], N[Not[LessEqual[z, 2.15e+41]], $MachinePrecision]], N[(N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(x + N[(y - N[(N[Log[y], $MachinePrecision] * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+21} \lor \neg \left(z \leq 2.15 \cdot 10^{+41}\right):\\
\;\;\;\;y \cdot \left(1 - \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - \log y \cdot \left(y + 0.5\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y 1.02e-6) (- (- x (* (log y) 0.5)) z) (+ x (- (* y (- 1.0 (log y))) z))))
double code(double x, double y, double z) {
double tmp;
if (y <= 1.02e-6) {
tmp = (x - (log(y) * 0.5)) - z;
} else {
tmp = x + ((y * (1.0 - log(y))) - 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 (y <= 1.02d-6) then
tmp = (x - (log(y) * 0.5d0)) - z
else
tmp = x + ((y * (1.0d0 - log(y))) - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 1.02e-6) {
tmp = (x - (Math.log(y) * 0.5)) - z;
} else {
tmp = x + ((y * (1.0 - Math.log(y))) - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 1.02e-6: tmp = (x - (math.log(y) * 0.5)) - z else: tmp = x + ((y * (1.0 - math.log(y))) - z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 1.02e-6) tmp = Float64(Float64(x - Float64(log(y) * 0.5)) - z); else tmp = Float64(x + Float64(Float64(y * Float64(1.0 - log(y))) - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 1.02e-6) tmp = (x - (log(y) * 0.5)) - z; else tmp = x + ((y * (1.0 - log(y))) - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 1.02e-6], N[(N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(x + N[(N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.02 \cdot 10^{-6}:\\
\;\;\;\;\left(x - \log y \cdot 0.5\right) - z\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \left(1 - \log y\right) - z\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (- (+ y (- x (* (log y) (+ y 0.5)))) z))
double code(double x, double y, double z) {
return (y + (x - (log(y) * (y + 0.5)))) - 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 + (x - (log(y) * (y + 0.5d0)))) - z
end function
public static double code(double x, double y, double z) {
return (y + (x - (Math.log(y) * (y + 0.5)))) - z;
}
def code(x, y, z): return (y + (x - (math.log(y) * (y + 0.5)))) - z
function code(x, y, z) return Float64(Float64(y + Float64(x - Float64(log(y) * Float64(y + 0.5)))) - z) end
function tmp = code(x, y, z) tmp = (y + (x - (log(y) * (y + 0.5)))) - z; end
code[x_, y_, z_] := N[(N[(y + N[(x - N[(N[Log[y], $MachinePrecision] * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(y + \left(x - \log y \cdot \left(y + 0.5\right)\right)\right) - z
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -500.0) (not (<= z 0.031))) (- x z) (- x (* (log y) 0.5))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -500.0) || !(z <= 0.031)) {
tmp = x - z;
} else {
tmp = x - (log(y) * 0.5);
}
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 <= (-500.0d0)) .or. (.not. (z <= 0.031d0))) then
tmp = x - z
else
tmp = x - (log(y) * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -500.0) || !(z <= 0.031)) {
tmp = x - z;
} else {
tmp = x - (Math.log(y) * 0.5);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -500.0) or not (z <= 0.031): tmp = x - z else: tmp = x - (math.log(y) * 0.5) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -500.0) || !(z <= 0.031)) tmp = Float64(x - z); else tmp = Float64(x - Float64(log(y) * 0.5)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -500.0) || ~((z <= 0.031))) tmp = x - z; else tmp = x - (log(y) * 0.5); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -500.0], N[Not[LessEqual[z, 0.031]], $MachinePrecision]], N[(x - z), $MachinePrecision], N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -500 \lor \neg \left(z \leq 0.031\right):\\
\;\;\;\;x - z\\
\mathbf{else}:\\
\;\;\;\;x - \log y \cdot 0.5\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y 2.4e+61) (- x z) (+ x (* y (- 1.0 (log y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.4e+61) {
tmp = x - z;
} else {
tmp = x + (y * (1.0 - log(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 <= 2.4d+61) then
tmp = x - z
else
tmp = x + (y * (1.0d0 - log(y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2.4e+61) {
tmp = x - z;
} else {
tmp = x + (y * (1.0 - Math.log(y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2.4e+61: tmp = x - z else: tmp = x + (y * (1.0 - math.log(y))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2.4e+61) tmp = Float64(x - z); else tmp = Float64(x + Float64(y * Float64(1.0 - log(y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2.4e+61) tmp = x - z; else tmp = x + (y * (1.0 - log(y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2.4e+61], N[(x - z), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{+61}:\\
\;\;\;\;x - z\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \log y\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y 5.2e+59) (- (- x (* (log y) 0.5)) z) (+ x (* y (- 1.0 (log y))))))
double code(double x, double y, double z) {
double tmp;
if (y <= 5.2e+59) {
tmp = (x - (log(y) * 0.5)) - z;
} else {
tmp = x + (y * (1.0 - log(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 <= 5.2d+59) then
tmp = (x - (log(y) * 0.5d0)) - z
else
tmp = x + (y * (1.0d0 - log(y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 5.2e+59) {
tmp = (x - (Math.log(y) * 0.5)) - z;
} else {
tmp = x + (y * (1.0 - Math.log(y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 5.2e+59: tmp = (x - (math.log(y) * 0.5)) - z else: tmp = x + (y * (1.0 - math.log(y))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 5.2e+59) tmp = Float64(Float64(x - Float64(log(y) * 0.5)) - z); else tmp = Float64(x + Float64(y * Float64(1.0 - log(y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 5.2e+59) tmp = (x - (log(y) * 0.5)) - z; else tmp = x + (y * (1.0 - log(y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 5.2e+59], N[(N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{+59}:\\
\;\;\;\;\left(x - \log y \cdot 0.5\right) - z\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \log y\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -5.2e+19) (not (<= z 1.8e+41))) (- z) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.2e+19) || !(z <= 1.8e+41)) {
tmp = -z;
} else {
tmp = x;
}
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 <= (-5.2d+19)) .or. (.not. (z <= 1.8d+41))) then
tmp = -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.2e+19) || !(z <= 1.8e+41)) {
tmp = -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.2e+19) or not (z <= 1.8e+41): tmp = -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.2e+19) || !(z <= 1.8e+41)) tmp = Float64(-z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.2e+19) || ~((z <= 1.8e+41))) tmp = -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.2e+19], N[Not[LessEqual[z, 1.8e+41]], $MachinePrecision]], (-z), x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+19} \lor \neg \left(z \leq 1.8 \cdot 10^{+41}\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (- x z))
double code(double x, double y, double z) {
return x - 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 - z
end function
public static double code(double x, double y, double z) {
return x - z;
}
def code(x, y, z): return x - z
function code(x, y, z) return Float64(x - z) end
function tmp = code(x, y, z) tmp = x - z; end
code[x_, y_, z_] := N[(x - z), $MachinePrecision]
\begin{array}{l}
\\
x - z
\end{array}
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
(FPCore (x y z) :precision binary64 (- (- (+ y x) z) (* (+ y 0.5) (log y))))
double code(double x, double y, double z) {
return ((y + x) - z) - ((y + 0.5) * log(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 + x) - z) - ((y + 0.5d0) * log(y))
end function
public static double code(double x, double y, double z) {
return ((y + x) - z) - ((y + 0.5) * Math.log(y));
}
def code(x, y, z): return ((y + x) - z) - ((y + 0.5) * math.log(y))
function code(x, y, z) return Float64(Float64(Float64(y + x) - z) - Float64(Float64(y + 0.5) * log(y))) end
function tmp = code(x, y, z) tmp = ((y + x) - z) - ((y + 0.5) * log(y)); end
code[x_, y_, z_] := N[(N[(N[(y + x), $MachinePrecision] - z), $MachinePrecision] - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(y + x\right) - z\right) - \left(y + 0.5\right) \cdot \log y
\end{array}
herbie shell --seed 2023350
(FPCore (x y z)
:name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(- (- (+ y x) z) (* (+ y 0.5) (log y)))
(- (+ (- x (* (+ y 0.5) (log y))) y) z))