e^{x} - 1\mathsf{fma}\left({x}^{2}, \mathsf{fma}\left(\frac{1}{6}, x, \frac{1}{2}\right), x\right)double f(double x) {
double r107533 = x;
double r107534 = exp(r107533);
double r107535 = 1.0;
double r107536 = r107534 - r107535;
return r107536;
}
double f(double x) {
double r107537 = x;
double r107538 = 2.0;
double r107539 = pow(r107537, r107538);
double r107540 = 0.16666666666666666;
double r107541 = 0.5;
double r107542 = fma(r107540, r107537, r107541);
double r107543 = fma(r107539, r107542, r107537);
return r107543;
}




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