\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \leq -2.7506651735342347 \cdot 10^{+132}:\\
\;\;\;\;0.5 \cdot \left(\frac{{\left(-x\right)}^{x} \cdot {\left(\frac{-1}{y}\right)}^{x}}{y \cdot y} \cdot \left(x \cdot x + {x}^{3}\right)\right) + \left(\frac{{\left(-x\right)}^{x} \cdot {\left(\frac{-1}{y}\right)}^{x}}{x} - x \cdot \frac{{\left(-x\right)}^{x} \cdot {\left(\frac{-1}{y}\right)}^{x}}{y}\right)\\
\mathbf{elif}\;y \leq 7.745671602444141 \cdot 10^{+18}:\\
\;\;\;\;\frac{1}{\frac{x}{{\left(\frac{x}{y + x}\right)}^{x}}}\\
\mathbf{elif}\;y \leq 1.2585632689113307 \cdot 10^{+119}:\\
\;\;\;\;\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 <= -2.7506651735342347e+132)) {
VAR = ((double) (((double) (0.5 * ((double) ((((double) (((double) pow(((double) -(x)), x)) * ((double) pow((-1.0 / y), x)))) / ((double) (y * y))) * ((double) (((double) (x * x)) + ((double) pow(x, 3.0)))))))) + ((double) ((((double) (((double) pow(((double) -(x)), x)) * ((double) pow((-1.0 / y), x)))) / x) - ((double) (x * (((double) (((double) pow(((double) -(x)), x)) * ((double) pow((-1.0 / y), x)))) / y)))))));
} else {
double VAR_1;
if ((y <= 7.745671602444141e+18)) {
VAR_1 = (1.0 / (x / ((double) pow((x / ((double) (y + x))), x))));
} else {
double VAR_2;
if ((y <= 1.2585632689113307e+119)) {
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 | 7.9 |
| Herbie | 5.8 |
if y < -2.7506651735342347e132Initial program Error: 44.3 bits
SimplifiedError: 44.3 bits
Taylor expanded around -inf Error: 0.1 bits
SimplifiedError: 0.0 bits
if -2.7506651735342347e132 < y < 7745671602444141000Initial program Error: 2.4 bits
SimplifiedError: 2.4 bits
rmApplied clear-numError: 2.4 bits
if 7745671602444141000 < y < 1.25856326891133072e119Initial program Error: 35.9 bits
SimplifiedError: 35.9 bits
rmApplied add-log-expError: 20.9 bits
if 1.25856326891133072e119 < y Initial program Error: 31.3 bits
SimplifiedError: 31.3 bits
rmApplied add-sqr-sqrtError: 31.4 bits
Applied add-sqr-sqrtError: 33.1 bits
Applied times-fracError: 33.1 bits
Applied unpow-prod-downError: 16.0 bits
Final simplificationError: 5.8 bits
herbie shell --seed 2020200
(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))