\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;y \le 1077.4618968781419 \lor \neg \left(y \le 4.93738979423122685 \cdot 10^{97}\right):\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{x}\right)\right)}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\
\end{array}double f(double x, double y) {
double r428929 = x;
double r428930 = y;
double r428931 = r428929 + r428930;
double r428932 = r428929 / r428931;
double r428933 = log(r428932);
double r428934 = r428929 * r428933;
double r428935 = exp(r428934);
double r428936 = r428935 / r428929;
return r428936;
}
double f(double x, double y) {
double r428937 = y;
double r428938 = 1077.461896878142;
bool r428939 = r428937 <= r428938;
double r428940 = 4.937389794231227e+97;
bool r428941 = r428937 <= r428940;
double r428942 = !r428941;
bool r428943 = r428939 || r428942;
double r428944 = x;
double r428945 = 2.0;
double r428946 = cbrt(r428944);
double r428947 = r428944 + r428937;
double r428948 = cbrt(r428947);
double r428949 = r428946 / r428948;
double r428950 = log(r428949);
double r428951 = r428945 * r428950;
double r428952 = r428944 * r428951;
double r428953 = r428944 * r428950;
double r428954 = r428952 + r428953;
double r428955 = exp(r428954);
double r428956 = r428955 / r428944;
double r428957 = expm1(r428946);
double r428958 = log1p(r428957);
double r428959 = r428958 / r428948;
double r428960 = log(r428959);
double r428961 = r428945 * r428960;
double r428962 = r428944 * r428961;
double r428963 = r428962 + r428953;
double r428964 = exp(r428963);
double r428965 = r428964 / r428944;
double r428966 = r428943 ? r428956 : r428965;
return r428966;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.6 |
|---|---|
| Target | 8.1 |
| Herbie | 5.2 |
if y < 1077.461896878142 or 4.937389794231227e+97 < y Initial program 9.2
rmApplied add-cube-cbrt28.3
Applied add-cube-cbrt9.2
Applied times-frac9.2
Applied log-prod4.7
Applied distribute-lft-in4.7
Simplified3.5
if 1077.461896878142 < y < 4.937389794231227e+97Initial program 36.4
rmApplied add-cube-cbrt22.3
Applied add-cube-cbrt36.4
Applied times-frac36.4
Applied log-prod33.8
Applied distribute-lft-in33.8
Simplified33.8
rmApplied log1p-expm1-u23.0
Final simplification5.2
herbie shell --seed 2020060 +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))