e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \leq -1.1806524649417586 \cdot 10^{-05}:\\
\;\;\;\;\log \left(e^{e^{a \cdot x} - 1}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a + \log \left({\left(e^{x}\right)}^{\left(\left(a \cdot a\right) \cdot \left(0.5 + a \cdot \left(x \cdot 0.16666666666666666\right)\right)\right)}\right)\right)\\
\end{array}(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
(FPCore (a x)
:precision binary64
(if (<= (* a x) -1.1806524649417586e-05)
(log (exp (- (exp (* a x)) 1.0)))
(*
x
(+
a
(log
(pow (exp x) (* (* a a) (+ 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) <= -1.1806524649417586e-05) {
tmp = log(exp(exp(a * x) - 1.0));
} else {
tmp = x * (a + log(pow(exp(x), ((a * a) * (0.5 + (a * (x * 0.16666666666666666)))))));
}
return tmp;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.2 |
|---|---|
| Target | 0.2 |
| Herbie | 3.4 |
if (*.f64 a x) < -1.18065246494175859e-5Initial program 0.1
rmApplied add-log-exp_binary64_14610.1
Applied add-log-exp_binary64_14610.1
Applied diff-log_binary64_15140.1
Simplified0.1
if -1.18065246494175859e-5 < (*.f64 a x) Initial program 44.0
Taylor expanded around 0 14.0
Simplified7.4
rmApplied add-log-exp_binary64_14619.0
Simplified5.1
Final simplification3.4
herbie shell --seed 2020299
(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))