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 r93107 = x;
double r93108 = exp(r93107);
double r93109 = 1.0;
double r93110 = r93108 - r93109;
return r93110;
}
double f(double x) {
double r93111 = 0.5;
double r93112 = x;
double r93113 = 2.0;
double r93114 = pow(r93112, r93113);
double r93115 = 0.16666666666666666;
double r93116 = 3.0;
double r93117 = pow(r93112, r93116);
double r93118 = fma(r93115, r93117, r93112);
double r93119 = fma(r93111, r93114, r93118);
return r93119;
}




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