e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -0.001614619952117295458710044542272044054698:\\
\;\;\;\;\log \left(e^{e^{a \cdot x} - 1}\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot x + x \cdot \left(\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 r131794 = a;
double r131795 = x;
double r131796 = r131794 * r131795;
double r131797 = exp(r131796);
double r131798 = 1.0;
double r131799 = r131797 - r131798;
return r131799;
}
double f(double a, double x) {
double r131800 = a;
double r131801 = x;
double r131802 = r131800 * r131801;
double r131803 = -0.0016146199521172955;
bool r131804 = r131802 <= r131803;
double r131805 = exp(r131802);
double r131806 = 1.0;
double r131807 = r131805 - r131806;
double r131808 = exp(r131807);
double r131809 = log(r131808);
double r131810 = r131802 * r131800;
double r131811 = 0.16666666666666666;
double r131812 = r131802 * r131811;
double r131813 = 0.5;
double r131814 = r131812 + r131813;
double r131815 = r131810 * r131814;
double r131816 = r131801 * r131815;
double r131817 = r131802 + r131816;
double r131818 = r131804 ? r131809 : r131817;
return r131818;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.1 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
if (* a x) < -0.0016146199521172955Initial program 0.0
rmApplied add-log-exp0.0
Applied add-log-exp0.0
Applied diff-log0.0
Simplified0.0
if -0.0016146199521172955 < (* a x) Initial program 43.6
Taylor expanded around 0 13.7
Simplified4.4
rmApplied associate-*r*4.4
Simplified0.5
rmApplied distribute-lft-in0.5
Simplified0.5
Final simplification0.3
herbie shell --seed 2019350
(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))