e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -2.71953442407974509 \cdot 10^{-5}:\\
\;\;\;\;\log \left(e^{e^{a \cdot x} - 1}\right)\\
\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.719534424079745e-05)) {
VAR = ((double) log(((double) exp(((double) (((double) exp(((double) (a * x)))) - 1.0))))));
} else {
VAR = ((double) (x * a));
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 28.9 |
|---|---|
| Target | 0.2 |
| Herbie | 0.8 |
if (* a x) < -2.71953442407974509e-5Initial program 0.1
rmApplied add-log-exp0.1
Applied add-log-exp0.1
Applied diff-log0.1
Simplified0.1
if -2.71953442407974509e-5 < (* a x) Initial program 44.6
Taylor expanded around 0 13.9
Simplified13.9
Taylor expanded around 0 7.9
Simplified4.4
Taylor expanded around 0 1.3
Simplified1.3
Final simplification0.8
herbie shell --seed 2020169
(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))