Computing the eigenvalues of a 2x2 matrix

Believe it or not, computing the eigen-decomposition of a 2x2 symmetric matrix is not as trivial as it seems. While I was doing my M.Eng thesis, at a certain point I was implementing two algorithms:

And I found bugs in both! GSL would fail on simple cases: for diagonal matrices it would return two equal eigen-vectors. Blinn's algorithm has a couple of minor bugs.

The source code presented here contains Blinn's algorithm with a couple of corrections.