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




Bits error versus a




Bits error versus x
Results
| Original | 29.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.7 |
if (*.f64 a x) < -1.4951999403819288e-8Initial program 0.2
rmApplied add-cbrt-cube_binary64_18190.2
Simplified0.2
if -1.4951999403819288e-8 < (*.f64 a x) Initial program 45.0
Taylor expanded around 0 0.9
Final simplification0.7
herbie shell --seed 2021027
(FPCore (a x)
:name "expax (section 3.5)"
:precision binary64
: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))