\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
x - \mathsf{fma}\left(\log y, y + 0.5, z - y\right)double f(double x, double y, double z) {
double r395139 = x;
double r395140 = y;
double r395141 = 0.5;
double r395142 = r395140 + r395141;
double r395143 = log(r395140);
double r395144 = r395142 * r395143;
double r395145 = r395139 - r395144;
double r395146 = r395145 + r395140;
double r395147 = z;
double r395148 = r395146 - r395147;
return r395148;
}
double f(double x, double y, double z) {
double r395149 = x;
double r395150 = y;
double r395151 = log(r395150);
double r395152 = 0.5;
double r395153 = r395150 + r395152;
double r395154 = z;
double r395155 = r395154 - r395150;
double r395156 = fma(r395151, r395153, r395155);
double r395157 = r395149 - r395156;
return r395157;
}




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 fma-def0.1
Final simplification0.1
herbie shell --seed 2020060 +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))