(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ y 0.5) (log y))) y) z))
(FPCore (x y z) :precision binary64 (+ (fma (pow (cbrt y) 2.0) (cbrt y) (* (log y) (- -0.5 y))) (- x z)))
double code(double x, double y, double z) {
return ((x - ((y + 0.5) * log(y))) + y) - z;
}
double code(double x, double y, double z) {
return fma(pow(cbrt(y), 2.0), cbrt(y), (log(y) * (-0.5 - y))) + (x - z);
}
function code(x, y, z) return Float64(Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y) - z) end
function code(x, y, z) return Float64(fma((cbrt(y) ^ 2.0), cbrt(y), Float64(log(y) * Float64(-0.5 - y))) + Float64(x - 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]
code[x_, y_, z_] := N[(N[(N[Power[N[Power[y, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[y, 1/3], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-0.5 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x - z), $MachinePrecision]), $MachinePrecision]
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\mathsf{fma}\left({\left(\sqrt[3]{y}\right)}^{2}, \sqrt[3]{y}, \log y \cdot \left(-0.5 - y\right)\right) + \left(x - z\right)




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
Applied egg-rr0.5
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022162
(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))