e^{x} - 1\mathsf{fma}\left({x}^{2}, \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right), x\right)double f(double x) {
double r91767 = x;
double r91768 = exp(r91767);
double r91769 = 1.0;
double r91770 = r91768 - r91769;
return r91770;
}
double f(double x) {
double r91771 = x;
double r91772 = 2.0;
double r91773 = pow(r91771, r91772);
double r91774 = 0.16666666666666666;
double r91775 = 0.5;
double r91776 = fma(r91774, r91771, r91775);
double r91777 = fma(r91773, r91776, r91771);
return r91777;
}




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