e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -6.33595634735350902 \cdot 10^{-9}:\\
\;\;\;\;\sqrt[3]{e^{a \cdot x} - 1} \cdot \frac{\sqrt[3]{\left(\sqrt[3]{e^{a \cdot x} \cdot e^{a \cdot x} - 1 \cdot 1} \cdot \sqrt[3]{e^{a \cdot x} \cdot e^{a \cdot x} - 1 \cdot 1}\right) \cdot \sqrt[3]{e^{a \cdot x} \cdot e^{a \cdot x} - 1 \cdot 1}} \cdot \sqrt[3]{e^{a \cdot x} \cdot e^{a \cdot x} - 1 \cdot 1}}{\sqrt[3]{e^{a \cdot x} + 1} \cdot \sqrt[3]{e^{a \cdot x} + 1}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{2}, {a}^{2} \cdot {x}^{2}, \mathsf{fma}\left(\frac{1}{6}, {a}^{3} \cdot {x}^{3}, a \cdot x\right)\right)\\
\end{array}double f(double a, double x) {
double r106997 = a;
double r106998 = x;
double r106999 = r106997 * r106998;
double r107000 = exp(r106999);
double r107001 = 1.0;
double r107002 = r107000 - r107001;
return r107002;
}
double f(double a, double x) {
double r107003 = a;
double r107004 = x;
double r107005 = r107003 * r107004;
double r107006 = -6.335956347353509e-09;
bool r107007 = r107005 <= r107006;
double r107008 = exp(r107005);
double r107009 = 1.0;
double r107010 = r107008 - r107009;
double r107011 = cbrt(r107010);
double r107012 = r107008 * r107008;
double r107013 = r107009 * r107009;
double r107014 = r107012 - r107013;
double r107015 = cbrt(r107014);
double r107016 = r107015 * r107015;
double r107017 = r107016 * r107015;
double r107018 = cbrt(r107017);
double r107019 = r107018 * r107015;
double r107020 = r107008 + r107009;
double r107021 = cbrt(r107020);
double r107022 = r107021 * r107021;
double r107023 = r107019 / r107022;
double r107024 = r107011 * r107023;
double r107025 = 0.5;
double r107026 = 2.0;
double r107027 = pow(r107003, r107026);
double r107028 = pow(r107004, r107026);
double r107029 = r107027 * r107028;
double r107030 = 0.16666666666666666;
double r107031 = 3.0;
double r107032 = pow(r107003, r107031);
double r107033 = pow(r107004, r107031);
double r107034 = r107032 * r107033;
double r107035 = fma(r107030, r107034, r107005);
double r107036 = fma(r107025, r107029, r107035);
double r107037 = r107007 ? r107024 : r107036;
return r107037;
}




Bits error versus a




Bits error versus x
| Original | 29.3 |
|---|---|
| Target | 0.2 |
| Herbie | 9.1 |
if (* a x) < -6.335956347353509e-09Initial program 0.3
rmApplied add-log-exp0.3
Applied add-log-exp0.3
Applied diff-log0.3
Simplified0.3
rmApplied add-cube-cbrt0.3
Applied exp-prod0.3
Applied log-pow0.3
Simplified0.3
rmApplied flip--0.3
Applied cbrt-div0.3
Applied flip--0.3
Applied cbrt-div0.3
Applied frac-times0.3
rmApplied add-cube-cbrt0.3
if -6.335956347353509e-09 < (* a x) Initial program 44.6
Taylor expanded around 0 13.7
Simplified13.7
Final simplification9.1
herbie shell --seed 2020024 +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))