\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -338166549708266081878016:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{elif}\;x \le 5.105764663642184685065153471050791722519 \cdot 10^{-5}:\\
\;\;\;\;\frac{e^{x \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right)\right)}}{\frac{x}{e^{\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y + x}}\right) \cdot x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}double f(double x, double y) {
double r17220915 = x;
double r17220916 = y;
double r17220917 = r17220915 + r17220916;
double r17220918 = r17220915 / r17220917;
double r17220919 = log(r17220918);
double r17220920 = r17220915 * r17220919;
double r17220921 = exp(r17220920);
double r17220922 = r17220921 / r17220915;
return r17220922;
}
double f(double x, double y) {
double r17220923 = x;
double r17220924 = -3.381665497082661e+23;
bool r17220925 = r17220923 <= r17220924;
double r17220926 = y;
double r17220927 = -r17220926;
double r17220928 = exp(r17220927);
double r17220929 = r17220928 / r17220923;
double r17220930 = 5.105764663642185e-05;
bool r17220931 = r17220923 <= r17220930;
double r17220932 = cbrt(r17220923);
double r17220933 = r17220926 + r17220923;
double r17220934 = cbrt(r17220933);
double r17220935 = r17220932 / r17220934;
double r17220936 = log(r17220935);
double r17220937 = r17220936 + r17220936;
double r17220938 = r17220923 * r17220937;
double r17220939 = exp(r17220938);
double r17220940 = r17220936 * r17220923;
double r17220941 = exp(r17220940);
double r17220942 = r17220923 / r17220941;
double r17220943 = r17220939 / r17220942;
double r17220944 = r17220931 ? r17220943 : r17220929;
double r17220945 = r17220925 ? r17220929 : r17220944;
return r17220945;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.6 |
|---|---|
| Target | 8.2 |
| Herbie | 0.2 |
if x < -3.381665497082661e+23 or 5.105764663642185e-05 < x Initial program 11.6
Taylor expanded around inf 0.3
Simplified0.3
if -3.381665497082661e+23 < x < 5.105764663642185e-05Initial program 11.6
rmApplied add-cube-cbrt12.4
Applied add-cube-cbrt11.6
Applied times-frac11.6
Applied log-prod2.3
Applied distribute-rgt-in2.3
Applied exp-sum2.3
Applied associate-/l*2.3
rmApplied times-frac2.3
Applied log-prod0.1
Final simplification0.2
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
: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))