e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -1.252602566255028 \cdot 10^{-12}:\\
\;\;\;\;\left(\sqrt[3]{e^{a \cdot x} - 1} \cdot \frac{\sqrt[3]{e^{a \cdot x} \cdot e^{a \cdot x} - 1 \cdot 1}}{\sqrt[3]{e^{a \cdot x} + 1}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{{\left({\left(e^{a \cdot x}\right)}^{3} - {1}^{3}\right)}^{3}}}}{\sqrt[3]{e^{a \cdot x} \cdot e^{a \cdot x} + \left(1 \cdot 1 + e^{a \cdot x} \cdot 1\right)}}\\
\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 code(double a, double x) {
return (exp((a * x)) - 1.0);
}
double code(double a, double x) {
double VAR;
if (((a * x) <= -1.252602566255028e-12)) {
VAR = ((cbrt((exp((a * x)) - 1.0)) * (cbrt(((exp((a * x)) * exp((a * x))) - (1.0 * 1.0))) / cbrt((exp((a * x)) + 1.0)))) * (cbrt(cbrt(pow((pow(exp((a * x)), 3.0) - pow(1.0, 3.0)), 3.0))) / cbrt(((exp((a * x)) * exp((a * x))) + ((1.0 * 1.0) + (exp((a * x)) * 1.0))))));
} else {
VAR = fma(0.5, (pow(a, 2.0) * pow(x, 2.0)), fma(0.16666666666666666, (pow(a, 3.0) * pow(x, 3.0)), (a * x)));
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.4 |
|---|---|
| Target | 0.2 |
| Herbie | 9.4 |
if (* a x) < -1.252602566255028e-12Initial program 0.6
rmApplied add-cube-cbrt0.6
rmApplied flip3--0.6
Applied cbrt-div0.6
rmApplied flip--0.6
Applied cbrt-div0.6
rmApplied add-cbrt-cube0.6
Simplified0.6
if -1.252602566255028e-12 < (* a x) Initial program 44.2
Taylor expanded around 0 14.0
Simplified14.0
Final simplification9.4
herbie shell --seed 2020100 +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))