\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)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\
\mathbf{elif}\;y \le 8.906285416665826287217678929131947523715 \cdot 10^{185}:\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) + x \cdot \log \left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x}\right)\right)}{\sqrt[3]{x + y}}\right)}}{x}\\
\end{array}double f(double x, double y) {
double r293261 = x;
double r293262 = y;
double r293263 = r293261 + r293262;
double r293264 = r293261 / r293263;
double r293265 = log(r293264);
double r293266 = r293261 * r293265;
double r293267 = exp(r293266);
double r293268 = r293267 / r293261;
return r293268;
}
double f(double x, double y) {
double r293269 = y;
double r293270 = 165.0208082342575;
bool r293271 = r293269 <= r293270;
double r293272 = x;
double r293273 = 2.0;
double r293274 = cbrt(r293272);
double r293275 = r293272 + r293269;
double r293276 = cbrt(r293275);
double r293277 = r293274 / r293276;
double r293278 = log(r293277);
double r293279 = r293273 * r293278;
double r293280 = r293272 * r293279;
double r293281 = r293272 * r293278;
double r293282 = r293280 + r293281;
double r293283 = exp(r293282);
double r293284 = r293283 / r293272;
double r293285 = 8.906285416665826e+185;
bool r293286 = r293269 <= r293285;
double r293287 = expm1(r293274);
double r293288 = log1p(r293287);
double r293289 = r293288 / r293276;
double r293290 = log(r293289);
double r293291 = r293273 * r293290;
double r293292 = r293272 * r293291;
double r293293 = r293292 + r293281;
double r293294 = exp(r293293);
double r293295 = r293294 / r293272;
double r293296 = log1p(r293274);
double r293297 = expm1(r293296);
double r293298 = r293297 / r293276;
double r293299 = log(r293298);
double r293300 = r293272 * r293299;
double r293301 = r293280 + r293300;
double r293302 = exp(r293301);
double r293303 = r293302 / r293272;
double r293304 = r293286 ? r293295 : r293303;
double r293305 = r293271 ? r293284 : r293304;
return r293305;
}




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
Applied distribute-lft-in1.6
Simplified0.8
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
Applied distribute-lft-in27.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
Applied distribute-lft-in13.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))