e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -8.695234510422765288051305532235346618108 \cdot 10^{-4}:\\
\;\;\;\;\left(\sqrt[3]{e^{a \cdot x} - 1} \cdot \sqrt[3]{e^{a \cdot x} - 1}\right) \cdot \sqrt[3]{e^{a \cdot x} - 1}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{1}{2} \cdot a, x, 1\right) \cdot a\right) \cdot x\\
\end{array}double f(double a, double x) {
double r102401 = a;
double r102402 = x;
double r102403 = r102401 * r102402;
double r102404 = exp(r102403);
double r102405 = 1.0;
double r102406 = r102404 - r102405;
return r102406;
}
double f(double a, double x) {
double r102407 = a;
double r102408 = x;
double r102409 = r102407 * r102408;
double r102410 = -0.0008695234510422765;
bool r102411 = r102409 <= r102410;
double r102412 = exp(r102409);
double r102413 = 1.0;
double r102414 = r102412 - r102413;
double r102415 = cbrt(r102414);
double r102416 = r102415 * r102415;
double r102417 = r102416 * r102415;
double r102418 = 0.5;
double r102419 = r102418 * r102407;
double r102420 = 1.0;
double r102421 = fma(r102419, r102408, r102420);
double r102422 = r102421 * r102407;
double r102423 = r102422 * r102408;
double r102424 = r102411 ? r102417 : r102423;
return r102424;
}




Bits error versus a




Bits error versus x
| Original | 29.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.5 |
if (* a x) < -0.0008695234510422765Initial program 0.0
rmApplied add-cube-cbrt0.0
if -0.0008695234510422765 < (* a x) Initial program 44.4
Taylor expanded around 0 14.5
Simplified14.5
Taylor expanded around 0 8.0
Simplified8.0
rmApplied add-sqr-sqrt36.4
Applied unpow-prod-down36.4
Applied add-sqr-sqrt50.1
Applied unpow-prod-down50.1
Applied unswap-sqr48.4
Simplified48.4
Simplified0.8
Taylor expanded around inf 8.0
Simplified0.8
Final simplification0.5
herbie shell --seed 2019356 +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))