e^{x} - 1\mathsf{fma}\left({x}^{2}, \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right), x\right)double f(double x) {
double r104803 = x;
double r104804 = exp(r104803);
double r104805 = 1.0;
double r104806 = r104804 - r104805;
return r104806;
}
double f(double x) {
double r104807 = x;
double r104808 = 2.0;
double r104809 = pow(r104807, r104808);
double r104810 = 0.16666666666666666;
double r104811 = 0.5;
double r104812 = fma(r104810, r104807, r104811);
double r104813 = fma(r104809, r104812, r104807);
return r104813;
}




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 2020042 +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))