mpmath icon indicating copy to clipboard operation
mpmath copied to clipboard

Unexpected return from hyp1f1 when evaluating limit at negative infinity

Open jacksonvanover opened this issue 6 years ago • 0 comments

Though mpmath appears to support evaluating limits approaching positive infinity, matching the results returned by SciPy and GSL, and jmat, it diverges from those three libraries when evaluating the limit at negative infinity with the first argument as 1; mp.hyp1f1 returns NaN when the other libraries agree on zero.

>>> special.hyp1f1(0, 1, np.inf)
1.0
>>> mp.hyp1f1(0, 1, np.inf)
mpf('1.0')
>>> special.hyp1f1(0, 1, np.NINF)
1.0
>>> mp.hyp1f1(0, 1, np.NINF)
mpf('1.0')
>>> special.hyp1f1(1, 2, np.NINF)
0.0
>>> mp.hyp1f1(1, 2, np.NINF)
mpf('nan')
>>> special.hyp1f1(2, 2, np.NINF)
0.0
>>> mp.hyp1f1(2, 2, np.NINF)
mpf('0.0')
>>> mp.hyp1f1(1, 5, np.NINF)
mpf('nan')
>>> 

jacksonvanover avatar Mar 19 '20 02:03 jacksonvanover