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 r63769 = x;
double r63770 = exp(r63769);
double r63771 = 1.0;
double r63772 = r63770 - r63771;
return r63772;
}
double f(double x) {
double r63773 = x;
double r63774 = 2.0;
double r63775 = pow(r63773, r63774);
double r63776 = 0.16666666666666666;
double r63777 = 0.5;
double r63778 = fma(r63773, r63776, r63777);
double r63779 = fma(r63775, r63778, r63773);
return r63779;
}




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