\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \le 167.998095920773977:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{x}\\
\mathbf{elif}\;y \le 1.41249639531232003 \cdot 10^{87}:\\
\;\;\;\;\frac{e^{x \cdot \log \left(\frac{1}{\sqrt[3]{x + y} \cdot \sqrt[3]{x + y}} \cdot \frac{x}{\sqrt[3]{x + y}}\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x}\right)\right)}{\sqrt[3]{x + y}}\right)\right)}}{x}\\
\end{array}double f(double x, double y) {
double r394889 = x;
double r394890 = y;
double r394891 = r394889 + r394890;
double r394892 = r394889 / r394891;
double r394893 = log(r394892);
double r394894 = r394889 * r394893;
double r394895 = exp(r394894);
double r394896 = r394895 / r394889;
return r394896;
}
double f(double x, double y) {
double r394897 = y;
double r394898 = 167.99809592077398;
bool r394899 = r394897 <= r394898;
double r394900 = x;
double r394901 = 2.0;
double r394902 = cbrt(r394900);
double r394903 = r394900 + r394897;
double r394904 = cbrt(r394903);
double r394905 = r394902 / r394904;
double r394906 = log(r394905);
double r394907 = r394901 * r394906;
double r394908 = r394907 + r394906;
double r394909 = r394900 * r394908;
double r394910 = exp(r394909);
double r394911 = r394910 / r394900;
double r394912 = 1.41249639531232e+87;
bool r394913 = r394897 <= r394912;
double r394914 = 1.0;
double r394915 = r394904 * r394904;
double r394916 = r394914 / r394915;
double r394917 = r394900 / r394904;
double r394918 = r394916 * r394917;
double r394919 = log(r394918);
double r394920 = r394900 * r394919;
double r394921 = exp(r394920);
double r394922 = r394921 / r394900;
double r394923 = log1p(r394902);
double r394924 = expm1(r394923);
double r394925 = r394924 / r394904;
double r394926 = log(r394925);
double r394927 = r394907 + r394926;
double r394928 = r394900 * r394927;
double r394929 = exp(r394928);
double r394930 = r394929 / r394900;
double r394931 = r394913 ? r394922 : r394930;
double r394932 = r394899 ? r394911 : r394931;
return r394932;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.3 |
|---|---|
| Target | 8.4 |
| Herbie | 4.9 |
if y < 167.99809592077398Initial program 4.5
rmApplied add-cube-cbrt29.6
Applied add-cube-cbrt4.5
Applied times-frac4.5
Applied log-prod1.6
Simplified0.9
if 167.99809592077398 < y < 1.41249639531232e+87Initial program 37.3
rmApplied add-cube-cbrt24.8
Applied *-un-lft-identity24.8
Applied times-frac25.2
if 1.41249639531232e+87 < y Initial program 30.1
rmApplied add-cube-cbrt25.1
Applied add-cube-cbrt30.2
Applied times-frac30.2
Applied log-prod17.3
Simplified14.4
rmApplied expm1-log1p-u13.9
Final simplification4.9
herbie shell --seed 2020025 +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))