\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \le -2.5267709347995916 \cdot 10^{46}:\\
\;\;\;\;\frac{1}{2} \cdot \left(\frac{e^{x \cdot \left(\log \left(-1 \cdot x\right) + \log \left(\frac{-1}{y}\right)\right)} \cdot {x}^{2}}{{y}^{2}} + \frac{e^{x \cdot \left(\log \left(-1 \cdot x\right) + \log \left(\frac{-1}{y}\right)\right)} \cdot {x}^{3}}{{y}^{2}}\right) + \left(\frac{e^{x \cdot \left(\log \left(-1 \cdot x\right) + \log \left(\frac{-1}{y}\right)\right)}}{x} - \frac{e^{x \cdot \left(\log \left(-1 \cdot x\right) + \log \left(\frac{-1}{y}\right)\right)} \cdot x}{y}\right)\\
\mathbf{elif}\;y \le 4.1436239237094987 \cdot 10^{37}:\\
\;\;\;\;{\left(\sqrt[3]{\frac{x}{x + y}} \cdot \sqrt[3]{\frac{x}{x + y}}\right)}^{x} \cdot \frac{{\left(\sqrt[3]{\frac{x}{x + y}}\right)}^{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{\sqrt{x}}{\sqrt{x + y}}\right)}^{x} \cdot {\left(\frac{\sqrt{x}}{\sqrt{x + y}}\right)}^{x}}{x}\\
\end{array}double code(double x, double y) {
return ((double) (((double) exp(((double) (x * ((double) log(((double) (x / ((double) (x + y)))))))))) / x));
}
double code(double x, double y) {
double VAR;
if ((y <= -2.5267709347995916e+46)) {
VAR = ((double) (((double) (0.5 * ((double) (((double) (((double) (((double) exp(((double) (x * ((double) (((double) log(((double) (-1.0 * x)))) + ((double) log(((double) (-1.0 / y)))))))))) * ((double) pow(x, 2.0)))) / ((double) pow(y, 2.0)))) + ((double) (((double) (((double) exp(((double) (x * ((double) (((double) log(((double) (-1.0 * x)))) + ((double) log(((double) (-1.0 / y)))))))))) * ((double) pow(x, 3.0)))) / ((double) pow(y, 2.0)))))))) + ((double) (((double) (((double) exp(((double) (x * ((double) (((double) log(((double) (-1.0 * x)))) + ((double) log(((double) (-1.0 / y)))))))))) / x)) - ((double) (((double) (((double) exp(((double) (x * ((double) (((double) log(((double) (-1.0 * x)))) + ((double) log(((double) (-1.0 / y)))))))))) * x)) / y))))));
} else {
double VAR_1;
if ((y <= 4.1436239237094987e+37)) {
VAR_1 = ((double) (((double) pow(((double) (((double) cbrt(((double) (x / ((double) (x + y)))))) * ((double) cbrt(((double) (x / ((double) (x + y)))))))), x)) * ((double) (((double) pow(((double) cbrt(((double) (x / ((double) (x + y)))))), x)) / x))));
} else {
VAR_1 = ((double) (((double) (((double) pow(((double) (((double) sqrt(x)) / ((double) sqrt(((double) (x + y)))))), x)) * ((double) pow(((double) (((double) sqrt(x)) / ((double) sqrt(((double) (x + y)))))), x)))) / x));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.4 |
|---|---|
| Target | 8.0 |
| Herbie | 6.3 |
if y < -2.5267709347995916e46Initial program 34.1
Simplified34.1
Taylor expanded around -inf 0.0
Simplified0.0
if -2.5267709347995916e46 < y < 4.1436239237094987e37Initial program 2.7
Simplified2.7
rmApplied *-un-lft-identity2.7
Applied add-cube-cbrt2.7
Applied unpow-prod-down2.7
Applied times-frac2.7
Simplified2.7
if 4.1436239237094987e37 < y Initial program 32.7
Simplified32.7
rmApplied add-sqr-sqrt32.6
Applied add-sqr-sqrt34.7
Applied times-frac34.7
Applied unpow-prod-down21.3
Final simplification6.3
herbie shell --seed 2020149
(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.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))