e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -5.14256349270236967 \cdot 10^{-19}:\\
\;\;\;\;\left(\sqrt[3]{e^{a \cdot x} - 1} \cdot \sqrt[3]{e^{a \cdot x} - 1}\right) \cdot \left(\sqrt[3]{\sqrt[3]{e^{a \cdot x} - 1} \cdot \sqrt[3]{e^{a \cdot x} - 1}} \cdot \sqrt[3]{\sqrt[3]{e^{a \cdot x} - 1}}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a + \left(\frac{1}{2} \cdot {a}^{2}\right) \cdot x\right) + \frac{1}{6} \cdot \left({a}^{3} \cdot {x}^{3}\right)\\
\end{array}double code(double a, double x) {
return (exp((a * x)) - 1.0);
}
double code(double a, double x) {
double temp;
if (((a * x) <= -5.14256349270237e-19)) {
temp = ((cbrt((exp((a * x)) - 1.0)) * cbrt((exp((a * x)) - 1.0))) * (cbrt((cbrt((exp((a * x)) - 1.0)) * cbrt((exp((a * x)) - 1.0)))) * cbrt(cbrt((exp((a * x)) - 1.0)))));
} else {
temp = ((x * (a + ((0.5 * pow(a, 2.0)) * x))) + (0.16666666666666666 * (pow(a, 3.0) * pow(x, 3.0))));
}
return temp;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.6 |
|---|---|
| Target | 0.2 |
| Herbie | 9.1 |
if (* a x) < -5.14256349270237e-19Initial program 1.3
rmApplied add-cube-cbrt1.3
rmApplied add-cube-cbrt1.3
Applied cbrt-prod1.3
if -5.14256349270237e-19 < (* a x) Initial program 44.2
Taylor expanded around 0 13.1
Simplified13.1
Final simplification9.1
herbie shell --seed 2020066
(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))