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 r71696 = x;
double r71697 = exp(r71696);
double r71698 = 1.0;
double r71699 = r71697 - r71698;
return r71699;
}
double f(double x) {
double r71700 = x;
double r71701 = 2.0;
double r71702 = pow(r71700, r71701);
double r71703 = 0.16666666666666666;
double r71704 = 0.5;
double r71705 = fma(r71700, r71703, r71704);
double r71706 = fma(r71702, r71705, r71700);
return r71706;
}




Bits error versus x
| Original | 58.6 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
Initial program 58.6
Taylor expanded around 0 0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2019326 +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))