Skip to content

Unexpected return from hyp1f1 when evaluating limit at negative infinity #522

@jacksonvanover

Description

@jacksonvanover

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')
>>> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions