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 r73612 = x;
double r73613 = exp(r73612);
double r73614 = 1.0;
double r73615 = r73613 - r73614;
return r73615;
}
double f(double x) {
double r73616 = x;
double r73617 = 2.0;
double r73618 = pow(r73616, r73617);
double r73619 = 0.16666666666666666;
double r73620 = 0.5;
double r73621 = fma(r73616, r73619, r73620);
double r73622 = fma(r73618, r73621, r73616);
return r73622;
}




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