\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -338166549708266081878016 \lor \neg \left(x \le 5.105764663642184685065153471050791722519 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}{\frac{x}{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)}^{x}}}\\
\end{array}double f(double x, double y) {
double r270185 = x;
double r270186 = y;
double r270187 = r270185 + r270186;
double r270188 = r270185 / r270187;
double r270189 = log(r270188);
double r270190 = r270185 * r270189;
double r270191 = exp(r270190);
double r270192 = r270191 / r270185;
return r270192;
}
double f(double x, double y) {
double r270193 = x;
double r270194 = -3.381665497082661e+23;
bool r270195 = r270193 <= r270194;
double r270196 = 5.105764663642185e-05;
bool r270197 = r270193 <= r270196;
double r270198 = !r270197;
bool r270199 = r270195 || r270198;
double r270200 = y;
double r270201 = -r270200;
double r270202 = exp(r270201);
double r270203 = r270202 / r270193;
double r270204 = cbrt(r270193);
double r270205 = r270200 + r270193;
double r270206 = cbrt(r270205);
double r270207 = r270204 / r270206;
double r270208 = pow(r270207, r270193);
double r270209 = r270208 * r270208;
double r270210 = r270193 / r270208;
double r270211 = r270209 / r270210;
double r270212 = r270199 ? r270203 : r270211;
return r270212;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.6 |
|---|---|
| Target | 8.2 |
| Herbie | 0.2 |
if x < -3.381665497082661e+23 or 5.105764663642185e-05 < x Initial program 11.6
Simplified11.6
Taylor expanded around inf 0.3
if -3.381665497082661e+23 < x < 5.105764663642185e-05Initial program 11.6
Simplified11.6
rmApplied add-cube-cbrt12.4
Applied add-cube-cbrt11.6
Applied times-frac11.6
Applied unpow-prod-down2.3
Applied associate-/l*2.3
Simplified2.3
rmApplied times-frac2.3
Applied unpow-prod-down0.1
Simplified0.1
Simplified0.1
Final simplification0.2
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
:herbie-target
(if (< y -3.7311844206647956e+94) (/ (exp (/ -1.0 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.0 y)) x))))
(/ (exp (* x (log (/ x (+ x y))))) x))