\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 r254136 = x;
double r254137 = y;
double r254138 = 0.5;
double r254139 = r254137 + r254138;
double r254140 = log(r254137);
double r254141 = r254139 * r254140;
double r254142 = r254136 - r254141;
double r254143 = r254142 + r254137;
double r254144 = z;
double r254145 = r254143 - r254144;
return r254145;
}
double f(double x, double y, double z) {
double r254146 = x;
double r254147 = y;
double r254148 = log(r254147);
double r254149 = 0.5;
double r254150 = r254147 + r254149;
double r254151 = z;
double r254152 = r254147 - r254151;
double r254153 = -r254152;
double r254154 = fma(r254148, r254150, r254153);
double r254155 = r254146 - r254154;
return r254155;
}




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))