def laggauss(deg):
ideg = int(deg)<EOL>if ideg != deg or ideg < <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>c = np.array([<NUM_LIT:0>]*deg + [<NUM_LIT:1>])<EOL>m = lagcompanion(c)<EOL>x = la.eigvals(m)<EOL>x.sort()<EOL>dy = lagval(x, c)<EOL>df = lagval(x, lagder(c))<EOL>x -= dy/df<EOL>fm = lagval(x, c[<NUM_LIT:1>:])<EOL>fm /= np.abs(fm).max()<EOL>df /= np.abs(df).max()<EOL>w = <NUM_LIT:1>/(fm * df)<EOL>w /= w.sum()<EOL>return x, w<EOL>
Gauss-Laguerre quadrature.

Computes the sample points and weights for Gauss-Laguerre quadrature.
These sample points and weights will correctly integrate polynomials of
degree :math:`2*deg - 1` or less over the interval :math:`[0, \inf]`
with the weight function :math:`f(x) = \exp(-x)`.

Parameters
----------
deg : int
    Number of sample points and weights. It must be >= 1.

Returns
-------
x : ndarray
    1-D ndarray containing the sample points.
y : ndarray
    1-D ndarray containing the weights.

Notes
-----

.. versionadded::1.7.0

The results have only been tested up to degree 100 higher degrees may
be problematic. The weights are determined by using the fact that

.. math:: w_k = c / (L'_n(x_k) * L_{n-1}(x_k))

where :math:`c` is a constant independent of :math:`k` and :math:`x_k`
is the k'th root of :math:`L_n`, and then scaling the results to get
the right value when integrating 1.