\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
x - \mathsf{fma}\left(\log y, y + 0.5, -\left(y - z\right)\right)double f(double x, double y, double z) {
double r272430 = x;
double r272431 = y;
double r272432 = 0.5;
double r272433 = r272431 + r272432;
double r272434 = log(r272431);
double r272435 = r272433 * r272434;
double r272436 = r272430 - r272435;
double r272437 = r272436 + r272431;
double r272438 = z;
double r272439 = r272437 - r272438;
return r272439;
}
double f(double x, double y, double z) {
double r272440 = x;
double r272441 = y;
double r272442 = log(r272441);
double r272443 = 0.5;
double r272444 = r272441 + r272443;
double r272445 = z;
double r272446 = r272441 - r272445;
double r272447 = -r272446;
double r272448 = fma(r272442, r272444, r272447);
double r272449 = r272440 - r272448;
return r272449;
}




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 associate--l+0.1
rmApplied add-sqr-sqrt0.3
Applied associate-*l*0.3
rmApplied associate-+l-0.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2019323 +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))