From 1d6b882076d1c3eeec07eed05c42aa5bb5f17667 Mon Sep 17 00:00:00 2001 From: Christoph Conrads Date: Fri, 29 Dec 2023 15:28:45 +0100 Subject: [PATCH] {D,Z}BBCSD: stricter zero criterion The tolerance below which matrix entries are considered zero is tightened to avoid insufficiently accurate singular vectors. fixes #965 --- SRC/dbbcsd.f | 4 ++-- SRC/zbbcsd.f | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SRC/dbbcsd.f b/SRC/dbbcsd.f index 49a73a13e8..0c94743822 100644 --- a/SRC/dbbcsd.f +++ b/SRC/dbbcsd.f @@ -302,7 +302,7 @@ * ========================= *> *> \verbatim -*> TOLMUL DOUBLE PRECISION, default = MAX(10,MIN(100,EPS**(-1/8))) +*> TOLMUL DOUBLE PRECISION, default = 10 *> TOLMUL controls the convergence criterion of the QR loop. *> Angles THETA(i), PHI(i) are rounded to 0 or PI/2 when they *> are within TOLMUL*EPS of either bound. @@ -451,7 +451,7 @@ SUBROUTINE DBBCSD( JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, M, P, Q, * EPS = DLAMCH( 'Epsilon' ) UNFL = DLAMCH( 'Safe minimum' ) - TOLMUL = MAX( TEN, MIN( HUNDRED, EPS**MEIGHTH ) ) + TOLMUL = TEN TOL = TOLMUL*EPS THRESH = MAX( TOL, MAXITR*Q*Q*UNFL ) * diff --git a/SRC/zbbcsd.f b/SRC/zbbcsd.f index 67f3cbdb90..4083b2738f 100644 --- a/SRC/zbbcsd.f +++ b/SRC/zbbcsd.f @@ -302,7 +302,7 @@ * ========================= *> *> \verbatim -*> TOLMUL DOUBLE PRECISION, default = MAX(10,MIN(100,EPS**(-1/8))) +*> TOLMUL DOUBLE PRECISION, default = 10 *> TOLMUL controls the convergence criterion of the QR loop. *> Angles THETA(i), PHI(i) are rounded to 0 or PI/2 when they *> are within TOLMUL*EPS of either bound. @@ -450,7 +450,7 @@ SUBROUTINE ZBBCSD( JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, M, P, Q, * EPS = DLAMCH( 'Epsilon' ) UNFL = DLAMCH( 'Safe minimum' ) - TOLMUL = MAX( TEN, MIN( HUNDRED, EPS**MEIGHTH ) ) + TOLMUL = TEN TOL = TOLMUL*EPS THRESH = MAX( TOL, MAXITR*Q*Q*UNFL ) *