\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -1.81817434923962274 \cdot 10^{140} \lor \neg \left(x \le 5.23835627656106507 \cdot 10^{-4}\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\
\end{array}double f(double x, double y) {
double r513688 = x;
double r513689 = y;
double r513690 = r513688 + r513689;
double r513691 = r513688 / r513690;
double r513692 = log(r513691);
double r513693 = r513688 * r513692;
double r513694 = exp(r513693);
double r513695 = r513694 / r513688;
return r513695;
}
double f(double x, double y) {
double r513696 = x;
double r513697 = -1.8181743492396227e+140;
bool r513698 = r513696 <= r513697;
double r513699 = 0.0005238356276561065;
bool r513700 = r513696 <= r513699;
double r513701 = !r513700;
bool r513702 = r513698 || r513701;
double r513703 = y;
double r513704 = -r513703;
double r513705 = exp(r513704);
double r513706 = r513705 / r513696;
double r513707 = 2.0;
double r513708 = cbrt(r513696);
double r513709 = r513696 + r513703;
double r513710 = cbrt(r513709);
double r513711 = r513708 / r513710;
double r513712 = log(r513711);
double r513713 = r513707 * r513712;
double r513714 = r513696 * r513713;
double r513715 = exp(r513714);
double r513716 = pow(r513711, r513696);
double r513717 = r513715 * r513716;
double r513718 = r513717 / r513696;
double r513719 = r513702 ? r513706 : r513718;
return r513719;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.2 |
|---|---|
| Target | 7.6 |
| Herbie | 0.7 |
if x < -1.8181743492396227e+140 or 0.0005238356276561065 < x Initial program 12.0
Simplified12.0
Taylor expanded around inf 0.2
if -1.8181743492396227e+140 < x < 0.0005238356276561065Initial program 10.5
Simplified10.5
rmApplied add-cube-cbrt17.5
Applied add-cube-cbrt10.5
Applied times-frac10.5
Applied unpow-prod-down3.0
rmApplied add-exp-log38.2
Applied add-exp-log38.2
Applied prod-exp38.2
Applied add-exp-log38.2
Applied add-exp-log38.2
Applied prod-exp38.2
Applied div-exp38.2
Applied pow-exp37.3
Simplified1.0
Final simplification0.7
herbie shell --seed 2020046
(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))