\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\left(x + \mathsf{fma}\left(-\log y, y + 0.5, y\right)\right) - zdouble f(double x, double y, double z) {
double r361415 = x;
double r361416 = y;
double r361417 = 0.5;
double r361418 = r361416 + r361417;
double r361419 = log(r361416);
double r361420 = r361418 * r361419;
double r361421 = r361415 - r361420;
double r361422 = r361421 + r361416;
double r361423 = z;
double r361424 = r361422 - r361423;
return r361424;
}
double f(double x, double y, double z) {
double r361425 = x;
double r361426 = y;
double r361427 = log(r361426);
double r361428 = -r361427;
double r361429 = 0.5;
double r361430 = r361426 + r361429;
double r361431 = fma(r361428, r361430, r361426);
double r361432 = r361425 + r361431;
double r361433 = z;
double r361434 = r361432 - r361433;
return r361434;
}




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
rmApplied sub-neg0.1
Applied associate-+l+0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019322 +o rules:numerics
(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))