e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \leq -1.2065385524619287 \cdot 10^{-05}:\\
\;\;\;\;\sqrt[3]{e^{a \cdot x}} \cdot \left(\sqrt[3]{e^{a \cdot x}} \cdot \sqrt[3]{e^{a \cdot x}}\right) - 1\\
\mathbf{else}:\\
\;\;\;\;a \cdot x + 0.5 \cdot {\left(a \cdot x\right)}^{2}\\
\end{array}(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
(FPCore (a x)
:precision binary64
(if (<= (* a x) -1.2065385524619287e-05)
(-
(* (cbrt (exp (* a x))) (* (cbrt (exp (* a x))) (cbrt (exp (* a x)))))
1.0)
(+ (* a x) (* 0.5 (pow (* a x) 2.0)))))double code(double a, double x) {
return ((double) (((double) exp(((double) (a * x)))) - 1.0));
}
double code(double a, double x) {
double tmp;
if ((((double) (a * x)) <= -1.2065385524619287e-05)) {
tmp = ((double) (((double) (((double) cbrt(((double) exp(((double) (a * x)))))) * ((double) (((double) cbrt(((double) exp(((double) (a * x)))))) * ((double) cbrt(((double) exp(((double) (a * x)))))))))) - 1.0));
} else {
tmp = ((double) (((double) (a * x)) + ((double) (0.5 * ((double) pow(((double) (a * x)), 2.0))))));
}
return tmp;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.4 |
if (*.f64 a x) < -1.20653855246192871e-5Initial program 0.1
rmApplied add-cube-cbrt_binary640.1
if -1.20653855246192871e-5 < (*.f64 a x) Initial program 44.2
Taylor expanded around 0 13.6
Simplified7.3
Taylor expanded around 0 7.9
Simplified7.9
rmApplied pow2_binary647.9
Applied pow2_binary647.9
Applied pow-prod-down_binary640.5
Final simplification0.4
herbie shell --seed 2020205
(FPCore (a x)
:name "expax (section 3.5)"
:precision binary64
:herbie-expected 14
:herbie-target
(if (< (fabs (* a x)) 0.1) (* (* a x) (+ 1.0 (+ (/ (* a x) 2.0) (/ (pow (* a x) 2.0) 6.0)))) (- (exp (* a x)) 1.0))
(- (exp (* a x)) 1.0))