scipy/scipy — pull request #3022 by gertingold (2013-10-25 20:40:06+00:00)
Title: hyp1f1: better handling of large negative arguments

This pull request addresses the issue raised in gh-2282. For negative arguments ``x``, DLMF 13.2.39 is used which implies a scaling with ``exp(x)`` which is corrected at the end. For large negative arguments, this causes an intermediate overflow which cannot be corrected by the final exponential rescaling. Therefore, the exponential factor has to be accounted for earlier in the calculation.

Actually, it seems that the problem discussed in gh-2957 has the same origin. It is probably not due to problems with the gamma function as suggested in the fix linked there. However, evaluating ratios of gamma functions by means of the logarithm of gamma functions is a good idea anyway. So, I propose to keep the changes proposed in gh-3019 (provided that pull request will be accepted).

Unfortunately, there remain still many parameter combinations where the test in ``test_mpmath`` does not pass, so further work is needed.