\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -4.980242683664132068157952579233092791682 \cdot 10^{60} \lor \neg \left(x \le 8.738743363977151004581063748076582071774 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{1}{e^{y} \cdot 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 r322293 = x;
double r322294 = y;
double r322295 = r322293 + r322294;
double r322296 = r322293 / r322295;
double r322297 = log(r322296);
double r322298 = r322293 * r322297;
double r322299 = exp(r322298);
double r322300 = r322299 / r322293;
return r322300;
}
double f(double x, double y) {
double r322301 = x;
double r322302 = -4.980242683664132e+60;
bool r322303 = r322301 <= r322302;
double r322304 = 8.738743363977151e-24;
bool r322305 = r322301 <= r322304;
double r322306 = !r322305;
bool r322307 = r322303 || r322306;
double r322308 = 1.0;
double r322309 = y;
double r322310 = exp(r322309);
double r322311 = r322310 * r322301;
double r322312 = r322308 / r322311;
double r322313 = 2.0;
double r322314 = cbrt(r322301);
double r322315 = r322301 + r322309;
double r322316 = cbrt(r322315);
double r322317 = r322314 / r322316;
double r322318 = log(r322317);
double r322319 = r322313 * r322318;
double r322320 = r322319 * r322301;
double r322321 = exp(r322320);
double r322322 = pow(r322317, r322301);
double r322323 = r322321 * r322322;
double r322324 = r322323 / r322301;
double r322325 = r322307 ? r322312 : r322324;
return r322325;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.8 |
|---|---|
| Target | 8.3 |
| Herbie | 0.6 |
if x < -4.980242683664132e+60 or 8.738743363977151e-24 < x Initial program 10.7
Simplified10.7
Taylor expanded around inf 1.0
rmApplied clear-num1.0
Simplified1.0
if -4.980242683664132e+60 < x < 8.738743363977151e-24Initial program 10.9
Simplified10.9
rmApplied add-cube-cbrt13.9
Applied add-cube-cbrt10.9
Applied times-frac10.9
Applied unpow-prod-down2.3
rmApplied add-exp-log36.2
Applied add-exp-log36.2
Applied prod-exp36.2
Applied add-exp-log36.2
Applied add-exp-log36.2
Applied prod-exp36.2
Applied div-exp36.2
Applied pow-exp35.2
Simplified0.2
Final simplification0.6
herbie shell --seed 2019326
(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))