\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -1.5696397542027947 \cdot 10^{112} \lor \neg \left(x \le 5.2765314246890564 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(e^{x}\right)}^{\left(\log \left(\frac{x}{x + y}\right)\right)}}{x}\\
\end{array}double f(double x, double y) {
double r494086 = x;
double r494087 = y;
double r494088 = r494086 + r494087;
double r494089 = r494086 / r494088;
double r494090 = log(r494089);
double r494091 = r494086 * r494090;
double r494092 = exp(r494091);
double r494093 = r494092 / r494086;
return r494093;
}
double f(double x, double y) {
double r494094 = x;
double r494095 = -1.5696397542027947e+112;
bool r494096 = r494094 <= r494095;
double r494097 = 5.2765314246890564e-14;
bool r494098 = r494094 <= r494097;
double r494099 = !r494098;
bool r494100 = r494096 || r494099;
double r494101 = -1.0;
double r494102 = y;
double r494103 = r494101 * r494102;
double r494104 = exp(r494103);
double r494105 = r494104 / r494094;
double r494106 = exp(r494094);
double r494107 = r494094 + r494102;
double r494108 = r494094 / r494107;
double r494109 = log(r494108);
double r494110 = pow(r494106, r494109);
double r494111 = r494110 / r494094;
double r494112 = r494100 ? r494105 : r494111;
return r494112;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.9 |
|---|---|
| Target | 7.7 |
| Herbie | 0.7 |
if x < -1.5696397542027947e+112 or 5.2765314246890564e-14 < x Initial program 11.3
Taylor expanded around inf 0.6
if -1.5696397542027947e+112 < x < 5.2765314246890564e-14Initial program 10.6
rmApplied add-log-exp18.5
Applied exp-to-pow0.9
Final simplification0.7
herbie shell --seed 2020062
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
:precision binary64
:herbie-target
(if (< y -3.7311844206647956e+94) (/ (exp (/ -1 y)) x) (if (< y 2.817959242728288e+37) (/ (pow (/ x (+ y x)) x) x) (if (< y 2.347387415166998e+178) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1 y)) x))))
(/ (exp (* x (log (/ x (+ x y))))) x))