e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -0.001397225479405418777784086969973031955305:\\
\;\;\;\;\log \left(e^{\sqrt[3]{{\left(e^{a \cdot x} - 1\right)}^{3}}}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a + \left(\left(a \cdot x\right) \cdot a\right) \cdot \left(\left(a \cdot x\right) \cdot \frac{1}{6} + \frac{1}{2}\right)\right)\\
\end{array}double f(double a, double x) {
double r98792 = a;
double r98793 = x;
double r98794 = r98792 * r98793;
double r98795 = exp(r98794);
double r98796 = 1.0;
double r98797 = r98795 - r98796;
return r98797;
}
double f(double a, double x) {
double r98798 = a;
double r98799 = x;
double r98800 = r98798 * r98799;
double r98801 = -0.0013972254794054188;
bool r98802 = r98800 <= r98801;
double r98803 = exp(r98800);
double r98804 = 1.0;
double r98805 = r98803 - r98804;
double r98806 = 3.0;
double r98807 = pow(r98805, r98806);
double r98808 = cbrt(r98807);
double r98809 = exp(r98808);
double r98810 = log(r98809);
double r98811 = r98800 * r98798;
double r98812 = 0.16666666666666666;
double r98813 = r98800 * r98812;
double r98814 = 0.5;
double r98815 = r98813 + r98814;
double r98816 = r98811 * r98815;
double r98817 = r98798 + r98816;
double r98818 = r98799 * r98817;
double r98819 = r98802 ? r98810 : r98818;
return r98819;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.3 |
if (* a x) < -0.0013972254794054188Initial program 0.0
rmApplied add-log-exp0.0
Applied add-log-exp0.0
Applied diff-log0.0
Simplified0.0
rmApplied add-cbrt-cube0.0
Simplified0.0
if -0.0013972254794054188 < (* a x) Initial program 45.0
Taylor expanded around 0 15.0
Simplified4.4
rmApplied associate-*r*4.4
Simplified0.4
Final simplification0.3
herbie shell --seed 2019347
(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))