\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, z - y\right)\right) + \mathsf{fma}\left(\log y, y + 0.5, z - y\right) \cdot \left(\left(-1\right) + 1\right)double f(double x, double y, double z) {
double r328365 = x;
double r328366 = y;
double r328367 = 0.5;
double r328368 = r328366 + r328367;
double r328369 = log(r328366);
double r328370 = r328368 * r328369;
double r328371 = r328365 - r328370;
double r328372 = r328371 + r328366;
double r328373 = z;
double r328374 = r328372 - r328373;
return r328374;
}
double f(double x, double y, double z) {
double r328375 = x;
double r328376 = y;
double r328377 = log(r328376);
double r328378 = 0.5;
double r328379 = r328376 + r328378;
double r328380 = z;
double r328381 = r328380 - r328376;
double r328382 = fma(r328377, r328379, r328381);
double r328383 = r328375 - r328382;
double r328384 = 1.0;
double r328385 = -r328384;
double r328386 = r328385 + r328384;
double r328387 = r328382 * r328386;
double r328388 = r328383 + r328387;
return r328388;
}




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
rmApplied fma-udef0.1
Applied associate--l+0.1
rmApplied add-cube-cbrt0.9
Applied add-sqr-sqrt32.8
Applied prod-diff32.8
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020039 +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))