e^{a \cdot x} - 1.0\begin{array}{l}
\mathbf{if}\;a \cdot x \le -0.0009957798500582489:\\
\;\;\;\;\left(\sqrt[3]{\log \left(e^{e^{a \cdot x} - 1.0}\right)} \cdot \sqrt[3]{\log \left(e^{e^{a \cdot x} - 1.0}\right)}\right) \cdot \sqrt[3]{\log \left(\sqrt{e^{e^{a \cdot x} - 1.0}}\right) + \log \left(\sqrt{e^{e^{a \cdot x} - 1.0}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right), \frac{1}{2}, \mathsf{fma}\left(\left(\left(a \cdot x\right) \cdot \left(a \cdot x\right)\right) \cdot \left(a \cdot x\right), \frac{1}{6}, a \cdot x\right)\right)\\
\end{array}double f(double a, double x) {
double r5355256 = a;
double r5355257 = x;
double r5355258 = r5355256 * r5355257;
double r5355259 = exp(r5355258);
double r5355260 = 1.0;
double r5355261 = r5355259 - r5355260;
return r5355261;
}
double f(double a, double x) {
double r5355262 = a;
double r5355263 = x;
double r5355264 = r5355262 * r5355263;
double r5355265 = -0.0009957798500582489;
bool r5355266 = r5355264 <= r5355265;
double r5355267 = exp(r5355264);
double r5355268 = 1.0;
double r5355269 = r5355267 - r5355268;
double r5355270 = exp(r5355269);
double r5355271 = log(r5355270);
double r5355272 = cbrt(r5355271);
double r5355273 = r5355272 * r5355272;
double r5355274 = sqrt(r5355270);
double r5355275 = log(r5355274);
double r5355276 = r5355275 + r5355275;
double r5355277 = cbrt(r5355276);
double r5355278 = r5355273 * r5355277;
double r5355279 = r5355264 * r5355264;
double r5355280 = 0.5;
double r5355281 = r5355279 * r5355264;
double r5355282 = 0.16666666666666666;
double r5355283 = fma(r5355281, r5355282, r5355264);
double r5355284 = fma(r5355279, r5355280, r5355283);
double r5355285 = r5355266 ? r5355278 : r5355284;
return r5355285;
}




Bits error versus a




Bits error versus x
| Original | 29.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
if (* a x) < -0.0009957798500582489Initial program 0.0
rmApplied add-log-exp0.0
Applied add-log-exp0.0
Applied diff-log0.0
Simplified0.0
rmApplied add-cube-cbrt0.0
rmApplied add-sqr-sqrt0.0
Applied log-prod0.0
if -0.0009957798500582489 < (* a x) Initial program 44.8
Taylor expanded around 0 14.5
Simplified0.4
Final simplification0.3
herbie shell --seed 2019165 +o rules:numerics
(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))