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}:\\
\;\;\;\;x \cdot a\\
\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 = (x * a);
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.2 |
|---|---|
| Target | 0.2 |
| Herbie | 1.1 |
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
Simplified5.0
Taylor expanded around 0 1.7
Simplified1.7
Final simplification1.1
herbie shell --seed 2020102
(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))