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 r77502 = x;
double r77503 = exp(r77502);
double r77504 = 1.0;
double r77505 = r77503 - r77504;
return r77505;
}
double f(double x) {
double r77506 = 0.5;
double r77507 = x;
double r77508 = 2.0;
double r77509 = pow(r77507, r77508);
double r77510 = 0.16666666666666666;
double r77511 = 3.0;
double r77512 = pow(r77507, r77511);
double r77513 = fma(r77510, r77512, r77507);
double r77514 = fma(r77506, r77509, r77513);
return r77514;
}




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