def genlaguerre(n, alpha, monic=False):
 if (alpha <= (-1)):
  raise ValueError('alpha must be > -1')
 if (n < 0):
  raise ValueError('n must be nonnegative.')
 if (n == 0):
  n1 = (n + 1)
 else:
  n1 = n
 (x, w, mu0) = roots_genlaguerre(n1, alpha, mu=True)
 wfunc = (lambda x: (exp((- x)) * (x ** alpha)))
 if (n == 0):
  (x, w) = ([], [])
 hn = (_gam(((n + alpha) + 1)) / _gam((n + 1)))
 kn = (((-1) ** n) / _gam((n + 1)))
 p = orthopoly1d(x, w, hn, kn, wfunc, (0, inf), monic, (lambda x: eval_genlaguerre(n, alpha, x)))
 return p

def genlaguerre ( n , alpha , monic = False ) : if ( alpha <= ( - 1 ) ) : raise ValueError ( 'alpha must be > -1' ) if ( n < 0 ) : raise ValueError ( 'n must be nonnegative.' ) if ( n == 0 ) : n1 = ( n + 1 ) else : n1 = n ( x , w , mu0 ) = roots_genlaguerre ( n1 , alpha , mu = True ) wfunc = ( lambda x : ( exp ( ( - x ) ) * ( x ** alpha ) ) ) if ( n == 0 ) : ( x , w ) = ( [ ] , [ ] ) hn = ( _gam ( ( ( n + alpha ) + 1 ) ) / _gam ( ( n + 1 ) ) ) kn = ( ( ( - 1 ) ** n ) / _gam ( ( n + 1 ) ) ) p = orthopoly1d ( x , w , hn , kn , wfunc , ( 0 , inf ) , monic , ( lambda x : eval_genlaguerre ( n , alpha , x ) ) ) return p
generalized laguerre polynomial .