e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -156801732931887584:\\
\;\;\;\;\sqrt[3]{{\left(e^{a \cdot x} - 1\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot a\\
\end{array}double code(double a, double x) {
return ((double) (((double) exp(((double) (a * x)))) - 1.0));
}
double code(double a, double x) {
double VAR;
if ((((double) (a * x)) <= -1.5680173293188758e+17)) {
VAR = ((double) cbrt(((double) pow(((double) (((double) exp(((double) (a * x)))) - 1.0)), 3.0))));
} else {
VAR = ((double) (x * a));
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.1 |
|---|---|
| Target | 0.1 |
| Herbie | 2.1 |
if (* a x) < -156801732931887584Initial program 0
rmApplied add-cbrt-cube0
Simplified0
if -156801732931887584 < (* a x) Initial program 42.5
Taylor expanded around 0 15.7
Simplified15.7
Taylor expanded around 0 10.1
Simplified6.4
Taylor expanded around 0 3.0
Simplified3.0
Final simplification2.1
herbie shell --seed 2020161
(FPCore (a x)
:name "expax (section 3.5)"
:precision binary64
:herbie-expected 14
:herbie-target
(if (< (fabs (* a x)) 0.1) (* (* a x) (+ 1.0 (+ (/ (* a x) 2.0) (/ (pow (* a x) 2.0) 6.0)))) (- (exp (* a x)) 1.0))
(- (exp (* a x)) 1.0))