\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \le -7.472833578446224 \cdot 10^{140}:\\
\;\;\;\;\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 2878.0393812193179:\\
\;\;\;\;\frac{1}{\frac{x}{{\left(\frac{x}{x + y}\right)}^{x}}}\\
\mathbf{elif}\;y \le 7.53931162818783628 \cdot 10^{68}:\\
\;\;\;\;\log \left(e^{\frac{{\left(\frac{x}{x + y}\right)}^{x}}{x}}\right)\\
\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 <= -7.472833578446224e+140)) {
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 <= 2878.039381219318)) {
VAR_1 = ((double) (1.0 / ((double) (x / ((double) pow(((double) (x / ((double) (x + y)))), x))))));
} else {
double VAR_2;
if ((y <= 7.539311628187836e+68)) {
VAR_2 = ((double) log(((double) exp(((double) (((double) pow(((double) (x / ((double) (x + y)))), x)) / x))))));
} else {
VAR_2 = ((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_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.1 |
|---|---|
| Target | 8.0 |
| Herbie | 5.7 |
if y < -7.472833578446224e140Initial program 41.7
Simplified41.6
Taylor expanded around -inf 0.1
Simplified0.1
if -7.472833578446224e140 < y < 2878.0393812193179Initial program 1.5
Simplified1.5
rmApplied clear-num1.5
if 2878.0393812193179 < y < 7.53931162818783628e68Initial program 36.6
Simplified36.6
rmApplied add-log-exp21.9
if 7.53931162818783628e68 < y Initial program 31.6
Simplified31.6
rmApplied add-sqr-sqrt31.1
Applied add-sqr-sqrt33.5
Applied times-frac33.5
Applied unpow-prod-down18.9
Final simplification5.7
herbie shell --seed 2020147
(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))