\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \leq -1.1947019381196716 \cdot 10^{+74}:\\
\;\;\;\;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 1.9116918545050105 \cdot 10^{+20}:\\
\;\;\;\;\frac{\left(\left({\left(\sqrt{\left|\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right|}\right)}^{x} \cdot {\left(\sqrt{\left|\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right|}\right)}^{x}\right) \cdot {\left(\sqrt{\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}}\right)}^{x}\right) \cdot {\left(\frac{x}{y + x}\right)}^{\left(0.5 \cdot x\right)}}{x}\\
\mathbf{elif}\;y \leq 1.3882841915962162 \cdot 10^{+254}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{{\left(\frac{x}{y + x}\right)}^{x}}{x}\right)}^{3}}\\
\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}(FPCore (x y) :precision binary64 (/ (exp (* x (log (/ x (+ x y))))) x))
(FPCore (x y)
:precision binary64
(if (<= y -1.1947019381196716e+74)
(+
(*
0.5
(*
(/ (* (pow (- x) x) (pow (/ -1.0 y) x)) (* y y))
(+ (* x x) (pow x 3.0))))
(-
(/ (* (pow (- x) x) (pow (/ -1.0 y) x)) x)
(* x (/ (* (pow (- x) x) (pow (/ -1.0 y) x)) y))))
(if (<= y 1.9116918545050105e+20)
(/
(*
(*
(*
(pow (sqrt (fabs (/ (cbrt x) (cbrt (+ y x))))) x)
(pow (sqrt (fabs (/ (cbrt x) (cbrt (+ y x))))) x))
(pow (sqrt (/ (cbrt x) (cbrt (+ y x)))) x))
(pow (/ x (+ y x)) (* 0.5 x)))
x)
(if (<= y 1.3882841915962162e+254)
(cbrt (pow (/ (pow (/ x (+ y x)) x) x) 3.0))
(/
(*
(pow (/ (sqrt x) (sqrt (+ y x))) x)
(pow (/ (sqrt x) (sqrt (+ y x))) x))
x)))))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 <= -1.1947019381196716e+74)) {
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 <= 1.9116918545050105e+20)) {
VAR_1 = (((double) (((double) (((double) (((double) pow(((double) sqrt(((double) fabs((((double) cbrt(x)) / ((double) cbrt(((double) (y + x))))))))), x)) * ((double) pow(((double) sqrt(((double) fabs((((double) cbrt(x)) / ((double) cbrt(((double) (y + x))))))))), x)))) * ((double) pow(((double) sqrt((((double) cbrt(x)) / ((double) cbrt(((double) (y + x))))))), x)))) * ((double) pow((x / ((double) (y + x))), ((double) (0.5 * x)))))) / x);
} else {
double VAR_2;
if ((y <= 1.3882841915962162e+254)) {
VAR_2 = ((double) cbrt(((double) pow((((double) pow((x / ((double) (y + x))), x)) / x), 3.0))));
} 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.1 |
|---|---|
| Target | 7.7 |
| Herbie | 5.1 |
if y < -1.19470193811967162e74Initial program 37.5
Simplified37.5
Taylor expanded around -inf 0.0
Simplified0.0
if -1.19470193811967162e74 < y < 191169185450501046000Initial program 2.1
Simplified2.1
rmApplied add-sqr-sqrt2.1
Applied unpow-prod-down2.1
rmApplied pow1/22.1
Applied pow-pow2.1
Simplified2.1
rmApplied add-cube-cbrt22.4
Applied add-cube-cbrt2.1
Applied times-frac2.1
Applied sqrt-prod2.1
Applied unpow-prod-down2.1
Simplified2.1
rmApplied add-sqr-sqrt2.1
Applied unpow-prod-down2.1
if 191169185450501046000 < y < 1.3882841915962162e254Initial program 33.0
Simplified33.0
rmApplied add-cbrt-cube18.7
Applied add-cbrt-cube18.7
Applied cbrt-undiv19.1
Simplified19.2
if 1.3882841915962162e254 < y Initial program 29.3
Simplified29.3
rmApplied add-sqr-sqrt30.1
Applied add-sqr-sqrt30.0
Applied times-frac30.0
Applied unpow-prod-down4.1
Final simplification5.1
herbie shell --seed 2020198
(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))