\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \le 165.0208082342574869016971206292510032654:\\
\;\;\;\;\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 8.906285416665826287217678929131947523715 \cdot 10^{185}:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right) + \log \left(\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{x}\right)\right)}{\sqrt[3]{x + y}}\right)\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 r251024 = x;
double r251025 = y;
double r251026 = r251024 + r251025;
double r251027 = r251024 / r251026;
double r251028 = log(r251027);
double r251029 = r251024 * r251028;
double r251030 = exp(r251029);
double r251031 = r251030 / r251024;
return r251031;
}
double f(double x, double y) {
double r251032 = y;
double r251033 = 165.0208082342575;
bool r251034 = r251032 <= r251033;
double r251035 = x;
double r251036 = 2.0;
double r251037 = cbrt(r251035);
double r251038 = r251035 + r251032;
double r251039 = cbrt(r251038);
double r251040 = r251037 / r251039;
double r251041 = log(r251040);
double r251042 = r251036 * r251041;
double r251043 = r251042 + r251041;
double r251044 = r251035 * r251043;
double r251045 = exp(r251044);
double r251046 = r251045 / r251035;
double r251047 = 8.906285416665826e+185;
bool r251048 = r251032 <= r251047;
double r251049 = expm1(r251037);
double r251050 = log1p(r251049);
double r251051 = r251050 / r251039;
double r251052 = log(r251051);
double r251053 = r251042 + r251052;
double r251054 = r251035 * r251053;
double r251055 = exp(r251054);
double r251056 = r251055 / r251035;
double r251057 = log1p(r251037);
double r251058 = expm1(r251057);
double r251059 = r251058 / r251039;
double r251060 = log(r251059);
double r251061 = r251042 + r251060;
double r251062 = r251035 * r251061;
double r251063 = exp(r251062);
double r251064 = r251063 / r251035;
double r251065 = r251048 ? r251056 : r251064;
double r251066 = r251034 ? r251046 : r251065;
return r251066;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.8 |
|---|---|
| Target | 8.3 |
| Herbie | 4.9 |
if y < 165.0208082342575Initial program 4.1
rmApplied add-cube-cbrt28.1
Applied add-cube-cbrt4.1
Applied times-frac4.1
Applied log-prod1.6
Simplified0.9
if 165.0208082342575 < y < 8.906285416665826e+185Initial program 33.7
rmApplied add-cube-cbrt23.9
Applied add-cube-cbrt33.7
Applied times-frac33.7
Applied log-prod27.5
Simplified27.5
rmApplied log1p-expm1-u23.1
if 8.906285416665826e+185 < y Initial program 27.9
rmApplied add-cube-cbrt24.0
Applied add-cube-cbrt28.0
Applied times-frac28.0
Applied log-prod13.8
Simplified8.5
rmApplied expm1-log1p-u7.6
Final simplification4.9
herbie shell --seed 2019326 +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))