e^{x} - 1{\left(e^{x}\right)}^{\left(\mathsf{fma}\left(x, \frac{1}{24}, \frac{1}{2}\right)\right)} \cdot xdouble f(double x) {
double r108235 = x;
double r108236 = exp(r108235);
double r108237 = 1.0;
double r108238 = r108236 - r108237;
return r108238;
}
double f(double x) {
double r108239 = x;
double r108240 = exp(r108239);
double r108241 = 0.041666666666666664;
double r108242 = 0.5;
double r108243 = fma(r108239, r108241, r108242);
double r108244 = pow(r108240, r108243);
double r108245 = r108244 * r108239;
return r108245;
}




Bits error versus x
| Original | 58.7 |
|---|---|
| Target | 0.5 |
| Herbie | 0.4 |
Initial program 58.7
Taylor expanded around 0 0.5
Simplified0.5
rmApplied add-exp-log34.7
Taylor expanded around 0 34.6
Simplified34.6
Taylor expanded around inf 34.6
Simplified0.4
Final simplification0.4
herbie shell --seed 2019352 +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))