e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -1.97221861134718174 \cdot 10^{-5}:\\
\;\;\;\;\frac{\sqrt[3]{e^{\left(a \cdot x\right) \cdot 3} - {1}^{3}} \cdot \sqrt[3]{\sqrt[3]{{\left(e^{\left(a \cdot x\right) \cdot 3} - {1}^{3}\right)}^{3}}}}{\sqrt[3]{e^{a \cdot x} \cdot \left(e^{a \cdot x} + 1\right) + 1 \cdot 1} \cdot \sqrt[3]{e^{a \cdot x} \cdot \left(e^{a \cdot x} + 1\right) + 1 \cdot 1}} \cdot \frac{\sqrt[3]{e^{\left(a \cdot x\right) \cdot 3} - {1}^{3}}}{\sqrt[3]{e^{a \cdot x} \cdot \left(e^{a \cdot x} + 1\right) + 1 \cdot 1}}\\
\mathbf{elif}\;a \cdot x \le 6.8409562196091337 \cdot 10^{-13}:\\
\;\;\;\;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)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{e^{\left(a \cdot x\right) \cdot 3} - {1}^{3}} \cdot \sqrt[3]{e^{\left(a \cdot x\right) \cdot 3} - {1}^{3}}}{\sqrt[3]{e^{a \cdot x} \cdot \left(e^{a \cdot x} + 1\right) + 1 \cdot 1} \cdot \sqrt[3]{e^{a \cdot x} \cdot \left(e^{a \cdot x} + 1\right) + 1 \cdot 1}} \cdot \frac{\sqrt[3]{\left(\sqrt{e^{\left(a \cdot x\right) \cdot 3}} + {\left(\sqrt{1}\right)}^{3}\right) \cdot \left(\sqrt{e^{\left(a \cdot x\right) \cdot 3}} - {\left(\sqrt{1}\right)}^{3}\right)}}{\sqrt[3]{e^{a \cdot x} \cdot \left(e^{a \cdot x} + 1\right) + 1 \cdot 1}}\\
\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) <= -1.9722186113471817e-05)) {
temp = (((cbrt((exp(((a * x) * 3.0)) - pow(1.0, 3.0))) * cbrt(cbrt(pow((exp(((a * x) * 3.0)) - pow(1.0, 3.0)), 3.0)))) / (cbrt(((exp((a * x)) * (exp((a * x)) + 1.0)) + (1.0 * 1.0))) * cbrt(((exp((a * x)) * (exp((a * x)) + 1.0)) + (1.0 * 1.0))))) * (cbrt((exp(((a * x) * 3.0)) - pow(1.0, 3.0))) / cbrt(((exp((a * x)) * (exp((a * x)) + 1.0)) + (1.0 * 1.0)))));
} else {
double temp_1;
if (((a * x) <= 6.840956219609134e-13)) {
temp_1 = ((x * (a + ((0.5 * pow(a, 2.0)) * x))) + (0.16666666666666666 * (pow(a, 3.0) * pow(x, 3.0))));
} else {
temp_1 = (((cbrt((exp(((a * x) * 3.0)) - pow(1.0, 3.0))) * cbrt((exp(((a * x) * 3.0)) - pow(1.0, 3.0)))) / (cbrt(((exp((a * x)) * (exp((a * x)) + 1.0)) + (1.0 * 1.0))) * cbrt(((exp((a * x)) * (exp((a * x)) + 1.0)) + (1.0 * 1.0))))) * (cbrt(((sqrt(exp(((a * x) * 3.0))) + pow(sqrt(1.0), 3.0)) * (sqrt(exp(((a * x) * 3.0))) - pow(sqrt(1.0), 3.0)))) / cbrt(((exp((a * x)) * (exp((a * x)) + 1.0)) + (1.0 * 1.0)))));
}
temp = temp_1;
}
return temp;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.0 |
|---|---|
| Target | 0.2 |
| Herbie | 8.7 |
if (* a x) < -1.9722186113471817e-05Initial program 0.1
rmApplied flip3--0.1
Simplified0.1
rmApplied pow-exp0.1
rmApplied add-cube-cbrt0.1
Applied add-cube-cbrt0.1
Applied times-frac0.1
rmApplied add-cbrt-cube0.1
Simplified0.1
if -1.9722186113471817e-05 < (* a x) < 6.840956219609134e-13Initial program 44.8
Taylor expanded around 0 13.1
Simplified13.1
if 6.840956219609134e-13 < (* a x) Initial program 14.9
rmApplied flip3--15.8
Simplified15.8
rmApplied pow-exp14.9
rmApplied add-cube-cbrt15.0
Applied add-cube-cbrt15.0
Applied times-frac15.0
rmApplied add-sqr-sqrt15.0
Applied unpow-prod-down15.0
Applied add-sqr-sqrt15.1
Applied difference-of-squares15.2
Final simplification8.7
herbie shell --seed 2020056
(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))