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 r90900 = x;
double r90901 = exp(r90900);
double r90902 = 1.0;
double r90903 = r90901 - r90902;
return r90903;
}
double f(double x) {
double r90904 = x;
double r90905 = 2.0;
double r90906 = pow(r90904, r90905);
double r90907 = 0.16666666666666666;
double r90908 = 0.5;
double r90909 = fma(r90904, r90907, r90908);
double r90910 = fma(r90906, r90909, r90904);
return r90910;
}




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