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 r69161 = x;
double r69162 = exp(r69161);
double r69163 = 1.0;
double r69164 = r69162 - r69163;
return r69164;
}
double f(double x) {
double r69165 = 0.5;
double r69166 = x;
double r69167 = 2.0;
double r69168 = pow(r69166, r69167);
double r69169 = 0.16666666666666666;
double r69170 = 3.0;
double r69171 = pow(r69166, r69170);
double r69172 = fma(r69169, r69171, r69166);
double r69173 = fma(r69165, r69168, r69172);
return r69173;
}




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