Skip to content

Accuracy improvements to xtgex2 - #420

Merged
langou merged 14 commits into
Reference-LAPACK:masterfrom
thijssteel:shur-swap
Feb 10, 2021
Merged

langou merged 14 commits into
Reference-LAPACK:masterfrom
thijssteel:shur-swap

Conversation

@thijssteel

Copy link
Copy Markdown
Collaborator

This PR contains two improvements to xtgex2:

  • Daan Camps has proven in his dissertation that replacing the condition in xtgex2 when swapping 1x1 blocks can improve the accuracy. This condition and the respective error tolerances have been changed to reflect it.

  • Also by Daan Camps, "SWAPPING 2 × 2 BLOCKS IN THE SCHUR AND GENERALIZED
    SCHUR FORM", shows that the accuracy of swapping 2x2 blocks can be improved by iterative refinement and by replacing the QR factorisation with an SVD based method. This PR only implements the first improvement as the paper does not mention how to avoid overflow.

@codecov

codecov Bot commented Jun 21, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #420 (bb9847d) into master (8e1e16c) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #420      +/-   ##
==========================================
+ Coverage   83.24%   83.28%   +0.03%     
==========================================
  Files        1808     1820      +12     
  Lines      170197   170885     +688     
==========================================
+ Hits       141681   142322     +641     
- Misses      28516    28563      +47     
Impacted Files Coverage Δ
SRC/ctgex2.f 93.24% <100.00%> (+0.81%) ⬆️
SRC/dtgex2.f 92.09% <100.00%> (+0.42%) ⬆️
SRC/stgex2.f 92.09% <100.00%> (+0.42%) ⬆️
SRC/ztgex2.f 93.24% <100.00%> (+0.81%) ⬆️
SRC/cggglm.f 80.32% <0.00%> (-5.64%) ⬇️
SRC/dggglm.f 80.32% <0.00%> (-5.64%) ⬇️
SRC/sggglm.f 80.32% <0.00%> (-5.64%) ⬇️
SRC/zggglm.f 80.32% <0.00%> (-5.64%) ⬇️
SRC/dgesdd.f 94.84% <0.00%> (-0.42%) ⬇️
SRC/sgesdd.f 94.84% <0.00%> (-0.42%) ⬇️
... and 27 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e1e16c...e5bb59b. Read the comment docs.

@thijssteel

Copy link
Copy Markdown
Collaborator Author

@julielangou most of the tests seem to avoid testing specific functions as much as possible. Is that by design or is it fine if i add some tests specifically for xtgexc to fix the coverage? The same goes for the xlaqz help functions for my other PR.

@julielangou

Copy link
Copy Markdown
Contributor

@langou , could you please take a look at this contribution.
For the testing no, this is not done on purpose. Better testings and a higher coverage of functions is what we aim for.

@thijssteel

Copy link
Copy Markdown
Collaborator Author

I decided to remove the iterative refinement. I have tested that it works as expected. However, I can't even find any example that fails the threshhold (when 2x2 swaps fail, it fails at the calculation of dtgsy2). I suspect that Daan Camps used a more strict threshhold in his paper. The low diff coverage is also a consequence of the examples not failing the threshhold and should be ok to merge.

Additionally, lowering the threshhold or forcing iterative refinement some other way improves the backward error, but increases the error on the eigenvalues. If the accuracy ever becomes a problem, i'll have a look at implementing the svd swaps instead as those should also improve the error on the eigenvalues.

If you think it could be useful to add the refinement anyway in case there is a case where it actually works let me know, but it will not be covered by the unit tests.

@thijssteel thijssteel mentioned this pull request Jul 3, 2020
Comment thread TESTING/EIG/dchkec.f Resolved
@weslleyspereira

Copy link
Copy Markdown
Collaborator

Nice job @thijssteel ! I think we can accept it now. Thank you !

@langou langou reopened this Feb 10, 2021
@langou
langou merged commit eef896a into Reference-LAPACK:master Feb 10, 2021
christoph-conrads pushed a commit to christoph-conrads/lapack that referenced this pull request May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants