e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -3.55569637749741916 \cdot 10^{-5}:\\
\;\;\;\;\left(\sqrt{e^{a \cdot x}} + \sqrt{1}\right) \cdot \left(\sqrt{e^{a \cdot x}} - \sqrt{1}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot a\\
\end{array}double code(double a, double x) {
return (exp((a * x)) - 1.0);
}
double code(double a, double x) {
double VAR;
if (((a * x) <= -3.555696377497419e-05)) {
VAR = ((sqrt(exp((a * x))) + sqrt(1.0)) * (sqrt(exp((a * x))) - sqrt(1.0)));
} else {
VAR = (x * a);
}
return VAR;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.8 |
if (* a x) < -3.555696377497419e-05Initial program 0.1
rmApplied add-sqr-sqrt0.1
Applied add-sqr-sqrt0.1
Applied difference-of-squares0.1
if -3.555696377497419e-05 < (* a x) Initial program 44.4
Taylor expanded around 0 14.0
Simplified14.0
Taylor expanded around 0 8.0
Simplified4.6
Taylor expanded around 0 1.2
Simplified1.2
Final simplification0.8
herbie shell --seed 2020105
(FPCore (a x)
:name "expax (section 3.5)"
:precision binary64
:herbie-expected 14
:herbie-target
(if (< (fabs (* a x)) 0.1) (* (* a x) (+ 1 (+ (/ (* a x) 2) (/ (pow (* a x) 2) 6)))) (- (exp (* a x)) 1))
(- (exp (* a x)) 1))