# PolRoots(P) = All of the roots of polynomial P

PolRoots(P) = All of the roots of polynomial P:

Returns a column vector containing all n roots of polynomial P where P is a column vector containing the n+1 coefficients of P. The coefficients may be real, imaginary or complex. The roots are sorted in ascending order. The code used for this function is an implementation the Laguerre method.

A polynomial P(x) = p(n)*x^n + p(n−1)*x^(n−1) + ... + p(1)*x + p(0) is represented as an (n + 1) by 1 column vector {p(n); p(n−1); ..., p(1); p(0)}.

For example, My calculator program XZCalc gives

Command: PolRoots({4; 3; 2; 1})

X = {-6.05829,58618,826E-1 (14) [56];+
+
-7.20852,06905,865E-2 (14) [54] - 6.38326,73514,837E-1 (14) [56] * i;+
+
-7.20852,06905,865E-2 (14) [54] + 6.38326,73514,837E-1 (14) [56] * i}

See: Roots of Polynomials -- From Numerical Recipes in C
See: Roots of Polynomials -- From Numerical Recipes in Fortran 77
See: Roots of Polynomials -- From Numerical Recipes in Fortran 90