With the chebyshev polynomial of the first kind, when the first argument is nonintegral and the second argument is a NaN, a hang is
caused. This true for both the fp and mp versions. On a possibly unrelated note, when the first argument is integral and the second is a NaN, it appears that the fp version throws a NoConvergence exception while the mp version always returns 1.0
Python 3.6.8 (default, Oct 7 2019, 12:59:55)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpmath import *
>>> import numpy as np
>>> mp.chebyt(2.3,np.nan)
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/ctx_mp_python.py", line 1035, in f_wrapped
retval = f(ctx, *args, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/orthogonal.py", line 446, in chebyt
return ctx.hyp2f1(-n,n,(1,2),(1-x)/2, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 251, in hyp2f1
return ctx.hyper([a,b],[c],z,**kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 226, in hyper
if q == 1: return ctx._hyp2f1(a_s, b_s, z, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 473, in _hyp2f1
v = _hyp2f1_gosper(ctx,a,b,c,z,**kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 380, in _hyp2f1_gosper
kakbz = (k+a)*(k+b)*z / (4*(k+1)*kch*(k+c1h))
File "<string>", line 10, in __add__
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/libmp/libmpf.py", line 715, in mpf_add
offset = sexp - texp
KeyboardInterrupt
>>> fp.chebyt(1.3,np.nan)
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/ctx_fp.py", line 57, in f_wrapped
return f(ctx, *args, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/orthogonal.py", line 446, in chebyt
return ctx.hyp2f1(-n,n,(1,2),(1-x)/2, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 251, in hyp2f1
return ctx.hyper([a,b],[c],z,**kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 226, in hyper
if q == 1: return ctx._hyp2f1(a_s, b_s, z, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 473, in _hyp2f1
v = _hyp2f1_gosper(ctx,a,b,c,z,**kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 380, in _hyp2f1_gosper
kakbz = (k+a)*(k+b)*z / (4*(k+1)*kch*(k+c1h))
KeyboardInterrupt
>>> fp.chebyt(13,np.nan)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/ctx_fp.py", line 57, in f_wrapped
return f(ctx, *args, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/orthogonal.py", line 446, in chebyt
return ctx.hyp2f1(-n,n,(1,2),(1-x)/2, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 251, in hyp2f1
return ctx.hyper([a,b],[c],z,**kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 226, in hyper
if q == 1: return ctx._hyp2f1(a_s, b_s, z, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/functions/hypergeometric.py", line 443, in _hyp2f1
return ctx.hypsum(2, 1, (atype, btype, ctype), [a, b, c], z, **kwargs)
File "/home/jvanover/.local/lib/python3.6/site-packages/mpmath/ctx_fp.py", line 213, in hypsum
raise ctx.NoConvergence
mpmath.libmp.libhyper.NoConvergence
>>> mp.chebyt(13,np.nan)
mpf('1.0')
>>> mp.chebyt(17,np.nan)
mpf('1.0')
mpmath version: 1.1.0
With the chebyshev polynomial of the first kind, when the first argument is nonintegral and the second argument is a NaN, a hang is
caused. This true for both the fp and mp versions. On a possibly unrelated note, when the first argument is integral and the second is a NaN, it appears that the fp version throws a NoConvergence exception while the mp version always returns 1.0
Example: