\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -10594210996052847989843034112 \lor \neg \left(x \le 0.003027614112253133524244042007467214716598\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) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right)}}{x}\\
\end{array}double f(double x, double y) {
double r243299 = x;
double r243300 = y;
double r243301 = r243299 + r243300;
double r243302 = r243299 / r243301;
double r243303 = log(r243302);
double r243304 = r243299 * r243303;
double r243305 = exp(r243304);
double r243306 = r243305 / r243299;
return r243306;
}
double f(double x, double y) {
double r243307 = x;
double r243308 = -1.0594210996052848e+28;
bool r243309 = r243307 <= r243308;
double r243310 = 0.0030276141122531335;
bool r243311 = r243307 <= r243310;
double r243312 = !r243311;
bool r243313 = r243309 || r243312;
double r243314 = y;
double r243315 = -r243314;
double r243316 = exp(r243315);
double r243317 = r243316 / r243307;
double r243318 = 2.0;
double r243319 = cbrt(r243307);
double r243320 = r243307 + r243314;
double r243321 = cbrt(r243320);
double r243322 = r243319 / r243321;
double r243323 = log(r243322);
double r243324 = r243318 * r243323;
double r243325 = r243324 + r243323;
double r243326 = r243307 * r243325;
double r243327 = exp(r243326);
double r243328 = r243327 / r243307;
double r243329 = r243313 ? r243317 : r243328;
return r243329;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.3 |
|---|---|
| Target | 8.0 |
| Herbie | 0.2 |
if x < -1.0594210996052848e+28 or 0.0030276141122531335 < x Initial program 11.9
Taylor expanded around inf 0.2
Simplified0.2
if -1.0594210996052848e+28 < x < 0.0030276141122531335Initial program 10.7
rmApplied add-cube-cbrt11.9
Applied add-cube-cbrt10.7
Applied times-frac10.7
Applied log-prod2.3
Simplified0.1
Final simplification0.2
herbie shell --seed 2019306 +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))