Skip to content

improve stability of eigenValues2dImpl() by reformulating radicand

matrix A = (a00 a01; a10 a11) characteristic polynomial: p(x) = x^2 - (a00 + a11)x + (a00a11 - a01*a10)

current implementation: eigenvalues (roots) by pq-formula: x_{1/2} = (a00 + a11)/2 +/- \sqrt{ ((a00 + a11)/2)^2 - (a00a11 - a01a10)} stability issue: symmetric matrix close to identity may lead to negative radicand due to round-off errors

fix: reformulate radicand such that subtraction occurs as early as possible, i.e. x_{1/2} = (a00 + a11)/2 +/- \sqrt{ ((a00 - a11)/2)^2 + a01*a10 }

Merge request reports

Loading