e^{x} - 1\mathsf{fma}\left(\frac{1}{2}, {x}^{2}, \mathsf{fma}\left(\frac{1}{6}, {x}^{3}, x\right)\right)double f(double x) {
double r85986 = x;
double r85987 = exp(r85986);
double r85988 = 1.0;
double r85989 = r85987 - r85988;
return r85989;
}
double f(double x) {
double r85990 = 0.5;
double r85991 = x;
double r85992 = 2.0;
double r85993 = pow(r85991, r85992);
double r85994 = 0.16666666666666666;
double r85995 = 3.0;
double r85996 = pow(r85991, r85995);
double r85997 = fma(r85994, r85996, r85991);
double r85998 = fma(r85990, r85993, r85997);
return r85998;
}




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