Laguerre polynomials are nontrivial solutions to Laguerre's equation, a second-order linear differential equation: \$xy''+(1-x)y'+ny=0\$. For a given value of \$n\$, the solution, \$y\$, is named \$L_n(x)\$. To avoid trivial solutions, the polynomials are non-constant except for \$n=0\$.
The polynomials can be found without calculus using recursion:
\$L_0(x)=1\$
\$L_1(x)=1-x\$
\$L_{k+1}(x)=\frac{(2k+1-x)L_k(x)-kL_{k-1}(x)}{k+1}\$
Summation can be used to the same end:
\$L_n(x)=\sum\limits_{k=0}^{n}{n\choose k}\frac{(-1)^k}{k!}x^k\$
\$L_n(x)=\sum\limits_{i=0}^n\prod\limits_{k=1}^i\frac{-(n-k+1)x}{k^2}\$
The first Laguerre polynomials are as follows:
Coefficients can be found here.
The Challenge
Given a nonnegative integer \$n\$ and a real number \$x\$, find \$L_n(x)\$.
Rules
This is code-golf so the shortest answer in bytes wins.
Assume only valid input will be given.
Error should be under one ten-thousandth (±0.0001) for the test cases.
Test Cases
Here, \$n\$ is the first number and \$x\$ is the second.
In: 1 2
Out: -1
In: 3 1.416
Out: -0.71360922
In: 4 8.6
Out: −7.63726667
In: 6 -2.1
Out: 91.86123261