Repository navigation
dbbcsd/sbbcsd/cbbcsd/zbbcsd: fix insufficiently accurate U2 in CS dec… - #1293
Merged
Merged
Conversation
…omposition The Golub-Reinsch-SVD-style iteration in xBBCSD used an absolute convergence threshold THRESH ~ 90*EPS to decide when off-diagonal bulges are negligible and can be skipped. For rows where the diagonal entries are small (tiny singular values in the ratio), this absolute threshold is too large relative to the diagonal, causing the algorithm to stop chasing bulges prematurely and producing inaccurate singular vectors (||X21 - U2 D2 V^*|| up to 50*EPS ||X21||). Fix: change all bulge-convergence checks (RESTART flags in the inner loop, initial bulge-chase decisions, and the IMAX-1 cleanup) from absolute to relative by scaling THRESH by the adjacent diagonal entries: RESTART11 = |B11E|^2+|BULGE|^2 <= (THRESH * MAX(|B11D(I-1)|,|B11D(I)|,UNFL))^2 This mirrors DBDSQR's relative convergence check |E| <= TOL*|D|. Applied to all 4 bidiagonal blocks (B11/B21/B12/B22) at all 3 check-points in the iteration. Fixes Reference-LAPACK#965
langou
approved these changes
Jun 13, 2026
ilayn
added a commit
to ilayn/semicolon-lapack
that referenced
this pull request
Jun 21, 2026
…#1293) Scale the absolute convergence threshold by the adjacent diagonal magnitudes so small singular-value rows are not deflated prematurely, fixing inaccurate U2 in the CS decomposition. Port of Reference-LAPACK a73f4a65 (Reference-LAPACK/lapack#1293).
ilayn
added a commit
to ilayn/semicolon-lapack
that referenced
this pull request
Jun 21, 2026
…#1293) Scale the absolute convergence threshold by the adjacent diagonal magnitudes so small singular-value rows are not deflated prematurely, fixing inaccurate U2 in the CS decomposition. Port of Reference-LAPACK a73f4a65 (Reference-LAPACK/lapack#1293).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…omposition
The Golub-Reinsch-SVD-style iteration in xBBCSD used an absolute convergence threshold THRESH ~ 90EPS to decide when off-diagonal bulges are negligible and can be skipped. For rows where the diagonal entries are small (tiny singular values in the ratio), this absolute threshold is too large relative to the diagonal, causing the algorithm to stop chasing bulges prematurely and producing inaccurate singular vectors (||X21 - U2 D2 V^|| up to 50*EPS ||X21||).
Fix: change all bulge-convergence checks (RESTART flags in the inner loop, initial bulge-chase decisions, and the IMAX-1 cleanup) from absolute to relative by scaling THRESH by the adjacent diagonal entries:
RESTART11 = |B11E|^2+|BULGE|^2 <= (THRESH * MAX(|B11D(I-1)|,|B11D(I)|,UNFL))^2
This mirrors DBDSQR's relative convergence check |E| <= TOL*|D|. Applied to all 4 bidiagonal blocks (B11/B21/B12/B22) at all 3 check-points in the iteration.
Fixes #965