e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -115.9376399895593:\\
\;\;\;\;\sqrt[3]{{\left(e^{a \cdot x} - 1\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{2}, {\left(x \cdot a\right)}^{2}, a \cdot x\right)\\
\end{array}double code(double a, double x) {
return (exp((a * x)) - 1.0);
}
double code(double a, double x) {
double VAR;
if (((a * x) <= -115.9376399895593)) {
VAR = cbrt(pow((exp((a * x)) - 1.0), 3.0));
} else {
VAR = fma(0.5, pow((x * a), 2.0), (a * x));
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.6 |
if (* a x) < -115.9376399895593Initial program 0
rmApplied add-cbrt-cube0
Simplified0
if -115.9376399895593 < (* a x) Initial program 43.9
Taylor expanded around 0 14.7
Simplified14.7
Taylor expanded around 0 8.7
Simplified8.7
rmApplied pow-prod-down1.0
Simplified1.0
Final simplification0.6
herbie shell --seed 2020102 +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))