e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \leq -2.533591632706496 \cdot 10^{-05}:\\
\;\;\;\;\log \left(e^{e^{a \cdot x} - 1}\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot x + 0.5 \cdot \sqrt[3]{{\left(a \cdot x\right)}^{6}}\\
\end{array}(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
(FPCore (a x) :precision binary64 (if (<= (* a x) -2.533591632706496e-05) (log (exp (- (exp (* a x)) 1.0))) (+ (* a x) (* 0.5 (cbrt (pow (* a x) 6.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)) <= -2.533591632706496e-05)) {
tmp = ((double) log(((double) exp(((double) (((double) exp(((double) (a * x)))) - 1.0))))));
} else {
tmp = ((double) (((double) (a * x)) + ((double) (0.5 * ((double) cbrt(((double) pow(((double) (a * x)), 6.0))))))));
}
return tmp;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.5 |
if (*.f64 a x) < -2.533591632706496e-5Initial program 0.1
rmApplied add-log-exp_binary640.1
Applied add-log-exp_binary640.1
Applied diff-log_binary640.1
Simplified0.1
if -2.533591632706496e-5 < (*.f64 a x) Initial program 44.1
Taylor expanded around 0 15.0
Simplified8.0
Taylor expanded around 0 8.5
Simplified4.8
rmApplied add-cbrt-cube_binary648.1
Applied add-cbrt-cube_binary648.1
Applied cbrt-unprod_binary6412.0
Applied add-cbrt-cube_binary6418.9
Applied cbrt-unprod_binary6418.9
Applied add-cbrt-cube_binary6418.9
Applied cbrt-unprod_binary6418.9
Simplified0.7
Final simplification0.5
herbie shell --seed 2020210
(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))