  Spectral decomposition of matrices is a recurring and important task in
applied mathematics, physics and engineering. Many application problems require
the consideration of matrices of size three with spectral decomposition over
the real numbers. If the functional dependence of the spectral decomposition on
the matrix elements has to be preserved, then closed-form solution approaches
must be considered. Existing closed-form expressions are based on the use of
principal matrix invariants which suffer from a number of deficiencies when
evaluated in the framework of finite precision arithmetic. This paper
introduces an alternative form for the computation of the involved matrix
invariants (in particular the discriminant) in terms of sum-of-products
expressions as function of the matrix elements. We prove and demonstrate by
numerical examples that this alternative approach leads to increased floating
point accuracy, especially in all important limit cases (e.g. eigenvalue
multiplicity). It is believed that the combination of symbolic algorithms with
the accuracy improvements presented in this paper can serve as a powerful
building block for many engineering tasks.
