\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \leq -5.949766666727802 \cdot 10^{+125}:\\
\;\;\;\;\frac{{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{y + x}\right)}^{x}}{x}\\
\mathbf{elif}\;y \leq 2.5297358828475472 \cdot 10^{+17}:\\
\;\;\;\;\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\\
\mathbf{elif}\;y \leq 2.7087781073527612 \cdot 10^{+166}:\\
\;\;\;\;\log \left(e^{\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{\sqrt{x}}{\sqrt{y + x}}\right)}^{x} \cdot {\left(\frac{\sqrt{x}}{\sqrt{y + x}}\right)}^{x}}{x}\\
\end{array}double code(double x, double y) {
return (((double) exp(((double) (x * ((double) log((x / ((double) (x + y))))))))) / x);
}
double code(double x, double y) {
double VAR;
if ((y <= -5.949766666727802e+125)) {
VAR = (((double) (((double) pow(((double) (((double) cbrt(x)) * ((double) cbrt(x)))), x)) * ((double) pow((((double) cbrt(x)) / ((double) (y + x))), x)))) / x);
} else {
double VAR_1;
if ((y <= 2.5297358828475472e+17)) {
VAR_1 = (((double) pow((x / ((double) (y + x))), x)) / x);
} else {
double VAR_2;
if ((y <= 2.7087781073527612e+166)) {
VAR_2 = ((double) log(((double) exp((((double) pow((x / ((double) (y + x))), x)) / x)))));
} else {
VAR_2 = (((double) (((double) pow((((double) sqrt(x)) / ((double) sqrt(((double) (y + x))))), x)) * ((double) pow((((double) sqrt(x)) / ((double) sqrt(((double) (y + x))))), x)))) / x);
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.5 |
|---|---|
| Target | 8.0 |
| Herbie | 6.4 |
if y < -5.94976666672780219e125Initial program 42.5
Simplified42.5
rmApplied *-un-lft-identity42.5
Applied add-cube-cbrt42.5
Applied times-frac42.5
Applied unpow-prod-down11.6
Simplified11.6
if -5.94976666672780219e125 < y < 252973588284754720Initial program 2.3
Simplified2.3
if 252973588284754720 < y < 2.7087781073527612e166Initial program 35.9
Simplified35.9
rmApplied add-log-exp23.5
if 2.7087781073527612e166 < y Initial program 28.5
Simplified28.5
rmApplied add-sqr-sqrt29.5
Applied add-sqr-sqrt30.3
Applied times-frac30.3
Applied unpow-prod-down10.6
Final simplification6.4
herbie shell --seed 2020199
(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))