\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -2.930752839587006 \cdot 10^{86} \lor \neg \left(x \le 2.56432330242902842 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{e^{-1 \cdot y}}{x}\\
\mathbf{else}:\\
\;\;\;\;e^{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)\right) \cdot x} \cdot \frac{{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{x + y}}\right)}^{x}}{x}\\
\end{array}double f(double x, double y) {
double r389609 = x;
double r389610 = y;
double r389611 = r389609 + r389610;
double r389612 = r389609 / r389611;
double r389613 = log(r389612);
double r389614 = r389609 * r389613;
double r389615 = exp(r389614);
double r389616 = r389615 / r389609;
return r389616;
}
double f(double x, double y) {
double r389617 = x;
double r389618 = -2.930752839587006e+86;
bool r389619 = r389617 <= r389618;
double r389620 = 2.5643233024290284e-23;
bool r389621 = r389617 <= r389620;
double r389622 = !r389621;
bool r389623 = r389619 || r389622;
double r389624 = -1.0;
double r389625 = y;
double r389626 = r389624 * r389625;
double r389627 = exp(r389626);
double r389628 = r389627 / r389617;
double r389629 = 2.0;
double r389630 = cbrt(r389617);
double r389631 = r389617 + r389625;
double r389632 = cbrt(r389631);
double r389633 = r389630 / r389632;
double r389634 = log(r389633);
double r389635 = r389629 * r389634;
double r389636 = r389635 * r389617;
double r389637 = exp(r389636);
double r389638 = pow(r389633, r389617);
double r389639 = r389638 / r389617;
double r389640 = r389637 * r389639;
double r389641 = r389623 ? r389628 : r389640;
return r389641;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.4 |
|---|---|
| Target | 8.0 |
| Herbie | 0.7 |
if x < -2.930752839587006e+86 or 2.5643233024290284e-23 < x Initial program 11.4
Simplified11.4
Taylor expanded around inf 0.8
Simplified0.8
if -2.930752839587006e+86 < x < 2.5643233024290284e-23Initial program 11.4
Simplified11.4
rmApplied *-un-lft-identity11.4
Applied add-cube-cbrt16.2
Applied add-cube-cbrt11.4
Applied times-frac11.4
Applied unpow-prod-down2.8
Applied times-frac2.8
Simplified2.8
rmApplied add-exp-log38.4
Applied add-exp-log38.4
Applied prod-exp38.4
Applied add-exp-log38.4
Applied add-exp-log38.4
Applied prod-exp38.4
Applied div-exp38.4
Applied pow-exp37.3
Simplified0.5
Final simplification0.7
herbie shell --seed 2020065 +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))