e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -2.6776443470702676 \cdot 10^{-4}:\\
\;\;\;\;\sqrt[3]{\sqrt[3]{{\left({\left(e^{a \cdot x} - 1\right)}^{3}\right)}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2} \cdot \left({a}^{2} \cdot {x}^{2}\right) + \left(\frac{1}{6} \cdot \left({a}^{3} \cdot {x}^{3}\right) + a \cdot x\right)\\
\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)) <= -0.00026776443470702676)) {
VAR = ((double) cbrt(((double) cbrt(((double) pow(((double) pow(((double) (((double) exp(((double) (a * x)))) - 1.0)), 3.0)), 3.0))))));
} else {
VAR = ((double) (((double) (0.5 * ((double) (((double) pow(a, 2.0)) * ((double) pow(x, 2.0)))))) + ((double) (((double) (0.16666666666666666 * ((double) (((double) pow(a, 3.0)) * ((double) pow(x, 3.0)))))) + ((double) (a * x))))));
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 28.8 |
|---|---|
| Target | 0.2 |
| Herbie | 9.7 |
if (* a x) < -0.00026776443470702676Initial program 0.0
rmApplied add-cbrt-cube0.0
Simplified0.0
rmApplied add-cbrt-cube0.0
Simplified0.0
if -0.00026776443470702676 < (* a x) Initial program 43.5
rmApplied add-cbrt-cube43.6
Simplified43.6
rmApplied add-cbrt-cube43.6
Simplified43.6
Taylor expanded around 0 14.6
Final simplification9.7
herbie shell --seed 2020130
(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))