e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \leq -8.209112939621517 \cdot 10^{+154}:\\
\;\;\;\;-1 + \log \left(\sqrt[3]{e^{e^{a \cdot x}}} \cdot {\left(\sqrt[3]{e^{e^{a \cdot x}}}\right)}^{2}\right)\\
\mathbf{elif}\;a \leq 8.001029692762442 \cdot 10^{+30}:\\
\;\;\;\;\left(1 + \sqrt{e^{a \cdot x}}\right) \cdot \left(\left(a \cdot x\right) \cdot 0.5\right)\\
\mathbf{elif}\;a \leq 1.7983423256931096 \cdot 10^{+63} \lor \neg \left(a \leq 2.8512023937374467 \cdot 10^{+91}\right):\\
\;\;\;\;-1 + \log \left(\sqrt[3]{e^{e^{a \cdot x}}} \cdot {\left(\sqrt[3]{e^{e^{a \cdot x}}}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot x\\
\end{array}(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
(FPCore (a x)
:precision binary64
(if (<= a -8.209112939621517e+154)
(+
-1.0
(log (* (cbrt (exp (exp (* a x)))) (pow (cbrt (exp (exp (* a x)))) 2.0))))
(if (<= a 8.001029692762442e+30)
(* (+ 1.0 (sqrt (exp (* a x)))) (* (* a x) 0.5))
(if (or (<= a 1.7983423256931096e+63) (not (<= a 2.8512023937374467e+91)))
(+
-1.0
(log
(* (cbrt (exp (exp (* a x)))) (pow (cbrt (exp (exp (* a x)))) 2.0))))
(* a x)))))double code(double a, double x) {
return exp(a * x) - 1.0;
}
double code(double a, double x) {
double tmp;
if (a <= -8.209112939621517e+154) {
tmp = -1.0 + log(cbrt(exp(exp(a * x))) * pow(cbrt(exp(exp(a * x))), 2.0));
} else if (a <= 8.001029692762442e+30) {
tmp = (1.0 + sqrt(exp(a * x))) * ((a * x) * 0.5);
} else if ((a <= 1.7983423256931096e+63) || !(a <= 2.8512023937374467e+91)) {
tmp = -1.0 + log(cbrt(exp(exp(a * x))) * pow(cbrt(exp(exp(a * x))), 2.0));
} else {
tmp = a * x;
}
return tmp;
}












Bits error versus a












Bits error versus x
Results
| Original | 29.3 |
|---|---|
| Target | 0.2 |
| Herbie | 14.1 |
| Alternative 1 | |
|---|---|
| Error | 14.0 |
| Cost | 20289 |
| Alternative 2 | |
|---|---|
| Error | 14.0 |
| Cost | 19905 |
| Alternative 3 | |
|---|---|
| Error | 14.0 |
| Cost | 14146 |
| Alternative 4 | |
|---|---|
| Error | 14.0 |
| Cost | 7874 |
| Alternative 5 | |
|---|---|
| Error | 14.1 |
| Cost | 7313 |
| Alternative 6 | |
|---|---|
| Error | 14.6 |
| Cost | 973 |
| Alternative 7 | |
|---|---|
| Error | 34.1 |
| Cost | 706 |
| Alternative 8 | |
|---|---|
| Error | 51.7 |
| Cost | 64 |


if a < -8.2091129396215167e154 or 8.0010296927624417e30 < a < 1.79834232569310959e63 or 2.8512023937374467e91 < a Initial program 15.6
rmApplied add-log-exp_binary64_182215.9
rmApplied add-log-exp_binary64_182215.9
rmApplied add-cube-cbrt_binary64_181815.9
Applied log-prod_binary64_186915.9
Applied exp-sum_binary64_182915.9
Simplified15.9
Simplified15.9
Simplified15.9
if -8.2091129396215167e154 < a < 8.0010296927624417e30Initial program 34.1
rmApplied add-sqr-sqrt_binary64_180534.2
Applied difference-of-sqr-1_binary64_175334.2
Simplified34.2
Simplified34.2
Taylor expanded around 0 13.0
Simplified13.0
rmApplied pow1_binary64_184413.0
Simplified13.0
if 1.79834232569310959e63 < a < 2.8512023937374467e91Initial program 28.3
Taylor expanded around 0 59.6
rmApplied associate--l+_binary64_172032.2
Simplified32.2
Simplified32.2
Final simplification14.1
herbie shell --seed 2021065
(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))