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 r90504 = x;
double r90505 = exp(r90504);
double r90506 = 1.0;
double r90507 = r90505 - r90506;
return r90507;
}
double f(double x) {
double r90508 = 0.5;
double r90509 = x;
double r90510 = 2.0;
double r90511 = pow(r90509, r90510);
double r90512 = 0.16666666666666666;
double r90513 = 3.0;
double r90514 = pow(r90509, r90513);
double r90515 = fma(r90512, r90514, r90509);
double r90516 = fma(r90508, r90511, r90515);
return r90516;
}




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