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 r64271 = x;
double r64272 = exp(r64271);
double r64273 = 1.0;
double r64274 = r64272 - r64273;
return r64274;
}
double f(double x) {
double r64275 = x;
double r64276 = 2.0;
double r64277 = pow(r64275, r64276);
double r64278 = 0.16666666666666666;
double r64279 = 0.5;
double r64280 = fma(r64275, r64278, r64279);
double r64281 = fma(r64277, r64280, r64275);
return r64281;
}




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