e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -8.293963492047654929060613942291516367562 \cdot 10^{-20}:\\
\;\;\;\;\sqrt[3]{\frac{{\left(e^{2}\right)}^{\left(a \cdot x\right)} - 1 \cdot 1}{e^{a \cdot x} + 1}} \cdot \left(\sqrt[3]{e^{a \cdot x} - 1} \cdot \frac{\sqrt[3]{e^{2 \cdot \left(a \cdot x\right)} - 1 \cdot 1}}{\sqrt[3]{e^{a \cdot x} + 1}}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({x}^{2}, \mathsf{fma}\left(\frac{1}{2}, {a}^{2}, \left(x \cdot {a}^{3}\right) \cdot \frac{1}{6}\right), a \cdot x\right)\\
\end{array}double f(double a, double x) {
double r65740 = a;
double r65741 = x;
double r65742 = r65740 * r65741;
double r65743 = exp(r65742);
double r65744 = 1.0;
double r65745 = r65743 - r65744;
return r65745;
}
double f(double a, double x) {
double r65746 = a;
double r65747 = x;
double r65748 = r65746 * r65747;
double r65749 = -8.293963492047655e-20;
bool r65750 = r65748 <= r65749;
double r65751 = 2.0;
double r65752 = exp(r65751);
double r65753 = pow(r65752, r65748);
double r65754 = 1.0;
double r65755 = r65754 * r65754;
double r65756 = r65753 - r65755;
double r65757 = exp(r65748);
double r65758 = r65757 + r65754;
double r65759 = r65756 / r65758;
double r65760 = cbrt(r65759);
double r65761 = r65757 - r65754;
double r65762 = cbrt(r65761);
double r65763 = r65751 * r65748;
double r65764 = exp(r65763);
double r65765 = r65764 - r65755;
double r65766 = cbrt(r65765);
double r65767 = cbrt(r65758);
double r65768 = r65766 / r65767;
double r65769 = r65762 * r65768;
double r65770 = r65760 * r65769;
double r65771 = pow(r65747, r65751);
double r65772 = 0.5;
double r65773 = pow(r65746, r65751);
double r65774 = 3.0;
double r65775 = pow(r65746, r65774);
double r65776 = r65747 * r65775;
double r65777 = 0.16666666666666666;
double r65778 = r65776 * r65777;
double r65779 = fma(r65772, r65773, r65778);
double r65780 = fma(r65771, r65779, r65748);
double r65781 = r65750 ? r65770 : r65780;
return r65781;
}




Bits error versus a




Bits error versus x
| Original | 29.8 |
|---|---|
| Target | 0.1 |
| Herbie | 7.5 |
if (* a x) < -8.293963492047655e-20Initial program 1.9
rmApplied add-log-exp1.9
Applied add-log-exp1.9
Applied diff-log2.0
Simplified1.9
rmApplied add-cube-cbrt1.9
Applied exp-prod1.9
Applied log-pow1.9
Simplified1.9
rmApplied flip--1.9
Applied cbrt-div1.9
Simplified1.9
rmApplied flip--1.9
Simplified1.8
if -8.293963492047655e-20 < (* a x) Initial program 45.3
rmApplied add-log-exp45.3
Applied add-log-exp45.5
Applied diff-log45.5
Simplified45.5
Taylor expanded around 0 14.2
Simplified10.6
Final simplification7.5
herbie shell --seed 2019347 +o rules:numerics
(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))