e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \leq -6083.193742126296:\\
\;\;\;\;\frac{{\left(e^{\left(a \cdot x\right) \cdot 2}\right)}^{3} + -1}{\left({\left(e^{a \cdot x}\right)}^{4} + \left(e^{\left(a \cdot x\right) \cdot 2} + 1\right)\right) \cdot \left(e^{a \cdot x} + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(a \cdot x\right)}^{3} \cdot 1.3333333333333333 + 2 \cdot \left(a \cdot x + {\left(a \cdot x\right)}^{2}\right)}{e^{a \cdot x} + 1}\\
\end{array}(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
(FPCore (a x)
:precision binary64
(if (<= (* a x) -6083.193742126296)
(/
(+ (pow (exp (* (* a x) 2.0)) 3.0) -1.0)
(*
(+ (pow (exp (* a x)) 4.0) (+ (exp (* (* a x) 2.0)) 1.0))
(+ (exp (* a x)) 1.0)))
(/
(+
(* (pow (* a x) 3.0) 1.3333333333333333)
(* 2.0 (+ (* a x) (pow (* a x) 2.0))))
(+ (exp (* a x)) 1.0))))double code(double a, double x) {
return exp(a * x) - 1.0;
}
double code(double a, double x) {
double tmp;
if ((a * x) <= -6083.193742126296) {
tmp = (pow(exp((a * x) * 2.0), 3.0) + -1.0) / ((pow(exp(a * x), 4.0) + (exp((a * x) * 2.0) + 1.0)) * (exp(a * x) + 1.0));
} else {
tmp = ((pow((a * x), 3.0) * 1.3333333333333333) + (2.0 * ((a * x) + pow((a * x), 2.0)))) / (exp(a * x) + 1.0);
}
return tmp;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.7 |
if (*.f64 a x) < -6083.1937421262955Initial program 0
rmApplied flip--_binary640
Simplified0
rmApplied pow-exp_binary640
rmApplied flip3-+_binary640
Applied associate-/l/_binary640
Simplified0
if -6083.1937421262955 < (*.f64 a x) Initial program 43.8
rmApplied flip--_binary6443.9
Simplified43.9
rmApplied pow-exp_binary6443.8
Taylor expanded around 0 15.0
Simplified1.1
rmApplied distribute-lft1-in_binary641.1
Applied associate-*r*_binary641.1
Simplified1.1
Final simplification0.7
herbie shell --seed 2020231
(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))