\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -1.361918972808934889291186360667730003785 \cdot 10^{107} \lor \neg \left(x \le 2.625152943905098901211658812826499342918\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)} \cdot {\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\
\end{array}double f(double x, double y) {
double r349298 = x;
double r349299 = y;
double r349300 = r349298 + r349299;
double r349301 = r349298 / r349300;
double r349302 = log(r349301);
double r349303 = r349298 * r349302;
double r349304 = exp(r349303);
double r349305 = r349304 / r349298;
return r349305;
}
double f(double x, double y) {
double r349306 = x;
double r349307 = -1.3619189728089349e+107;
bool r349308 = r349306 <= r349307;
double r349309 = 2.625152943905099;
bool r349310 = r349306 <= r349309;
double r349311 = !r349310;
bool r349312 = r349308 || r349311;
double r349313 = y;
double r349314 = -r349313;
double r349315 = exp(r349314);
double r349316 = r349315 / r349306;
double r349317 = 2.0;
double r349318 = cbrt(r349306);
double r349319 = r349306 + r349313;
double r349320 = cbrt(r349319);
double r349321 = r349318 / r349320;
double r349322 = log(r349321);
double r349323 = r349317 * r349322;
double r349324 = r349306 * r349323;
double r349325 = exp(r349324);
double r349326 = pow(r349321, r349306);
double r349327 = r349325 * r349326;
double r349328 = r349327 / r349306;
double r349329 = r349312 ? r349316 : r349328;
return r349329;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.6 |
|---|---|
| Target | 7.5 |
| Herbie | 0.4 |
if x < -1.3619189728089349e+107 or 2.625152943905099 < x Initial program 10.8
Simplified10.8
Taylor expanded around inf 0.0
if -1.3619189728089349e+107 < x < 2.625152943905099Initial program 10.5
Simplified10.5
rmApplied add-cube-cbrt16.0
Applied add-cube-cbrt10.5
Applied times-frac10.5
Applied unpow-prod-down2.8
rmApplied add-exp-log37.1
Applied add-exp-log37.1
Applied prod-exp37.1
Applied add-exp-log37.1
Applied add-exp-log37.1
Applied prod-exp37.1
Applied div-exp37.1
Applied pow-exp36.1
Simplified0.8
Final simplification0.4
herbie shell --seed 2019212 +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.73118442066479561e94) (/ (exp (/ -1 y)) x) (if (< y 2.81795924272828789e37) (/ (pow (/ x (+ y x)) x) x) (if (< y 2.347387415166998e178) (log (exp (/ (pow (/ x (+ y x)) x) x))) (/ (exp (/ -1 y)) x))))
(/ (exp (* x (log (/ x (+ x y))))) x))