\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -338166549708266081878016:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{elif}\;x \le 5.105764663642184685065153471050791722519 \cdot 10^{-5}:\\
\;\;\;\;\frac{e^{\left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) \cdot x}}{\frac{x}{e^{\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}double f(double x, double y) {
double r28608392 = x;
double r28608393 = y;
double r28608394 = r28608392 + r28608393;
double r28608395 = r28608392 / r28608394;
double r28608396 = log(r28608395);
double r28608397 = r28608392 * r28608396;
double r28608398 = exp(r28608397);
double r28608399 = r28608398 / r28608392;
return r28608399;
}
double f(double x, double y) {
double r28608400 = x;
double r28608401 = -3.381665497082661e+23;
bool r28608402 = r28608400 <= r28608401;
double r28608403 = y;
double r28608404 = -r28608403;
double r28608405 = exp(r28608404);
double r28608406 = r28608405 / r28608400;
double r28608407 = 5.105764663642185e-05;
bool r28608408 = r28608400 <= r28608407;
double r28608409 = cbrt(r28608400);
double r28608410 = r28608400 + r28608403;
double r28608411 = cbrt(r28608410);
double r28608412 = r28608409 / r28608411;
double r28608413 = log(r28608412);
double r28608414 = r28608413 + r28608413;
double r28608415 = r28608414 * r28608400;
double r28608416 = exp(r28608415);
double r28608417 = r28608413 * r28608400;
double r28608418 = exp(r28608417);
double r28608419 = r28608400 / r28608418;
double r28608420 = r28608416 / r28608419;
double r28608421 = r28608408 ? r28608420 : r28608406;
double r28608422 = r28608402 ? r28608406 : r28608421;
return r28608422;
}




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
Taylor expanded around inf 0.3
Simplified0.3
if -3.381665497082661e+23 < x < 5.105764663642185e-05Initial program 11.6
rmApplied add-cube-cbrt12.4
Applied add-cube-cbrt11.6
Applied times-frac11.6
Applied log-prod2.3
Applied distribute-rgt-in2.3
Applied exp-sum2.3
Applied associate-/l*2.3
rmApplied times-frac2.3
Applied log-prod0.1
Final simplification0.2
herbie shell --seed 2019174
(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))