Closed
Description
mpmath version: 1.1.0
When it's fourth argument is positive infinity, the appellf1 function exhibits
different behavior in the mp and fp contexts, returning 1.0 and throwing a
NoConvergence exception respectively. However, when that argument is numerical,
both versions consistently agree on 1.0, and when the infinity is fed to other
parameters, the two versions agree.
Example:
Python 3.6.8 (default, Aug 20 2019, 17:12:48)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpmath import *
>>> import numpy as np
>>> mp.appellf1(0, 0.4, 2.5, 2.2, np.inf, 1.4)
mpf('1.0')
>>> fp.appellf1(0, 0.4, 2.5, 2.2, np.inf, 1.4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/mpmath/ctx_fp.py", line 57, in f_wrapped
return f(ctx, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mpmath/functions/hypergeometric.py", line 1087, in appellf1
return ctx.hyper2d({'m+n':[a],'m':[b1],'n':[b2]}, {'m+n':[c]}, x,y, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mpmath/functions/hypergeometric.py", line 1322, in hyper2d
zeroprec=ctx.prec, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mpmath/functions/hypergeometric.py", line 226, in hyper
if q == 1: return ctx._hyp2f1(a_s, b_s, z, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mpmath/functions/hypergeometric.py", line 443, in _hyp2f1
return ctx.hypsum(2, 1, (atype, btype, ctype), [a, b, c], z, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mpmath/ctx_fp.py", line 213, in hypsum
raise ctx.NoConvergence
>>> fp.appellf1(0, 0.4, 2.5, 2.2, 38098124, 1.4)
1.0
>>> mp.appellf1(0, 0.4, 2.5, 2.2, 38098124, 1.4)
mpf('1.0')
Metadata
Metadata
Assignees
Labels
No labels