\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}\begin{array}{l}
\mathbf{if}\;x \le -18649979204356907008:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{elif}\;x \le 0.3987830221801595409480967191484523937106:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}double f(double x, double y) {
double r16267692 = x;
double r16267693 = y;
double r16267694 = r16267692 + r16267693;
double r16267695 = r16267692 / r16267694;
double r16267696 = log(r16267695);
double r16267697 = r16267692 * r16267696;
double r16267698 = exp(r16267697);
double r16267699 = r16267698 / r16267692;
return r16267699;
}
double f(double x, double y) {
double r16267700 = x;
double r16267701 = -1.8649979204356907e+19;
bool r16267702 = r16267700 <= r16267701;
double r16267703 = y;
double r16267704 = -r16267703;
double r16267705 = exp(r16267704);
double r16267706 = r16267705 / r16267700;
double r16267707 = 0.39878302218015954;
bool r16267708 = r16267700 <= r16267707;
double r16267709 = 1.0;
double r16267710 = r16267709 / r16267700;
double r16267711 = r16267708 ? r16267710 : r16267706;
double r16267712 = r16267702 ? r16267706 : r16267711;
return r16267712;
}




Bits error versus x




Bits error versus y
Results
| Original | 11.0 |
|---|---|
| Target | 7.9 |
| Herbie | 0.5 |
if x < -1.8649979204356907e+19 or 0.39878302218015954 < x Initial program 11.0
Taylor expanded around inf 0.1
Simplified0.1
if -1.8649979204356907e+19 < x < 0.39878302218015954Initial program 11.1
Taylor expanded around inf 0.9
Final simplification0.5
herbie shell --seed 2019169
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, F"
:herbie-target
(if (< y -3.7311844206647956e+94) (/ (exp (/ -1.0 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.0 y)) x))))
(/ (exp (* x (log (/ x (+ x y))))) x))