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 r71108 = x;
double r71109 = exp(r71108);
double r71110 = 1.0;
double r71111 = r71109 - r71110;
return r71111;
}
double f(double x) {
double r71112 = x;
double r71113 = 2.0;
double r71114 = pow(r71112, r71113);
double r71115 = 0.16666666666666666;
double r71116 = 0.5;
double r71117 = fma(r71112, r71115, r71116);
double r71118 = fma(r71114, r71117, r71112);
return r71118;
}




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