\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -1.474949217478339:\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\mathbf{elif}\;x \le 9.66028324651152026:\\
\;\;\;\;\frac{{\left(\frac{1}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}}\right)}^{x} \cdot {\left(\frac{x}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{1}{e^{y}}\\
\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 ((x <= -1.474949217478339)) {
VAR = ((double) (1.0 / ((double) (x * ((double) exp(y))))));
} else {
double VAR_1;
if ((x <= 9.66028324651152)) {
VAR_1 = ((double) (((double) (((double) pow(((double) (1.0 / ((double) (((double) cbrt(((double) (x + y)))) * ((double) cbrt(((double) (x + y)))))))), x)) * ((double) pow(((double) (x / ((double) cbrt(((double) (x + y)))))), x)))) / x));
} else {
VAR_1 = ((double) (((double) (1.0 / x)) * ((double) (1.0 / ((double) exp(y))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.3 |
|---|---|
| Target | 7.9 |
| Herbie | 1.4 |
if x < -1.474949217478339Initial program 10.8
Simplified10.8
Taylor expanded around inf 0.1
Simplified0.1
rmApplied clear-num0.1
Simplified0.1
if -1.474949217478339 < x < 9.66028324651152Initial program 11.7
Simplified11.6
rmApplied add-cube-cbrt11.6
Applied *-un-lft-identity11.6
Applied times-frac11.6
Applied unpow-prod-down2.9
if 9.66028324651152 < x Initial program 11.2
Simplified11.2
Taylor expanded around inf 0.0
Simplified0.0
rmApplied clear-num0.0
Simplified0.0
rmApplied add-cube-cbrt0.0
Applied times-frac0.0
Simplified0.0
Simplified0.0
Final simplification1.4
herbie shell --seed 2020124
(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))