\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -4.120156288663160099262452246870941235987 \cdot 10^{50} \lor \neg \left(x \le 1.115898472191414701666743120923343257633 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) \cdot x + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}}{x}\\
\end{array}double f(double x, double y) {
double r360296 = x;
double r360297 = y;
double r360298 = r360296 + r360297;
double r360299 = r360296 / r360298;
double r360300 = log(r360299);
double r360301 = r360296 * r360300;
double r360302 = exp(r360301);
double r360303 = r360302 / r360296;
return r360303;
}
double f(double x, double y) {
double r360304 = x;
double r360305 = -4.12015628866316e+50;
bool r360306 = r360304 <= r360305;
double r360307 = 1.1158984721914147e-09;
bool r360308 = r360304 <= r360307;
double r360309 = !r360308;
bool r360310 = r360306 || r360309;
double r360311 = 1.0;
double r360312 = y;
double r360313 = exp(r360312);
double r360314 = r360304 * r360313;
double r360315 = r360311 / r360314;
double r360316 = 2.0;
double r360317 = cbrt(r360304);
double r360318 = r360304 + r360312;
double r360319 = cbrt(r360318);
double r360320 = r360317 / r360319;
double r360321 = log(r360320);
double r360322 = r360316 * r360321;
double r360323 = r360322 * r360304;
double r360324 = r360304 * r360321;
double r360325 = r360323 + r360324;
double r360326 = exp(r360325);
double r360327 = r360326 / r360304;
double r360328 = r360310 ? r360315 : r360327;
return r360328;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.1 |
|---|---|
| Target | 8.0 |
| Herbie | 0.4 |
if x < -4.12015628866316e+50 or 1.1158984721914147e-09 < x Initial program 11.7
Taylor expanded around inf 0.5
Simplified0.5
rmApplied clear-num0.6
Simplified0.5
if -4.12015628866316e+50 < x < 1.1158984721914147e-09Initial program 10.6
rmApplied add-cube-cbrt13.5
Applied add-cube-cbrt10.6
Applied times-frac10.6
Applied log-prod2.0
Applied distribute-lft-in2.0
Simplified0.2
Final simplification0.4
herbie shell --seed 2019303 +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))