x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 1.184166370745772777259892531677086866132 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{{\left(e^{y}\right)}^{\left(\log \left(\frac{y}{z + y}\right)\right)}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{e^{-1 \cdot z}}{y}\\
\end{array}double f(double x, double y, double z) {
double r365375 = x;
double r365376 = y;
double r365377 = z;
double r365378 = r365377 + r365376;
double r365379 = r365376 / r365378;
double r365380 = log(r365379);
double r365381 = r365376 * r365380;
double r365382 = exp(r365381);
double r365383 = r365382 / r365376;
double r365384 = r365375 + r365383;
return r365384;
}
double f(double x, double y, double z) {
double r365385 = y;
double r365386 = 1.1841663707457728e-17;
bool r365387 = r365385 <= r365386;
double r365388 = x;
double r365389 = exp(r365385);
double r365390 = z;
double r365391 = r365390 + r365385;
double r365392 = r365385 / r365391;
double r365393 = log(r365392);
double r365394 = pow(r365389, r365393);
double r365395 = r365394 / r365385;
double r365396 = r365388 + r365395;
double r365397 = -1.0;
double r365398 = r365397 * r365390;
double r365399 = exp(r365398);
double r365400 = r365399 / r365385;
double r365401 = r365388 + r365400;
double r365402 = r365387 ? r365396 : r365401;
return r365402;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.1 |
|---|---|
| Target | 1.0 |
| Herbie | 0.7 |
if y < 1.1841663707457728e-17Initial program 8.0
rmApplied add-log-exp29.2
Applied exp-to-pow0.7
if 1.1841663707457728e-17 < y Initial program 1.8
Taylor expanded around inf 0.4
Final simplification0.7
herbie shell --seed 2020002
(FPCore (x y z)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, G"
:precision binary64
:herbie-target
(if (< (/ y (+ z y)) 7.1154157597908e-315) (+ x (/ (exp (/ -1 z)) y)) (+ x (/ (exp (log (pow (/ y (+ y z)) y))) y)))
(+ x (/ (exp (* y (log (/ y (+ z y))))) y)))