e^{x} - 1\mathsf{fma}\left(\frac{1}{2}, {x}^{2}, \mathsf{fma}\left(\frac{1}{6}, {x}^{3}, x\right)\right)double f(double x) {
double r478 = x;
double r479 = exp(r478);
double r480 = 1.0;
double r481 = r479 - r480;
return r481;
}
double f(double x) {
double r482 = 0.5;
double r483 = x;
double r484 = 2.0;
double r485 = pow(r483, r484);
double r486 = 0.16666666666666666;
double r487 = 3.0;
double r488 = pow(r483, r487);
double r489 = fma(r486, r488, r483);
double r490 = fma(r482, r485, r489);
return r490;
}




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