The QR Algorithm for Real Symmetric Matrices with Multiple Eigenvalues