\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\left(\mathsf{fma}\left(-\log y, 0.5 + y, \mathsf{fma}\left(-\left(y + 0.5\right), \log y, \mathsf{fma}\left(\log y, y + 0.5, y\right)\right)\right) + x\right) - zdouble f(double x, double y, double z) {
double r207432 = x;
double r207433 = y;
double r207434 = 0.5;
double r207435 = r207433 + r207434;
double r207436 = log(r207433);
double r207437 = r207435 * r207436;
double r207438 = r207432 - r207437;
double r207439 = r207438 + r207433;
double r207440 = z;
double r207441 = r207439 - r207440;
return r207441;
}
double f(double x, double y, double z) {
double r207442 = y;
double r207443 = log(r207442);
double r207444 = -r207443;
double r207445 = 0.5;
double r207446 = r207445 + r207442;
double r207447 = r207442 + r207445;
double r207448 = -r207447;
double r207449 = fma(r207443, r207447, r207442);
double r207450 = fma(r207448, r207443, r207449);
double r207451 = fma(r207444, r207446, r207450);
double r207452 = x;
double r207453 = r207451 + r207452;
double r207454 = z;
double r207455 = r207453 - r207454;
return r207455;
}




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 *-un-lft-identity0.1
Applied prod-diff0.1
Applied associate-+l+0.1
Simplified0.2
rmApplied fma-udef0.2
Applied associate-+l+0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2019305 +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))