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 r83294 = x;
double r83295 = exp(r83294);
double r83296 = 1.0;
double r83297 = r83295 - r83296;
return r83297;
}
double f(double x) {
double r83298 = 0.5;
double r83299 = x;
double r83300 = 2.0;
double r83301 = pow(r83299, r83300);
double r83302 = 0.16666666666666666;
double r83303 = 3.0;
double r83304 = pow(r83299, r83303);
double r83305 = fma(r83302, r83304, r83299);
double r83306 = fma(r83298, r83301, r83305);
return r83306;
}




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