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 r68329 = x;
double r68330 = exp(r68329);
double r68331 = 1.0;
double r68332 = r68330 - r68331;
return r68332;
}
double f(double x) {
double r68333 = 0.5;
double r68334 = x;
double r68335 = 2.0;
double r68336 = pow(r68334, r68335);
double r68337 = 0.16666666666666666;
double r68338 = 3.0;
double r68339 = pow(r68334, r68338);
double r68340 = fma(r68337, r68339, r68334);
double r68341 = fma(r68333, r68336, r68340);
return r68341;
}




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