\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 r16900666 = x;
double r16900667 = y;
double r16900668 = r16900666 + r16900667;
double r16900669 = r16900666 / r16900668;
double r16900670 = log(r16900669);
double r16900671 = r16900666 * r16900670;
double r16900672 = exp(r16900671);
double r16900673 = r16900672 / r16900666;
return r16900673;
}
double f(double x, double y) {
double r16900674 = x;
double r16900675 = -1.8649979204356907e+19;
bool r16900676 = r16900674 <= r16900675;
double r16900677 = y;
double r16900678 = -r16900677;
double r16900679 = exp(r16900678);
double r16900680 = r16900679 / r16900674;
double r16900681 = 0.39878302218015954;
bool r16900682 = r16900674 <= r16900681;
double r16900683 = 1.0;
double r16900684 = r16900683 / r16900674;
double r16900685 = r16900682 ? r16900684 : r16900680;
double r16900686 = r16900676 ? r16900680 : r16900685;
return r16900686;
}




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 +o rules:numerics
(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))