\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -4.10763764017422015 \cdot 10^{39}:\\
\;\;\;\;e^{-1 \cdot y} \cdot \frac{1}{x}\\
\mathbf{elif}\;x \le 2.15287488429506049 \cdot 10^{-5}:\\
\;\;\;\;\frac{{\left(\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\
\end{array}double code(double x, double y) {
return (exp((x * log((x / (x + y))))) / x);
}
double code(double x, double y) {
double VAR;
if ((x <= -4.10763764017422e+39)) {
VAR = (exp((-1.0 * y)) * (1.0 / x));
} else {
double VAR_1;
if ((x <= 2.1528748842950605e-05)) {
VAR_1 = ((pow(((cbrt(x) * cbrt(x)) / (cbrt((x + y)) * cbrt((x + y)))), x) * pow((cbrt(x) / cbrt((x + y))), x)) / x);
} else {
VAR_1 = (exp((-1.0 * y)) / x);
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.8 |
|---|---|
| Target | 7.9 |
| Herbie | 1.2 |
if x < -4.10763764017422e+39Initial program 12.8
Simplified12.8
Taylor expanded around inf 0.0
Simplified0.0
rmApplied div-inv0.0
if -4.10763764017422e+39 < x < 2.1528748842950605e-05Initial program 10.8
Simplified10.8
rmApplied add-cube-cbrt12.9
Applied add-cube-cbrt10.8
Applied times-frac10.8
Applied unpow-prod-down2.0
if 2.1528748842950605e-05 < x Initial program 9.4
Simplified9.4
Taylor expanded around inf 0.5
Simplified0.5
Final simplification1.2
herbie shell --seed 2020079 +o rules:numerics
(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 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 y)) x))))
(/ (exp (* x (log (/ x (+ x y))))) x))