e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -3.56979547989466417 \cdot 10^{-7}:\\
\;\;\;\;\frac{\sqrt[3]{\frac{{\left(e^{\left(a \cdot x\right) \cdot 3 + \left(a \cdot x\right) \cdot 3} + \left(-{1}^{6}\right)\right)}^{3}}{{\left(e^{\left(a \cdot x\right) \cdot 3} + {1}^{3}\right)}^{3}}}}{e^{a \cdot x} \cdot \left(e^{a \cdot x} + 1\right) + 1 \cdot 1}\\
\mathbf{elif}\;a \cdot x \le 2.97473326445349939 \cdot 10^{-19}:\\
\;\;\;\;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]{{\left(e^{\left(a \cdot x\right) \cdot 3} - {1}^{3}\right)}^{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) <= -3.569795479894664e-07)) {
temp = (cbrt((pow((exp((((a * x) * 3.0) + ((a * x) * 3.0))) + -pow(1.0, 6.0)), 3.0) / pow((exp(((a * x) * 3.0)) + pow(1.0, 3.0)), 3.0))) / ((exp((a * x)) * (exp((a * x)) + 1.0)) + (1.0 * 1.0)));
} else {
double temp_1;
if (((a * x) <= 2.9747332644534994e-19)) {
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(pow((exp(((a * x) * 3.0)) - pow(1.0, 3.0)), 3.0)) / ((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.2 |
|---|---|
| Target | 0.2 |
| Herbie | 9.2 |
if (* a x) < -3.569795479894664e-07Initial program 0.2
rmApplied flip3--0.2
Simplified0.2
rmApplied pow-exp0.2
rmApplied add-cbrt-cube0.2
Simplified0.2
rmApplied flip--0.2
Applied cube-div0.2
Simplified0.2
if -3.569795479894664e-07 < (* a x) < 2.9747332644534994e-19Initial program 45.1
Taylor expanded around 0 13.5
Simplified13.5
if 2.9747332644534994e-19 < (* a x) Initial program 25.4
rmApplied flip3--26.4
Simplified26.4
rmApplied pow-exp25.0
rmApplied add-cbrt-cube26.9
Simplified26.9
Final simplification9.2
herbie shell --seed 2020060
(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))