When the third argument is a NaN, the laguerre function proceeds without any problems. Especially considering the fact that the third argument is the point at which the polynomial is to be evaluated, perhaps throwing an exception or propagating the NaN would be more appropriate?
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.
>>> import numpy as np
>>> from mpmath import *
>>> mp.laguerre(0, 2.5, np.nan)
mpf('1.0')
>>> mp.laguerre(1, 2.5, np.nan)
mpf('3.5')
>>> mp.laguerre(1, 2.5345, np.nan)
mpf('3.5345')
>>> mp.laguerre(2, 2, np.nan)
mpf('6.0')
>>> mp.laguerre(2, 5, np.nan)
mpf('21.0')
mpmath version: 1.1.0
When the third argument is a NaN, the laguerre function proceeds without any problems. Especially considering the fact that the third argument is the point at which the polynomial is to be evaluated, perhaps throwing an exception or propagating the NaN would be more appropriate?