Numerical Beta Function - MathOverflow most recent 30 from http://mathoverflow.net2013-05-26T03:32:07Zhttp://mathoverflow.net/feeds/question/71905http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://mathoverflow.net/questions/71905/numerical-beta-functionNumerical Beta FunctionLucas2011-08-02T18:07:50Z2011-08-05T05:38:33Z
<p>Anyone know a fast and concise way of calculating the Beta $B(a,b)$ function for smallish (<10) real $a$ and $b$.</p>
<p>For integer $a$ and $b$ I have:</p>
<p>$B(a,b) = \prod\limits_{j=1}^b \frac{j}{a+j}$</p>
<p>which has tiny code and is also pretty fast. I've see some methods that rely on the Gamma or log Gamma function:</p>
<p>$\log B(a,b) = \log \Gamma(a) + \log \Gamma(b) - \log \Gamma(a+b)$</p>
<p>using approximations of $\log \Gamma$, but I was wondering if there was a more direct way.</p>
http://mathoverflow.net/questions/71905/numerical-beta-function/72149#72149Answer by J. M. for Numerical Beta FunctionJ. M.2011-08-05T05:38:33Z2011-08-05T05:38:33Z<p>There's nothing more straightforward than using the gamma function relationship, I believe (perhaps using <a href="http://my.fit.edu/~gabdo/gamma.txt" rel="nofollow">Lanczos's approximation</a> to compute the gamma functions). Of course, for integer arguments, the product representation is much faster. You could probably also consider the special case when one of the beta function's arguments is a semi-integer, and accordingly construct the appropriate product representation (involving $\sqrt{\pi}$).</p>