\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 r418593 = x;
double r418594 = y;
double r418595 = r418593 + r418594;
double r418596 = r418593 / r418595;
double r418597 = log(r418596);
double r418598 = r418593 * r418597;
double r418599 = exp(r418598);
double r418600 = r418599 / r418593;
return r418600;
}
double f(double x, double y) {
double r418601 = x;
double r418602 = -1.5696397542027947e+112;
bool r418603 = r418601 <= r418602;
double r418604 = 5.2765314246890564e-14;
bool r418605 = r418601 <= r418604;
double r418606 = !r418605;
bool r418607 = r418603 || r418606;
double r418608 = -1.0;
double r418609 = y;
double r418610 = r418608 * r418609;
double r418611 = exp(r418610);
double r418612 = r418611 / r418601;
double r418613 = exp(r418601);
double r418614 = r418601 + r418609;
double r418615 = r418601 / r418614;
double r418616 = log(r418615);
double r418617 = pow(r418613, r418616);
double r418618 = r418617 / r418601;
double r418619 = r418607 ? r418612 : r418618;
return r418619;
}




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 +o rules:numerics
(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))