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 r61809 = x;
double r61810 = exp(r61809);
double r61811 = 1.0;
double r61812 = r61810 - r61811;
return r61812;
}
double f(double x) {
double r61813 = x;
double r61814 = 2.0;
double r61815 = pow(r61813, r61814);
double r61816 = 0.16666666666666666;
double r61817 = 0.5;
double r61818 = fma(r61813, r61816, r61817);
double r61819 = fma(r61815, r61818, r61813);
return r61819;
}




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