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 r74979 = x;
double r74980 = exp(r74979);
double r74981 = 1.0;
double r74982 = r74980 - r74981;
return r74982;
}
double f(double x) {
double r74983 = x;
double r74984 = 2.0;
double r74985 = pow(r74983, r74984);
double r74986 = 0.16666666666666666;
double r74987 = 0.5;
double r74988 = fma(r74983, r74986, r74987);
double r74989 = fma(r74985, r74988, r74983);
return r74989;
}




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