xla icon indicating copy to clipboard operation
xla copied to clipboard

Improve the accuracy of HermitianEigenDecomposition2x2.

Open copybara-service[bot] opened this issue 2 years ago • 0 comments
trafficstars

Improve the accuracy of HermitianEigenDecomposition2x2.

Previously there was a threshold on "t" when computing the components of the eigenvector to deal with the case where a previously computed quantity (tau) was an infinity

This threshold was set to 1e-6 and below that t was zero. The cosine was computed as c = 1/(1+t^2) and the sine was computed as s = t/(1+t^2). The threshold did not affect cosine much, but introduced a massive error in the computation of the sine.

The threshold only needs to be zero, to make sure infinities do not get propagated.

This should improve the accuracy of the eigenvalue decomposition for small eigenvalues.

copybara-service[bot] avatar Mar 13 '23 17:03 copybara-service[bot]