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 r77258 = x;
double r77259 = exp(r77258);
double r77260 = 1.0;
double r77261 = r77259 - r77260;
return r77261;
}
double f(double x) {
double r77262 = x;
double r77263 = 2.0;
double r77264 = pow(r77262, r77263);
double r77265 = 0.16666666666666666;
double r77266 = 0.5;
double r77267 = fma(r77265, r77262, r77266);
double r77268 = fma(r77264, r77267, r77262);
return r77268;
}




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