robust implementation of eigenvalue computation, prevents complex eigenvalues due to round-off errors