e^{x} - 1\mathsf{fma}\left(\frac{1}{2}, {x}^{2}, \mathsf{fma}\left(\frac{1}{6}, {x}^{3}, x\right)\right)double f(double x) {
double r88257 = x;
double r88258 = exp(r88257);
double r88259 = 1.0;
double r88260 = r88258 - r88259;
return r88260;
}
double f(double x) {
double r88261 = 0.5;
double r88262 = x;
double r88263 = 2.0;
double r88264 = pow(r88262, r88263);
double r88265 = 0.16666666666666666;
double r88266 = 3.0;
double r88267 = pow(r88262, r88266);
double r88268 = fma(r88265, r88267, r88262);
double r88269 = fma(r88261, r88264, r88268);
return r88269;
}




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