e^{a \cdot x} - 1\mathsf{expm1}\left(a \cdot x\right)double code(double a, double x) {
return (exp((a * x)) - 1.0);
}
double code(double a, double x) {
return expm1((a * x));
}




Bits error versus a




Bits error versus x
Results
| Original | 29.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 29.5
rmApplied expm1-log1p-u29.5
Taylor expanded around inf 29.5
Simplified0.0
Final simplification0.0
herbie shell --seed 2020092 +o rules:numerics
(FPCore (a x)
:name "expax (section 3.5)"
:precision binary64
:herbie-expected 14
:herbie-target
(if (< (fabs (* a x)) 0.1) (* (* a x) (+ 1 (+ (/ (* a x) 2) (/ (pow (* a x) 2) 6)))) (- (exp (* a x)) 1))
(- (exp (* a x)) 1))