e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -3.5622427154634171 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{{\left({\left(e^{3}\right)}^{\left(a \cdot x\right)}\right)}^{3} - {\left({1}^{3}\right)}^{3}}{\left({\left(e^{a \cdot x}\right)}^{6} + {1}^{6}\right) + {\left(e^{3}\right)}^{\left(a \cdot x\right)} \cdot {1}^{3}}}{e^{a \cdot x} \cdot \left(e^{a \cdot x} + 1\right) + 1 \cdot 1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 \cdot a + \left(0.5 \cdot {a}^{2}\right) \cdot x\right) + 0.16666666666666652 \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 VAR;
if (((a * x) <= -3.562242715463417e-10)) {
VAR = (((pow(pow(exp(3.0), (a * x)), 3.0) - pow(pow(1.0, 3.0), 3.0)) / ((pow(exp((a * x)), 6.0) + pow(1.0, 6.0)) + (pow(exp(3.0), (a * x)) * pow(1.0, 3.0)))) / ((exp((a * x)) * (exp((a * x)) + 1.0)) + (1.0 * 1.0)));
} else {
VAR = ((x * ((1.0 * a) + ((0.5 * pow(a, 2.0)) * x))) + (0.16666666666666652 * (pow(a, 3.0) * pow(x, 3.0))));
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 28.9 |
|---|---|
| Target | 0.2 |
| Herbie | 9.3 |
if (* a x) < -3.562242715463417e-10Initial program 0.4
rmApplied flip3--0.4
Simplified0.4
rmApplied pow-exp0.3
rmApplied *-commutative0.3
Applied exp-prod0.3
rmApplied flip3--0.3
Simplified0.3
if -3.562242715463417e-10 < (* a x) Initial program 44.2
rmApplied flip3--44.2
Simplified44.2
Taylor expanded around 0 14.2
Simplified14.2
Final simplification9.3
herbie shell --seed 2020078
(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))