The beta function encountered total loss of precision for a >> max(|b|, 1), as gammaln(a+b) - gammaln(a) == 0 in floating point arithmetic in that case.
This PR implements an asymptotic expansion fixing that. Tests against mpmath included.
WHT: special/cephes: reindent all files
indent -kr -bad -sc -nce *.c *.h
BUG: special: implement asymptotic expansion in beta(a, b) for a >> |b|
For what it's worth, this looks good to me. I haven't tested it, but the expansion is correct.
Thanks @pv, @ewmoore. Tested with 2.7 and 3.2, merged as 536056e.