e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -2.17561281230771736 \cdot 10^{-8}:\\
\;\;\;\;\frac{{\left(e^{a \cdot x}\right)}^{3} - {1}^{3}}{e^{a \cdot x} \cdot \left(e^{a \cdot x} + 1\right) + 1 \cdot 1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot a\\
\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)) <= -2.1756128123077174e-08)) {
VAR = ((double) (((double) (((double) pow(((double) exp(((double) (a * x)))), 3.0)) - ((double) pow(1.0, 3.0)))) / ((double) (((double) (((double) exp(((double) (a * x)))) * ((double) (((double) exp(((double) (a * x)))) + 1.0)))) + ((double) (1.0 * 1.0))))));
} else {
VAR = ((double) (x * a));
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.7 |
if (* a x) < -2.17561281230771736e-8Initial program 0.2
rmApplied flip3--0.2
Simplified0.2
if -2.17561281230771736e-8 < (* a x) Initial program 44.8
Taylor expanded around 0 14.0
Simplified14.0
Taylor expanded around 0 8.3
Simplified4.6
Taylor expanded around 0 0.9
Simplified0.9
Final simplification0.7
herbie shell --seed 2020150
(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))