e^{x} - 1\mathsf{fma}\left({x}^{2}, \mathsf{fma}\left(x, \frac{1}{6}, \frac{1}{2}\right), x\right)double f(double x) {
double r128588 = x;
double r128589 = exp(r128588);
double r128590 = 1.0;
double r128591 = r128589 - r128590;
return r128591;
}
double f(double x) {
double r128592 = x;
double r128593 = 2.0;
double r128594 = pow(r128592, r128593);
double r128595 = 0.16666666666666666;
double r128596 = 0.5;
double r128597 = fma(r128592, r128595, r128596);
double r128598 = fma(r128594, r128597, r128592);
return r128598;
}




Bits error versus x
| Original | 58.6 |
|---|---|
| Target | 0.5 |
| Herbie | 0.4 |
Initial program 58.6
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019303 +o rules:numerics
(FPCore (x)
:name "expm1 (example 3.7)"
:precision binary64
:pre (< -1.7e-4 x)
:herbie-target
(* x (+ (+ 1 (/ x 2)) (/ (* x x) 6)))
(- (exp x) 1))