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 r64391 = x;
double r64392 = exp(r64391);
double r64393 = 1.0;
double r64394 = r64392 - r64393;
return r64394;
}
double f(double x) {
double r64395 = x;
double r64396 = 2.0;
double r64397 = pow(r64395, r64396);
double r64398 = 0.16666666666666666;
double r64399 = 0.5;
double r64400 = fma(r64395, r64398, r64399);
double r64401 = fma(r64397, r64400, r64395);
return r64401;
}




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