e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \leq -0.017625308791433102:\\
\;\;\;\;\frac{{\left(e^{a \cdot x}\right)}^{2} + -1}{e^{a \cdot x} + 1}\\
\mathbf{else}:\\
\;\;\;\;a \cdot x + a \cdot \left(0.5 \cdot \left(x \cdot \left(a \cdot x\right)\right)\right)\\
\end{array}(FPCore (a x) :precision binary64 (- (exp (* a x)) 1.0))
(FPCore (a x) :precision binary64 (if (<= (* a x) -0.017625308791433102) (/ (+ (pow (exp (* a x)) 2.0) -1.0) (+ (exp (* a x)) 1.0)) (+ (* a x) (* a (* 0.5 (* x (* 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) <= -0.017625308791433102) {
tmp = (pow(exp(a * x), 2.0) + -1.0) / (exp(a * x) + 1.0);
} else {
tmp = (a * x) + (a * (0.5 * (x * (a * x))));
}
return tmp;
}



Bits error versus a



Bits error versus x
Results
if (*.f64 a x) < -0.0176253087914331023Initial program 0.0
rmApplied flip--_binary640.0
Simplified0.0
if -0.0176253087914331023 < (*.f64 a x) Initial program 44.4
Taylor expanded around 0 8.5
Simplified4.8
rmApplied associate-*r*_binary640.6
rmApplied distribute-rgt-in_binary640.6
Simplified0.6
Simplified0.6
Final simplification0.4
herbie shell --seed 2021043
(FPCore (a x)
:name "expax (section 3.5)"
:precision binary64
:herbie-expected 14
(- (exp (* a x)) 1.0))