\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -3.98796217281238501 \cdot 10^{42}:\\
\;\;\;\;\frac{1}{e^{y} \cdot x}\\
\mathbf{elif}\;x \le 6065.9896509303089:\\
\;\;\;\;\frac{e^{\left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) \cdot 2\right) \cdot x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}double f(double x, double y) {
double r328933 = x;
double r328934 = y;
double r328935 = r328933 + r328934;
double r328936 = r328933 / r328935;
double r328937 = log(r328936);
double r328938 = r328933 * r328937;
double r328939 = exp(r328938);
double r328940 = r328939 / r328933;
return r328940;
}
double f(double x, double y) {
double r328941 = x;
double r328942 = -3.987962172812385e+42;
bool r328943 = r328941 <= r328942;
double r328944 = 1.0;
double r328945 = y;
double r328946 = exp(r328945);
double r328947 = r328946 * r328941;
double r328948 = r328944 / r328947;
double r328949 = 6065.989650930309;
bool r328950 = r328941 <= r328949;
double r328951 = cbrt(r328941);
double r328952 = r328941 + r328945;
double r328953 = cbrt(r328952);
double r328954 = r328951 / r328953;
double r328955 = log(r328954);
double r328956 = 2.0;
double r328957 = r328955 * r328956;
double r328958 = r328957 * r328941;
double r328959 = exp(r328958);
double r328960 = pow(r328954, r328941);
double r328961 = r328959 * r328960;
double r328962 = r328961 / r328941;
double r328963 = -r328945;
double r328964 = exp(r328963);
double r328965 = r328964 / r328941;
double r328966 = r328950 ? r328962 : r328965;
double r328967 = r328943 ? r328948 : r328966;
return r328967;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.2 |
|---|---|
| Target | 8.0 |
| Herbie | 0.1 |
if x < -3.987962172812385e+42Initial program 14.1
Simplified14.1
Taylor expanded around inf 0.0
rmApplied clear-num0.1
Simplified0.1
if -3.987962172812385e+42 < x < 6065.989650930309Initial program 10.6
Simplified10.6
rmApplied add-cube-cbrt12.9
Applied add-cube-cbrt10.6
Applied times-frac10.6
Applied unpow-prod-down2.5
rmApplied add-exp-log35.3
Applied add-exp-log35.3
Applied prod-exp35.3
Applied add-exp-log35.3
Applied add-exp-log35.3
Applied prod-exp35.3
Applied div-exp35.3
Applied pow-exp34.1
Simplified0.1
if 6065.989650930309 < x Initial program 10.3
Simplified10.3
Taylor expanded around inf 0.0
Final simplification0.1
herbie shell --seed 2020045
(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))