Working test code that compares two successive diagonalizations. Tested for 500x500 matrices with gcc.