x \cdot \log \left(\frac{x}{y}\right) - zx \cdot \log \left(\frac{x}{y}\right) - z(FPCore (x y z) :precision binary64 (- (* x (log (/ x y))) z))
(FPCore (x y z) :precision binary64 (- (* x (log (/ x y))) z))
double code(double x, double y, double z) {
return (x * log(x / y)) - z;
}
double code(double x, double y, double z) {
return (x * log(x / y)) - z;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 14.9 |
|---|---|
| Target | 7.3 |
| Herbie | 14.9 |
Initial program 14.9
herbie shell --seed 2021042
(FPCore (x y z)
:name "Numeric.SpecFunctions.Extra:bd0 from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< y 7.595077799083773e-308) (- (* x (log (/ x y))) z) (- (* x (- (log x) (log y))) z))
(- (* x (log (/ x y))) z))