e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -0.00205049475070688591:\\
\;\;\;\;\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)) <= -0.002050494750706886)) {
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 | 29.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.8 |
if (* a x) < -0.002050494750706886Initial program 0.0
rmApplied add-log-exp0.0
Applied add-log-exp0.0
Applied diff-log0.0
Simplified0.0
if -0.002050494750706886 < (* a x) Initial program 44.4
Taylor expanded around 0 14.6
Simplified14.6
Taylor expanded around 0 8.1
Simplified4.4
Taylor expanded around 0 1.2
Simplified1.2
Final simplification0.8
herbie shell --seed 2020126
(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))