e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -6.2540867210978604 \cdot 10^{-60}:\\
\;\;\;\;\sqrt[3]{\frac{{\left(e^{\mathsf{fma}\left(a, x, a \cdot x\right)} - 1 \cdot 1\right)}^{3}}{{\left({\left(e^{a \cdot x}\right)}^{3} + {1}^{3}\right)}^{3}}} \cdot \mathsf{fma}\left(1, 1 - e^{a \cdot x}, e^{\mathsf{fma}\left(a, x, a \cdot x\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, {a}^{2} \cdot {x}^{2}, \mathsf{fma}\left(0.16666666666666663, {a}^{3} \cdot {x}^{3}, 1 \cdot \left(a \cdot x\right)\right)\right)\\
\end{array}double f(double a, double x) {
double r66502 = a;
double r66503 = x;
double r66504 = r66502 * r66503;
double r66505 = exp(r66504);
double r66506 = 1.0;
double r66507 = r66505 - r66506;
return r66507;
}
double f(double a, double x) {
double r66508 = a;
double r66509 = x;
double r66510 = r66508 * r66509;
double r66511 = -6.25408672109786e-60;
bool r66512 = r66510 <= r66511;
double r66513 = fma(r66508, r66509, r66510);
double r66514 = exp(r66513);
double r66515 = 1.0;
double r66516 = r66515 * r66515;
double r66517 = r66514 - r66516;
double r66518 = 3.0;
double r66519 = pow(r66517, r66518);
double r66520 = exp(r66510);
double r66521 = pow(r66520, r66518);
double r66522 = pow(r66515, r66518);
double r66523 = r66521 + r66522;
double r66524 = pow(r66523, r66518);
double r66525 = r66519 / r66524;
double r66526 = cbrt(r66525);
double r66527 = r66515 - r66520;
double r66528 = fma(r66515, r66527, r66514);
double r66529 = r66526 * r66528;
double r66530 = 0.5;
double r66531 = 2.0;
double r66532 = pow(r66508, r66531);
double r66533 = pow(r66509, r66531);
double r66534 = r66532 * r66533;
double r66535 = 0.16666666666666663;
double r66536 = pow(r66508, r66518);
double r66537 = pow(r66509, r66518);
double r66538 = r66536 * r66537;
double r66539 = r66515 * r66510;
double r66540 = fma(r66535, r66538, r66539);
double r66541 = fma(r66530, r66534, r66540);
double r66542 = r66512 ? r66529 : r66541;
return r66542;
}




Bits error versus a




Bits error versus x
| Original | 29.4 |
|---|---|
| Target | 0.2 |
| Herbie | 10.2 |
if (* a x) < -6.25408672109786e-60Initial program 7.9
rmApplied add-cbrt-cube7.9
Simplified7.9
rmApplied flip--7.9
Applied cube-div7.9
rmApplied prod-exp7.8
Simplified7.8
rmApplied flip3-+7.8
Applied cube-div7.8
Applied associate-/r/7.8
Applied cbrt-prod7.8
Simplified7.8
if -6.25408672109786e-60 < (* a x) Initial program 43.3
rmApplied add-cbrt-cube43.3
Simplified43.3
rmApplied flip--43.3
Applied cube-div43.4
Taylor expanded around 0 11.7
Simplified11.7
Final simplification10.2
herbie shell --seed 2020089 +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))