\frac{e^{x} - 1}{x}\begin{array}{l}
\mathbf{if}\;x \le -1.489848388411735063616148089238322427263 \cdot 10^{-4}:\\
\;\;\;\;\frac{\left(\sqrt[3]{\log \left(e^{e^{x} - 1}\right)} \cdot \sqrt[3]{\log \left(e^{e^{x} - 1}\right)}\right) \cdot \sqrt[3]{\log \left(e^{e^{x} - 1}\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{1}{6} \cdot x + \frac{1}{2}\right) \cdot x\\
\end{array}double f(double x) {
double r3857341 = x;
double r3857342 = exp(r3857341);
double r3857343 = 1.0;
double r3857344 = r3857342 - r3857343;
double r3857345 = r3857344 / r3857341;
return r3857345;
}
double f(double x) {
double r3857346 = x;
double r3857347 = -0.0001489848388411735;
bool r3857348 = r3857346 <= r3857347;
double r3857349 = exp(r3857346);
double r3857350 = 1.0;
double r3857351 = r3857349 - r3857350;
double r3857352 = exp(r3857351);
double r3857353 = log(r3857352);
double r3857354 = cbrt(r3857353);
double r3857355 = r3857354 * r3857354;
double r3857356 = r3857355 * r3857354;
double r3857357 = r3857356 / r3857346;
double r3857358 = 1.0;
double r3857359 = 0.16666666666666666;
double r3857360 = r3857359 * r3857346;
double r3857361 = 0.5;
double r3857362 = r3857360 + r3857361;
double r3857363 = r3857362 * r3857346;
double r3857364 = r3857358 + r3857363;
double r3857365 = r3857348 ? r3857357 : r3857364;
return r3857365;
}




Bits error versus x
Results
| Original | 39.8 |
|---|---|
| Target | 40.2 |
| Herbie | 0.3 |
if x < -0.0001489848388411735Initial program 0.1
rmApplied add-log-exp0.1
Applied add-log-exp0.1
Applied diff-log0.1
Simplified0.1
rmApplied add-cube-cbrt0.1
if -0.0001489848388411735 < x Initial program 60.2
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.3
herbie shell --seed 2019179
(FPCore (x)
:name "Kahan's exp quotient"
:herbie-target
(if (and (< x 1.0) (> x -1.0)) (/ (- (exp x) 1.0) (log (exp x))) (/ (- (exp x) 1.0) x))
(/ (- (exp x) 1.0) x))