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 r86364 = x;
double r86365 = exp(r86364);
double r86366 = 1.0;
double r86367 = r86365 - r86366;
return r86367;
}
double f(double x) {
double r86368 = 0.5;
double r86369 = x;
double r86370 = 2.0;
double r86371 = pow(r86369, r86370);
double r86372 = 0.16666666666666666;
double r86373 = 3.0;
double r86374 = pow(r86369, r86373);
double r86375 = fma(r86372, r86374, r86369);
double r86376 = fma(r86368, r86371, r86375);
return r86376;
}




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 2020001 +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))