\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \leq -6.463475984187357 \cdot 10^{+161}:\\
\;\;\;\;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 317.3168173800605:\\
\;\;\;\;{\left(\sqrt[3]{\frac{x}{y + x}} \cdot \sqrt[3]{\frac{x}{y + x}}\right)}^{x} \cdot \frac{{\left(\sqrt[3]{\frac{x}{y + x}}\right)}^{x}}{x}\\
\mathbf{elif}\;y \leq 2.397614431801766 \cdot 10^{+48} \lor \neg \left(y \leq 3.2195260757207784 \cdot 10^{+85}\right) \land y \leq 3.955643581924325 \cdot 10^{+113}:\\
\;\;\;\;\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}(FPCore (x y) :precision binary64 (/ (exp (* x (log (/ x (+ x y))))) x))
(FPCore (x y)
:precision binary64
(if (<= y -6.463475984187357e+161)
(+
(*
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 317.3168173800605)
(*
(pow (* (cbrt (/ x (+ y x))) (cbrt (/ x (+ y x)))) x)
(/ (pow (cbrt (/ x (+ y x))) x) x))
(if (or (<= y 2.397614431801766e+48)
(and (not (<= y 3.2195260757207784e+85))
(<= y 3.955643581924325e+113)))
(log (exp (/ (pow (/ x (+ y x)) x) x)))
(/
(*
(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 tmp;
if ((y <= -6.463475984187357e+161)) {
tmp = ((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 tmp_1;
if ((y <= 317.3168173800605)) {
tmp_1 = ((double) (((double) pow(((double) (((double) cbrt((x / ((double) (y + x))))) * ((double) cbrt((x / ((double) (y + x))))))), x)) * (((double) pow(((double) cbrt((x / ((double) (y + x))))), x)) / x)));
} else {
double tmp_2;
if (((y <= 2.397614431801766e+48) || (!(y <= 3.2195260757207784e+85) && (y <= 3.955643581924325e+113)))) {
tmp_2 = ((double) log(((double) exp((((double) pow((x / ((double) (y + x))), x)) / x)))));
} else {
tmp_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);
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.9 |
|---|---|
| Target | 7.9 |
| Herbie | 5.9 |
if y < -6.4634759841873574e161Initial program Error: 44.0 bits
SimplifiedError: 44.0 bits
Taylor expanded around -inf Error: 0.0 bits
SimplifiedError: 0.0 bits
if -6.4634759841873574e161 < y < 317.316817380060513Initial program Error: 1.8 bits
SimplifiedError: 1.8 bits
rmApplied *-un-lft-identityError: 1.8 bits
Applied add-cube-cbrtError: 1.8 bits
Applied unpow-prod-downError: 1.8 bits
Applied times-fracError: 1.8 bits
SimplifiedError: 1.8 bits
if 317.316817380060513 < y < 2.39761443180176605e48 or 3.2195260757207784e85 < y < 3.95564358192432533e113Initial program Error: 35.8 bits
SimplifiedError: 35.8 bits
rmApplied add-log-expError: 22.1 bits
if 2.39761443180176605e48 < y < 3.2195260757207784e85 or 3.95564358192432533e113 < y Initial program Error: 30.6 bits
SimplifiedError: 30.5 bits
rmApplied add-sqr-sqrtError: 30.5 bits
Applied add-sqr-sqrtError: 32.6 bits
Applied times-fracError: 32.6 bits
Applied unpow-prod-downError: 18.8 bits
Final simplificationError: 5.9 bits
herbie shell --seed 2020204
(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))