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 r61319 = x;
double r61320 = exp(r61319);
double r61321 = 1.0;
double r61322 = r61320 - r61321;
return r61322;
}
double f(double x) {
double r61323 = x;
double r61324 = 2.0;
double r61325 = pow(r61323, r61324);
double r61326 = 0.16666666666666666;
double r61327 = 0.5;
double r61328 = fma(r61323, r61326, r61327);
double r61329 = fma(r61325, r61328, r61323);
return r61329;
}




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