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 r56737 = x;
double r56738 = exp(r56737);
double r56739 = 1.0;
double r56740 = r56738 - r56739;
return r56740;
}
double f(double x) {
double r56741 = x;
double r56742 = 2.0;
double r56743 = pow(r56741, r56742);
double r56744 = 0.16666666666666666;
double r56745 = 0.5;
double r56746 = fma(r56741, r56744, r56745);
double r56747 = fma(r56743, r56746, r56741);
return r56747;
}




Bits error versus x
| Original | 58.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 58.6
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019304 +o rules:numerics
(FPCore (x)
:name "expm1 (example 3.7)"
:precision binary64
:pre (< -1.7e-4 x)
:herbie-target
(* x (+ (+ 1 (/ x 2)) (/ (* x x) 6)))
(- (exp x) 1))