e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -0.0839680346102975178:\\
\;\;\;\;e^{a \cdot x} - 1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a + a \cdot \left(a \cdot \left(x \cdot \frac{1}{2}\right)\right)\right)\\
\end{array}double code(double a, double x) {
return ((double) (((double) exp(((double) (a * x)))) - 1.0));
}
double code(double a, double x) {
double VAR;
if ((((double) (a * x)) <= -0.08396803461029752)) {
VAR = ((double) (((double) exp(((double) (a * x)))) - 1.0));
} else {
VAR = ((double) (x * ((double) (a + ((double) (a * ((double) (a * ((double) (x * 0.5))))))))));
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.6 |
if (* a x) < -0.0839680346102975178Initial program 0.0
if -0.0839680346102975178 < (* a x) Initial program 44.4
Taylor expanded around 0 15.1
Simplified8.2
rmApplied distribute-lft-in8.2
Simplified8.0
Taylor expanded around 0 9.1
Simplified0.9
Final simplification0.6
herbie shell --seed 2020184
(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))