\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -5.86066198976175052 \cdot 10^{64}:\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\
\mathbf{elif}\;x \le 0.0010876143661975072:\\
\;\;\;\;e^{\left(x \cdot 2\right) \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\end{array}double f(double x, double y) {
double r633401 = x;
double r633402 = y;
double r633403 = r633401 + r633402;
double r633404 = r633401 / r633403;
double r633405 = log(r633404);
double r633406 = r633401 * r633405;
double r633407 = exp(r633406);
double r633408 = r633407 / r633401;
return r633408;
}
double f(double x, double y) {
double r633409 = x;
double r633410 = -5.86066198976175e+64;
bool r633411 = r633409 <= r633410;
double r633412 = -1.0;
double r633413 = y;
double r633414 = r633412 * r633413;
double r633415 = exp(r633414);
double r633416 = r633415 / r633409;
double r633417 = 0.0010876143661975072;
bool r633418 = r633409 <= r633417;
double r633419 = 2.0;
double r633420 = r633409 * r633419;
double r633421 = cbrt(r633409);
double r633422 = r633409 + r633413;
double r633423 = cbrt(r633422);
double r633424 = r633421 / r633423;
double r633425 = log(r633424);
double r633426 = r633420 * r633425;
double r633427 = exp(r633426);
double r633428 = pow(r633424, r633409);
double r633429 = r633428 / r633409;
double r633430 = r633427 * r633429;
double r633431 = 1.0;
double r633432 = exp(r633413);
double r633433 = r633409 * r633432;
double r633434 = r633431 / r633433;
double r633435 = r633418 ? r633430 : r633434;
double r633436 = r633411 ? r633416 : r633435;
return r633436;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.4 |
|---|---|
| Target | 8.5 |
| Herbie | 0.3 |
if x < -5.86066198976175e+64Initial program 14.8
Simplified14.8
Taylor expanded around inf 0.0
Simplified0.0
if -5.86066198976175e+64 < x < 0.0010876143661975072Initial program 10.6
Simplified10.6
rmApplied *-un-lft-identity10.6
Applied add-cube-cbrt13.7
Applied add-cube-cbrt10.7
Applied times-frac10.7
Applied unpow-prod-down2.5
Applied times-frac2.5
Simplified2.5
rmApplied add-exp-log35.8
Applied add-exp-log35.8
Applied prod-exp35.8
Applied add-exp-log35.8
Applied add-exp-log35.8
Applied prod-exp35.8
Applied div-exp35.8
Applied pow-exp34.8
Simplified0.4
if 0.0010876143661975072 < x Initial program 10.3
Simplified10.3
Taylor expanded around inf 0.3
Simplified0.3
rmApplied clear-num0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020034 +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))