\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -1.533037271626305145606026058479633661489 \cdot 10^{101} \lor \neg \left(x \le 3.231969950629079146503457545048729169032 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) \cdot x} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\
\end{array}double f(double x, double y) {
double r388870 = x;
double r388871 = y;
double r388872 = r388870 + r388871;
double r388873 = r388870 / r388872;
double r388874 = log(r388873);
double r388875 = r388870 * r388874;
double r388876 = exp(r388875);
double r388877 = r388876 / r388870;
return r388877;
}
double f(double x, double y) {
double r388878 = x;
double r388879 = -1.533037271626305e+101;
bool r388880 = r388878 <= r388879;
double r388881 = 3.231969950629079e-16;
bool r388882 = r388878 <= r388881;
double r388883 = !r388882;
bool r388884 = r388880 || r388883;
double r388885 = -1.0;
double r388886 = y;
double r388887 = r388885 * r388886;
double r388888 = exp(r388887);
double r388889 = r388888 / r388878;
double r388890 = 2.0;
double r388891 = cbrt(r388878);
double r388892 = r388878 + r388886;
double r388893 = cbrt(r388892);
double r388894 = r388891 / r388893;
double r388895 = log(r388894);
double r388896 = r388890 * r388895;
double r388897 = r388896 * r388878;
double r388898 = exp(r388897);
double r388899 = pow(r388894, r388878);
double r388900 = r388898 * r388899;
double r388901 = r388900 / r388878;
double r388902 = r388884 ? r388889 : r388901;
return r388902;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.9 |
|---|---|
| Target | 7.7 |
| Herbie | 0.6 |
if x < -1.533037271626305e+101 or 3.231969950629079e-16 < x Initial program 10.9
Simplified10.9
Taylor expanded around inf 0.7
Simplified0.7
if -1.533037271626305e+101 < x < 3.231969950629079e-16Initial program 10.9
Simplified10.9
rmApplied add-cube-cbrt15.9
Applied add-cube-cbrt10.9
Applied times-frac10.9
Applied unpow-prod-down2.7
rmApplied add-exp-log38.6
Applied add-exp-log38.6
Applied prod-exp38.6
Applied add-exp-log38.6
Applied add-exp-log38.6
Applied prod-exp38.6
Applied div-exp38.6
Applied pow-exp37.4
Simplified0.4
Final simplification0.6
herbie shell --seed 2020001 +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))