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 r102370 = x;
double r102371 = exp(r102370);
double r102372 = 1.0;
double r102373 = r102371 - r102372;
return r102373;
}
double f(double x) {
double r102374 = 0.5;
double r102375 = x;
double r102376 = 2.0;
double r102377 = pow(r102375, r102376);
double r102378 = 0.16666666666666666;
double r102379 = 3.0;
double r102380 = pow(r102375, r102379);
double r102381 = fma(r102378, r102380, r102375);
double r102382 = fma(r102374, r102377, r102381);
return r102382;
}




Bits error versus x
| Original | 58.5 |
|---|---|
| Target | 0.6 |
| Herbie | 0.6 |
Initial program 58.5
Taylor expanded around 0 0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2019353 +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))