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 r40890 = x;
double r40891 = exp(r40890);
double r40892 = 1.0;
double r40893 = r40891 - r40892;
return r40893;
}
double f(double x) {
double r40894 = x;
double r40895 = 2.0;
double r40896 = pow(r40894, r40895);
double r40897 = 0.16666666666666666;
double r40898 = 0.5;
double r40899 = fma(r40894, r40897, r40898);
double r40900 = fma(r40896, r40899, r40894);
return r40900;
}




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