\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\left(\left(x - \left(y + 0.5\right) \cdot \log \left(\sqrt{y}\right)\right) + \left(y - \left(y + 0.5\right) \cdot \log \left(\sqrt{y}\right)\right)\right) - zdouble code(double x, double y, double z) {
return ((double) (((double) (((double) (x - ((double) (((double) (y + 0.5)) * ((double) log(y)))))) + y)) - z));
}
double code(double x, double y, double z) {
return ((double) (((double) (((double) (x - ((double) (((double) (y + 0.5)) * ((double) log(((double) sqrt(y)))))))) + ((double) (y - ((double) (((double) (y + 0.5)) * ((double) log(((double) sqrt(y)))))))))) - z));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
rmApplied add-sqr-sqrt0.1
Applied log-prod0.1
Applied distribute-lft-in0.1
Applied associate--r+0.1
rmApplied sub-neg0.1
Applied associate-+l+0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020196
(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))