e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \leq -4499064321.424441:\\
\;\;\;\;\log \left(e^{e^{a \cdot x} - 1}\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x + a \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + \left(a \cdot x\right) \cdot 0.16666666666666666\right)\right)\right)\\
\end{array}(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
(FPCore (a x) :precision binary64 (if (<= (* a x) -4499064321.424441) (log (exp (- (exp (* a x)) 1.0))) (* a (+ x (* a (* (* x x) (+ 0.5 (* (* a x) 0.16666666666666666))))))))
double code(double a, double x) {
return exp(a * x) - 1.0;
}
double code(double a, double x) {
double tmp;
if ((a * x) <= -4499064321.424441) {
tmp = log(exp(exp(a * x) - 1.0));
} else {
tmp = a * (x + (a * ((x * x) * (0.5 + ((a * x) * 0.16666666666666666)))));
}
return tmp;
}




Bits error versus a




Bits error versus x
Results
| Original | 30.0 |
|---|---|
| Target | 0.2 |
| Herbie | 3.7 |
if (*.f64 a x) < -4499064321.42444134Initial program 0
rmApplied add-log-exp_binary64_14610
Applied add-log-exp_binary64_14610
Applied diff-log_binary64_15140
Simplified0
if -4499064321.42444134 < (*.f64 a x) Initial program 44.0
Taylor expanded around 0 15.1
Simplified5.5
Final simplification3.7
herbie shell --seed 2020280
(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))