def gauss_gen_laguerre(n, alpha, n_digits):
 x = Dummy('x')
 p = laguerre_poly(n, x, alpha=alpha, polys=True)
 p1 = laguerre_poly((n - 1), x, alpha=alpha, polys=True)
 p2 = laguerre_poly((n - 1), x, alpha=(alpha + 1), polys=True)
 xi = []
 w = []
 for r in p.real_roots():
  if isinstance(r, RootOf):
   r = r.eval_rational((S(1) / (10 ** (n_digits + 2))))
  xi.append(r.n(n_digits))
  w.append((gamma((alpha + n)) / (((n * gamma(n)) * p1.subs(x, r)) * p2.subs(x, r))).n(n_digits))
 return (xi, w)

def gauss_gen_laguerre ( n , alpha , n_digits ) : x = Dummy ( 'x' ) p = laguerre_poly ( n , x , alpha = alpha , polys = True ) p1 = laguerre_poly ( ( n - 1 ) , x , alpha = alpha , polys = True ) p2 = laguerre_poly ( ( n - 1 ) , x , alpha = ( alpha + 1 ) , polys = True ) xi = [ ] w = [ ] for r in p . real_roots ( ) : if isinstance ( r , RootOf ) : r = r . eval_rational ( ( S ( 1 ) / ( 10 ** ( n_digits + 2 ) ) ) ) xi . append ( r . n ( n_digits ) ) w . append ( ( gamma ( ( alpha + n ) ) / ( ( ( n * gamma ( n ) ) * p1 . subs ( x , r ) ) * p2 . subs ( x , r ) ) ) . n ( n_digits ) ) return ( xi , w )
computes the generalized gauss-laguerre quadrature [1]_ points and weights .