FEAST Algorithm

Ref is Phys Erev B, 79, 115112, 2009
Density-matrix-based algorithm for solving eigenvalue problems.
Eric Polizzi.

Working from the pseudocode on p3.

n = 12;
A= RandomReal[{-1,1},{n,n}];
A=A.Transpose[A];
Eigenvalues[A]

There is no need to type the x,s and ωs in because Mathematica knows them.  It appears as though one of the digits in the Polizzi paper is inccorectly rounded.

n=8;
p[x_]:=LegendreP[n,x];
{xs,ωs}=Transpose[{x,(2/((1-(x^2))(((p'[x]))^2)))}/.NSolve[p[x]==0,x,WorkingPrecision->20]];
TableForm[Transpose[{xs,ωs}],
TableHeadings->{Automatic,{"x","ω"}}]