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 r154115 = x;
double r154116 = exp(r154115);
double r154117 = 1.0;
double r154118 = r154116 - r154117;
return r154118;
}
double f(double x) {
double r154119 = 0.5;
double r154120 = x;
double r154121 = 2.0;
double r154122 = pow(r154120, r154121);
double r154123 = 0.16666666666666666;
double r154124 = 3.0;
double r154125 = pow(r154120, r154124);
double r154126 = fma(r154123, r154125, r154120);
double r154127 = fma(r154119, r154122, r154126);
return r154127;
}




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