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 r94562 = x;
double r94563 = exp(r94562);
double r94564 = 1.0;
double r94565 = r94563 - r94564;
return r94565;
}
double f(double x) {
double r94566 = 0.5;
double r94567 = x;
double r94568 = 2.0;
double r94569 = pow(r94567, r94568);
double r94570 = 0.16666666666666666;
double r94571 = 3.0;
double r94572 = pow(r94567, r94571);
double r94573 = fma(r94570, r94572, r94567);
double r94574 = fma(r94566, r94569, r94573);
return r94574;
}




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