e^{x} - 1\mathsf{fma}\left({x}^{2}, \mathsf{fma}\left(x, \frac{1}{6}, \frac{1}{2}\right), x\right)double f(double x) {
double r64759 = x;
double r64760 = exp(r64759);
double r64761 = 1.0;
double r64762 = r64760 - r64761;
return r64762;
}
double f(double x) {
double r64763 = x;
double r64764 = 2.0;
double r64765 = pow(r64763, r64764);
double r64766 = 0.16666666666666666;
double r64767 = 0.5;
double r64768 = fma(r64763, r64766, r64767);
double r64769 = fma(r64765, r64768, r64763);
return r64769;
}




Bits error versus x
| Original | 58.8 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
Initial program 58.8
Taylor expanded around 0 0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2019212 +o rules:numerics
(FPCore (x)
:name "expm1 (example 3.7)"
:precision binary64
:pre (< -1.7e-4 x)
:herbie-target
(* x (+ (+ 1 (/ x 2)) (/ (* x x) 6)))
(- (exp x) 1))