x + \frac{e^{y \cdot \log \left(\frac{y}{z + y}\right)}}{y}\begin{array}{l}
\mathbf{if}\;y \le 7.3367565723070908 \cdot 10^{-63}:\\
\;\;\;\;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 r499983 = x;
double r499984 = y;
double r499985 = z;
double r499986 = r499985 + r499984;
double r499987 = r499984 / r499986;
double r499988 = log(r499987);
double r499989 = r499984 * r499988;
double r499990 = exp(r499989);
double r499991 = r499990 / r499984;
double r499992 = r499983 + r499991;
return r499992;
}
double f(double x, double y, double z) {
double r499993 = y;
double r499994 = 7.336756572307091e-63;
bool r499995 = r499993 <= r499994;
double r499996 = x;
double r499997 = exp(r499993);
double r499998 = z;
double r499999 = r499998 + r499993;
double r500000 = r499993 / r499999;
double r500001 = log(r500000);
double r500002 = pow(r499997, r500001);
double r500003 = r500002 / r499993;
double r500004 = r499996 + r500003;
double r500005 = -1.0;
double r500006 = r500005 * r499998;
double r500007 = exp(r500006);
double r500008 = r500007 / r499993;
double r500009 = r499996 + r500008;
double r500010 = r499995 ? r500004 : r500009;
return r500010;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.9 |
|---|---|
| Target | 1.1 |
| Herbie | 1.1 |
if y < 7.336756572307091e-63Initial program 8.1
rmApplied add-log-exp29.8
Applied exp-to-pow0.9
if 7.336756572307091e-63 < y Initial program 1.5
Taylor expanded around inf 1.6
Final simplification1.1
herbie shell --seed 2020036
(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)))