\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -1.335604954605443015390054065360569803049 \cdot 10^{135} \lor \neg \left(x \le 2.859517489315194049442510563430033342003 \cdot 10^{-25}\right):\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\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 r247990 = x;
double r247991 = y;
double r247992 = r247990 + r247991;
double r247993 = r247990 / r247992;
double r247994 = log(r247993);
double r247995 = r247990 * r247994;
double r247996 = exp(r247995);
double r247997 = r247996 / r247990;
return r247997;
}
double f(double x, double y) {
double r247998 = x;
double r247999 = -1.335604954605443e+135;
bool r248000 = r247998 <= r247999;
double r248001 = 2.859517489315194e-25;
bool r248002 = r247998 <= r248001;
double r248003 = !r248002;
bool r248004 = r248000 || r248003;
double r248005 = 1.0;
double r248006 = y;
double r248007 = exp(r248006);
double r248008 = r247998 * r248007;
double r248009 = r248005 / r248008;
double r248010 = 2.0;
double r248011 = cbrt(r247998);
double r248012 = r247998 + r248006;
double r248013 = cbrt(r248012);
double r248014 = r248011 / r248013;
double r248015 = log(r248014);
double r248016 = r248010 * r248015;
double r248017 = r248016 + r248015;
double r248018 = r247998 * r248017;
double r248019 = exp(r248018);
double r248020 = r248019 / r247998;
double r248021 = r248004 ? r248009 : r248020;
return r248021;
}




Bits error versus x




Bits error versus y
Results
| Original | 10.9 |
|---|---|
| Target | 7.9 |
| Herbie | 1.0 |
if x < -1.335604954605443e+135 or 2.859517489315194e-25 < x Initial program 10.9
Taylor expanded around inf 1.0
Simplified1.0
rmApplied neg-sub01.0
Applied exp-diff1.0
Applied associate-/l/1.0
if -1.335604954605443e+135 < x < 2.859517489315194e-25Initial program 10.9
rmApplied add-cube-cbrt17.8
Applied add-cube-cbrt10.9
Applied times-frac10.9
Applied log-prod3.0
Simplified1.0
Final simplification1.0
herbie shell --seed 2019325 +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))