e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \cdot x \le -8.829291748098453965699783086839461538272 \cdot 10^{-15}:\\
\;\;\;\;\frac{e^{2 \cdot \left(a \cdot x\right)} - 1 \cdot 1}{e^{a \cdot x} + 1}\\
\mathbf{else}:\\
\;\;\;\;a \cdot x + \left(x \cdot \left(\frac{1}{2} \cdot {a}^{2} + \left(\frac{1}{6} \cdot {a}^{3}\right) \cdot x\right)\right) \cdot x\\
\end{array}double f(double a, double x) {
double r49198 = a;
double r49199 = x;
double r49200 = r49198 * r49199;
double r49201 = exp(r49200);
double r49202 = 1.0;
double r49203 = r49201 - r49202;
return r49203;
}
double f(double a, double x) {
double r49204 = a;
double r49205 = x;
double r49206 = r49204 * r49205;
double r49207 = -8.829291748098454e-15;
bool r49208 = r49206 <= r49207;
double r49209 = 2.0;
double r49210 = r49209 * r49206;
double r49211 = exp(r49210);
double r49212 = 1.0;
double r49213 = r49212 * r49212;
double r49214 = r49211 - r49213;
double r49215 = exp(r49206);
double r49216 = r49215 + r49212;
double r49217 = r49214 / r49216;
double r49218 = 0.5;
double r49219 = pow(r49204, r49209);
double r49220 = r49218 * r49219;
double r49221 = 0.16666666666666666;
double r49222 = 3.0;
double r49223 = pow(r49204, r49222);
double r49224 = r49221 * r49223;
double r49225 = r49224 * r49205;
double r49226 = r49220 + r49225;
double r49227 = r49205 * r49226;
double r49228 = r49227 * r49205;
double r49229 = r49206 + r49228;
double r49230 = r49208 ? r49217 : r49229;
return r49230;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.8 |
|---|---|
| Target | 0.2 |
| Herbie | 5.1 |
if (* a x) < -8.829291748098454e-15Initial program 1.1
rmApplied add-cbrt-cube1.1
Simplified1.1
rmApplied flip--1.1
Applied cube-div1.1
Applied cbrt-div1.1
Simplified1.0
Simplified1.0
if -8.829291748098454e-15 < (* a x) Initial program 44.8
Taylor expanded around 0 14.1
Simplified10.7
rmApplied sqr-pow10.7
Applied associate-*l*7.2
Simplified7.2
Final simplification5.1
herbie shell --seed 2019235
(FPCore (a x)
:name "expax (section 3.5)"
:precision binary64
:herbie-expected 14
:herbie-target
(if (< (fabs (* a x)) 0.10000000000000001) (* (* a x) (+ 1 (+ (/ (* a x) 2) (/ (pow (* a x) 2) 6)))) (- (exp (* a x)) 1))
(- (exp (* a x)) 1))