7 #include "cln/univpoly_integer.h"
12 #include "cln/integer.h"
16 const cl_UP_I laguerre (sintL n)
18 // The Laguerre polynomials L_n(x) are defined as
21 // L_n(x) = exp(x) (----) (x^n exp(-x))
24 // They satisfy the recurrence relation
27 // L_{n+1}(x) = (2n+1-x) L_n(x) - n^2 L_{n-1}(x) for n >= 0.
30 // L_n(x) satisfies the differential equation
31 // x*L_n''(x) + (1-x)*L_n'(x) + n*L_n(x) = 0.
33 // Proof: See elsewhere.
36 // The coefficients c_{n,k} of L_n(x) = sum(k=0..n, c_{n,k} x^k)
39 // c_{n,k} = (k+1)^2/(k-n)*c_{n,k+1}
41 // It follows that for n>=0
43 // L_n(x) = sum(j=0..n, (-1)^(n-j) n!^2/j!(n-j)!^2 x^(n-j))
45 var cl_univpoly_integer_ring R = find_univpoly_ring(cl_I_ring);
46 var cl_UP_I l = R->create(n);
48 var cl_I c_k = (evenp(n) ? 1 : -1);
54 c_k = exquo((cl_I)(k+1) * (cl_I)(k+1) * c_k,