e^{a \cdot x} - 1\begin{array}{l}
\mathbf{if}\;a \le -2.220968693212043584151047536654679869547 \cdot 10^{98}:\\
\;\;\;\;e^{x \cdot a} - 1\\
\mathbf{elif}\;a \le -3.362393975033817970229302492536134970466 \cdot 10^{63}:\\
\;\;\;\;\left(\left(x \cdot a\right) \cdot \left(x \cdot a\right)\right) \cdot \frac{1}{2} + \left(x \cdot a + \left(\left(\frac{1}{6} \cdot a\right) \cdot \left(\left(x \cdot a\right) \cdot \left(x \cdot a\right)\right)\right) \cdot x\right)\\
\mathbf{elif}\;a \le -1655268361375023616:\\
\;\;\;\;e^{x \cdot a} - 1\\
\mathbf{elif}\;a \le -1.370587247264004292740295499973634293283 \cdot 10^{-65}:\\
\;\;\;\;\left(\left(x \cdot a\right) \cdot \left(x \cdot a\right)\right) \cdot \frac{1}{2} + \left(x \cdot a + \left(\left(\frac{1}{6} \cdot a\right) \cdot \left(\left(x \cdot a\right) \cdot \left(x \cdot a\right)\right)\right) \cdot x\right)\\
\mathbf{elif}\;a \le -4.92652882719554893357575898335612646908 \cdot 10^{-81}:\\
\;\;\;\;e^{x \cdot a} - 1\\
\mathbf{elif}\;a \le 5.142228780426164324409301691996597408294 \cdot 10^{104}:\\
\;\;\;\;\left(\left(x \cdot a\right) \cdot \left(x \cdot a\right)\right) \cdot \frac{1}{2} + \left(x \cdot a + \left(\left(\frac{1}{6} \cdot a\right) \cdot \left(\left(x \cdot a\right) \cdot \left(x \cdot a\right)\right)\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;e^{x \cdot a} - 1\\
\end{array}double f(double a, double x) {
double r5284071 = a;
double r5284072 = x;
double r5284073 = r5284071 * r5284072;
double r5284074 = exp(r5284073);
double r5284075 = 1.0;
double r5284076 = r5284074 - r5284075;
return r5284076;
}
double f(double a, double x) {
double r5284077 = a;
double r5284078 = -2.2209686932120436e+98;
bool r5284079 = r5284077 <= r5284078;
double r5284080 = x;
double r5284081 = r5284080 * r5284077;
double r5284082 = exp(r5284081);
double r5284083 = 1.0;
double r5284084 = r5284082 - r5284083;
double r5284085 = -3.362393975033818e+63;
bool r5284086 = r5284077 <= r5284085;
double r5284087 = r5284081 * r5284081;
double r5284088 = 0.5;
double r5284089 = r5284087 * r5284088;
double r5284090 = 0.16666666666666666;
double r5284091 = r5284090 * r5284077;
double r5284092 = r5284091 * r5284087;
double r5284093 = r5284092 * r5284080;
double r5284094 = r5284081 + r5284093;
double r5284095 = r5284089 + r5284094;
double r5284096 = -1.6552683613750236e+18;
bool r5284097 = r5284077 <= r5284096;
double r5284098 = -1.3705872472640043e-65;
bool r5284099 = r5284077 <= r5284098;
double r5284100 = -4.926528827195549e-81;
bool r5284101 = r5284077 <= r5284100;
double r5284102 = 5.1422287804261643e+104;
bool r5284103 = r5284077 <= r5284102;
double r5284104 = r5284103 ? r5284095 : r5284084;
double r5284105 = r5284101 ? r5284084 : r5284104;
double r5284106 = r5284099 ? r5284095 : r5284105;
double r5284107 = r5284097 ? r5284084 : r5284106;
double r5284108 = r5284086 ? r5284095 : r5284107;
double r5284109 = r5284079 ? r5284084 : r5284108;
return r5284109;
}




Bits error versus a




Bits error versus x
Results
| Original | 29.7 |
|---|---|
| Target | 0.2 |
| Herbie | 13.8 |
if a < -2.2209686932120436e+98 or -3.362393975033818e+63 < a < -1.6552683613750236e+18 or -1.3705872472640043e-65 < a < -4.926528827195549e-81 or 5.1422287804261643e+104 < a Initial program 19.0
rmApplied add-exp-log19.0
Simplified19.0
if -2.2209686932120436e+98 < a < -3.362393975033818e+63 or -1.6552683613750236e+18 < a < -1.3705872472640043e-65 or -4.926528827195549e-81 < a < 5.1422287804261643e+104Initial program 34.6
Taylor expanded around 0 18.5
Simplified11.5
rmApplied distribute-lft-in11.5
Final simplification13.8
herbie shell --seed 2019171
(FPCore (a x)
:name "expax (section 3.5)"
: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))