e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -7.654795418996283:\\
\;\;\;\;\sqrt[3]{\frac{{\left(\frac{\left(-{\left(1 \cdot 1\right)}^{3}\right) + {\left(e^{a \cdot x}\right)}^{6}}{\mathsf{fma}\left(1 \cdot 1, \mathsf{fma}\left(1, 1, {\left(e^{a \cdot x}\right)}^{2}\right), {\left(e^{a \cdot x}\right)}^{4}\right)}\right)}^{3}}{{\left(e^{a \cdot x} + 1\right)}^{3}}}\\
\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 code(double a, double x) {
return (exp((a * x)) - 1.0);
}
double code(double a, double x) {
double temp;
if (((a * x) <= -7.654795418996283)) {
temp = cbrt((pow(((-pow((1.0 * 1.0), 3.0) + pow(exp((a * x)), 6.0)) / fma((1.0 * 1.0), fma(1.0, 1.0, pow(exp((a * x)), 2.0)), pow(exp((a * x)), 4.0))), 3.0) / pow((exp((a * x)) + 1.0), 3.0)));
} else {
temp = fma(0.5, (pow(a, 2.0) * pow(x, 2.0)), fma(0.16666666666666663, (pow(a, 3.0) * pow(x, 3.0)), (1.0 * (a * x))));
}
return temp;
}




Bits error versus a




Bits error versus x
Results
| Original | 30.1 |
|---|---|
| Target | 0.2 |
| Herbie | 10.2 |
if (* a x) < -7.654795418996283Initial program 0
rmApplied add-cbrt-cube0.0
Simplified0.0
rmApplied flip--0.0
Applied cube-div0.0
rmApplied flip3--0.0
Simplified0.0
Simplified0.0
if -7.654795418996283 < (* a x) Initial program 44.6
rmApplied add-cbrt-cube44.6
Simplified44.6
rmApplied flip--44.6
Applied cube-div44.7
Taylor expanded around 0 15.1
Simplified15.1
Final simplification10.2
herbie shell --seed 2020058 +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))