e^{x} - 1e^{\mathsf{fma}\left(\frac{1}{24}, x, \frac{1}{2}\right) \cdot x} \cdot xdouble f(double x) {
double r3711227 = x;
double r3711228 = exp(r3711227);
double r3711229 = 1.0;
double r3711230 = r3711228 - r3711229;
return r3711230;
}
double f(double x) {
double r3711231 = 0.041666666666666664;
double r3711232 = x;
double r3711233 = 0.5;
double r3711234 = fma(r3711231, r3711232, r3711233);
double r3711235 = r3711234 * r3711232;
double r3711236 = exp(r3711235);
double r3711237 = r3711236 * r3711232;
return r3711237;
}




Bits error versus x
| Original | 58.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
Initial program 58.9
Taylor expanded around 0 0.4
Simplified0.4
rmApplied add-exp-log34.5
Taylor expanded around 0 34.5
Simplified34.5
Taylor expanded around inf 34.5
Simplified0.3
Final simplification0.3
herbie shell --seed 2019192 +o rules:numerics
(FPCore (x)
:name "expm1 (example 3.7)"
:pre (< -0.00017 x)
:herbie-target
(* x (+ (+ 1.0 (/ x 2.0)) (/ (* x x) 6.0)))
(- (exp x) 1.0))