e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -3.98282351915828164 \cdot 10^{-7}:\\
\;\;\;\;\frac{\sqrt[3]{\left(e^{a \cdot x} \cdot e^{a \cdot x} - 1 \cdot 1\right) \cdot \left(e^{a \cdot x} - 1\right)}}{\sqrt[3]{e^{a \cdot x} + 1}} \cdot \sqrt[3]{e^{a \cdot x} - 1}\\
\mathbf{elif}\;a \cdot x \le 2.1553377009136073 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \left(a + \left(\frac{1}{2} \cdot {a}^{2}\right) \cdot x\right) + \frac{1}{6} \cdot \left({a}^{3} \cdot {x}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{e^{a \cdot x} - 1}\right)\\
\end{array}double f(double a, double x) {
double r121461 = a;
double r121462 = x;
double r121463 = r121461 * r121462;
double r121464 = exp(r121463);
double r121465 = 1.0;
double r121466 = r121464 - r121465;
return r121466;
}
double f(double a, double x) {
double r121467 = a;
double r121468 = x;
double r121469 = r121467 * r121468;
double r121470 = -3.9828235191582816e-07;
bool r121471 = r121469 <= r121470;
double r121472 = exp(r121469);
double r121473 = r121472 * r121472;
double r121474 = 1.0;
double r121475 = r121474 * r121474;
double r121476 = r121473 - r121475;
double r121477 = r121472 - r121474;
double r121478 = r121476 * r121477;
double r121479 = cbrt(r121478);
double r121480 = r121472 + r121474;
double r121481 = cbrt(r121480);
double r121482 = r121479 / r121481;
double r121483 = cbrt(r121477);
double r121484 = r121482 * r121483;
double r121485 = 2.1553377009136073e-16;
bool r121486 = r121469 <= r121485;
double r121487 = 0.5;
double r121488 = 2.0;
double r121489 = pow(r121467, r121488);
double r121490 = r121487 * r121489;
double r121491 = r121490 * r121468;
double r121492 = r121467 + r121491;
double r121493 = r121468 * r121492;
double r121494 = 0.16666666666666666;
double r121495 = 3.0;
double r121496 = pow(r121467, r121495);
double r121497 = pow(r121468, r121495);
double r121498 = r121496 * r121497;
double r121499 = r121494 * r121498;
double r121500 = r121493 + r121499;
double r121501 = exp(r121477);
double r121502 = log(r121501);
double r121503 = r121486 ? r121500 : r121502;
double r121504 = r121471 ? r121484 : r121503;
return r121504;
}




Bits error versus a




Bits error versus x
Results
| Original | 28.7 |
|---|---|
| Target | 0.2 |
| Herbie | 8.7 |
if (* a x) < -3.9828235191582816e-07Initial program 0.1
rmApplied add-cbrt-cube0.1
Simplified0.1
rmApplied add-cube-cbrt0.2
Applied unpow-prod-down0.2
Applied cbrt-prod0.2
Simplified0.1
Simplified0.1
rmApplied flip--0.1
Applied associate-*r/0.1
Applied cbrt-div0.1
Simplified0.1
if -3.9828235191582816e-07 < (* a x) < 2.1553377009136073e-16Initial program 44.9
Taylor expanded around 0 13.0
Simplified13.0
if 2.1553377009136073e-16 < (* a x) Initial program 17.4
rmApplied add-log-exp17.4
Applied add-log-exp24.5
Applied diff-log24.9
Simplified24.5
Final simplification8.7
herbie shell --seed 2020020
(FPCore (a x)
:name "expax (section 3.5)"
:precision binary64
:herbie-expected 14
:herbie-target
(if (< (fabs (* a x)) 0.1) (* (* a x) (+ 1 (+ (/ (* a x) 2) (/ (pow (* a x) 2) 6)))) (- (exp (* a x)) 1))
(- (exp (* a x)) 1))