Trigonometric formulas for eigenvalues of $3 \times 3$ matrices that build on Cardano's and Viète's work on algebraic solutions of the cubic are numerically unstable for matrices with repeated eigenvalues. This work presents numerically stable, closed-form evaluation of eigenvalues of real, diagonalizable $3 \times 3$ matrices via four invariants: the trace $I_1$, the deviatoric invariants $J_2$ and $J_3$, and the discriminant $Δ$. We analyze the conditioning of these invariants and derive tight forward error bounds. For $J_2$ we propose an algorithm and prove its accuracy. We benchmark all invariants and the resulting eigenvalue formulas, relating observed forward errors to the derived bounds. In particular, we show that, for the special case of matrices with a well-conditioned eigenbasis, the newly proposed algorithms have errors within the forward stability bounds. Performance benchmarks show that the proposed algorithm is approximately ten times faster than the highly optimized LAPACK library for a challenging test case, while maintaining comparable accuracy.
翻译:基于卡丹诺和维埃特三次方程代数解工作的3×3矩阵特征值三角公式,在矩阵具有重特征值时存在数值不稳定性。本研究通过四个不变量——迹$I_1$、偏量不变量$J_2$与$J_3$以及判别式$Δ$,提出了针对实可对角化3×3矩阵特征值的数值稳定闭式计算方案。我们分析了这些不变量的条件数,并推导出严格的前向误差界。针对$J_2$提出了一种算法并证明了其精度。对所有不变量及所得特征值公式进行了基准测试,将观测前向误差与推导误差界进行关联分析。特别地,我们证明对于具有良条件特征基矩阵的特殊情况,新提出算法的误差处于前向稳定性界内。性能基准测试表明,在处理具有挑战性的测试案例时,所提算法比高度优化的LAPACK库快约十倍,同时保持相当的精度。