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 r91716 = x;
double r91717 = exp(r91716);
double r91718 = 1.0;
double r91719 = r91717 - r91718;
return r91719;
}
double f(double x) {
double r91720 = x;
double r91721 = 2.0;
double r91722 = pow(r91720, r91721);
double r91723 = 0.16666666666666666;
double r91724 = 0.5;
double r91725 = fma(r91720, r91723, r91724);
double r91726 = fma(r91722, r91725, r91720);
return r91726;
}




Bits error versus x
| Original | 58.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 58.9
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019235 +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))