diff --git a/lapack-netlib/TESTING/EIG/cchkhs.f b/lapack-netlib/TESTING/EIG/cchkhs.f index a9224f2f2d..34fd0317c3 100644 --- a/lapack-netlib/TESTING/EIG/cchkhs.f +++ b/lapack-netlib/TESTING/EIG/cchkhs.f @@ -467,8 +467,8 @@ SUBROUTINE CCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, $ JJ, JSIZE, JTYPE, K, MTYPES, N, N1, NERRS, $ NMATS, NMAX, NTEST, NTESTT REAL ANINV, ANORM, COND, CONDS, OVFL, RTOVFL, RTULP, - $ RTULPI, RTUNFL, SJ, TEMP1, TEMP2, ULP, ULPINV, - $ UNFL, XNORM, YNORM + $ RTULPI, RTUNFL, SJ, TEMP1, TEMP2, TEMP3, ULP, + $ ULPINV, UNFL, XNORM, YNORM * .. * .. Local Arrays .. INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KCONDS( MAXTYP ), @@ -956,11 +956,10 @@ SUBROUTINE CCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * eigenvalue j of T1, is what makes the comparison meaningful. * A backward error eps in H moves that eigenvalue by * eps / s(j), so the two can only be asked to agree to within -* |dW(j)| s(j); s(j) = 1 for a normal matrix. Eigenvalues -* with s(j) < sqrt(ulp) are skipped: those are the ones the -* two paths have been seen to return in a different order, -* which the index-wise comparison could not tell apart from a -* real error. +* |dW(j)| s(j); s(j) = 1 for a normal matrix. The two +* paths may return the eigenvalues in a different order, so +* each eigenvalue of W1 is compared with the nearest one of +* W3. Eigenvalues with s(j) < sqrt(ulp) are skipped. * NTEST = 11 RESULT( 11 ) = ULPINV @@ -972,8 +971,13 @@ SUBROUTINE CCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, SJ = ABS( CDOTC( N, EVECTL( 1, J ), 1, $ EVECTR( 1, J ), 1 ) ) / MAX( XNORM*YNORM, UNFL ) TEMP1 = MAX( TEMP1, ABS( W1( J ) ), ABS( W3( J ) ) ) - IF( SJ.GE.RTULP ) - $ TEMP2 = MAX( TEMP2, SJ*ABS( W1( J )-W3( J ) ) ) + IF( SJ.GE.RTULP ) THEN + TEMP3 = ABS( W1( J )-W3( 1 ) ) + DO 154 I = 2, N + TEMP3 = MIN( TEMP3, ABS( W1( J )-W3( I ) ) ) + 154 CONTINUE + TEMP2 = MAX( TEMP2, SJ*TEMP3 ) + END IF 155 CONTINUE * RESULT( 11 ) = TEMP2 / MAX( UNFL, ULP*MAX( TEMP1, TEMP2 ) ) diff --git a/lapack-netlib/TESTING/EIG/dchkhs.f b/lapack-netlib/TESTING/EIG/dchkhs.f index a79302c1c9..3a4d396c54 100644 --- a/lapack-netlib/TESTING/EIG/dchkhs.f +++ b/lapack-netlib/TESTING/EIG/dchkhs.f @@ -460,7 +460,7 @@ SUBROUTINE DCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, $ NMATS, NMAX, NSELC, NSELR, NTEST, NTESTT DOUBLE PRECISION ANINV, ANORM, COND, CONDS, OVFL, PRODI, PRODR, $ RTOVFL, RTULP, RTULPI, RTUNFL, SJ, TEMP1, - $ TEMP2, ULP, ULPINV, UNFL, XNORM, YNORM + $ TEMP2, TEMP3, ULP, ULPINV, UNFL, XNORM, YNORM * .. * .. Local Arrays .. CHARACTER ADUMMA( 1 ) @@ -978,11 +978,10 @@ SUBROUTINE DCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * eigenvalue j of T1, is what makes the comparison meaningful. * A backward error eps in H moves that eigenvalue by * eps / s(j), so the two can only be asked to agree to within -* |dW(j)| s(j); s(j) = 1 for a normal matrix. Eigenvalues -* with s(j) < sqrt(ulp) are skipped: those are the ones the -* two paths have been seen to return in a different order, -* which the index-wise comparison could not tell apart from a -* real error. +* |dW(j)| s(j); s(j) = 1 for a normal matrix. The two +* paths may return the eigenvalues in a different order, so +* each eigenvalue of W1 is compared with the nearest one of +* W3. Eigenvalues with s(j) < sqrt(ulp) are skipped. * NTEST = 11 RESULT( 11 ) = ULPINV @@ -1017,9 +1016,15 @@ SUBROUTINE DCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, SJ = SJ / MAX( XNORM*YNORM, UNFL ) TEMP1 = MAX( TEMP1, ABS( WR1( J ) )+ABS( WI1( J ) ), $ ABS( WR3( J ) )+ABS( WI3( J ) ) ) - IF( SJ.GE.RTULP ) - $ TEMP2 = MAX( TEMP2, SJ*( ABS( WR1( J )-WR3( J ) )+ - $ ABS( WI1( J )-WI3( J ) ) ) ) + IF( SJ.GE.RTULP ) THEN + TEMP3 = ABS( WR1( J )-WR3( 1 ) ) + + $ ABS( WI1( J )-WI3( 1 ) ) + DO 154 I = 2, N + TEMP3 = MIN( TEMP3, ABS( WR1( J )-WR3( I ) )+ + $ ABS( WI1( J )-WI3( I ) ) ) + 154 CONTINUE + TEMP2 = MAX( TEMP2, SJ*TEMP3 ) + END IF 155 CONTINUE * RESULT( 11 ) = TEMP2 / MAX( UNFL, ULP*MAX( TEMP1, TEMP2 ) ) diff --git a/lapack-netlib/TESTING/EIG/schkhs.f b/lapack-netlib/TESTING/EIG/schkhs.f index ad9b649b30..175ca8fe63 100644 --- a/lapack-netlib/TESTING/EIG/schkhs.f +++ b/lapack-netlib/TESTING/EIG/schkhs.f @@ -459,7 +459,7 @@ SUBROUTINE SCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, $ NMATS, NMAX, NSELC, NSELR, NTEST, NTESTT REAL ANINV, ANORM, COND, CONDS, OVFL, PRODI, PRODR, $ RTOVFL, RTULP, RTULPI, RTUNFL, SJ, TEMP1, - $ TEMP2, ULP, ULPINV, UNFL, XNORM, YNORM + $ TEMP2, TEMP3, ULP, ULPINV, UNFL, XNORM, YNORM * .. * .. Local Arrays .. CHARACTER ADUMMA( 1 ) @@ -977,11 +977,10 @@ SUBROUTINE SCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * eigenvalue j of T1, is what makes the comparison meaningful. * A backward error eps in H moves that eigenvalue by * eps / s(j), so the two can only be asked to agree to within -* |dW(j)| s(j); s(j) = 1 for a normal matrix. Eigenvalues -* with s(j) < sqrt(ulp) are skipped: those are the ones the -* two paths have been seen to return in a different order, -* which the index-wise comparison could not tell apart from a -* real error. +* |dW(j)| s(j); s(j) = 1 for a normal matrix. The two +* paths may return the eigenvalues in a different order, so +* each eigenvalue of W1 is compared with the nearest one of +* W3. Eigenvalues with s(j) < sqrt(ulp) are skipped. * NTEST = 11 RESULT( 11 ) = ULPINV @@ -1016,9 +1015,15 @@ SUBROUTINE SCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, SJ = SJ / MAX( XNORM*YNORM, UNFL ) TEMP1 = MAX( TEMP1, ABS( WR1( J ) )+ABS( WI1( J ) ), $ ABS( WR3( J ) )+ABS( WI3( J ) ) ) - IF( SJ.GE.RTULP ) - $ TEMP2 = MAX( TEMP2, SJ*( ABS( WR1( J )-WR3( J ) )+ - $ ABS( WI1( J )-WI3( J ) ) ) ) + IF( SJ.GE.RTULP ) THEN + TEMP3 = ABS( WR1( J )-WR3( 1 ) ) + + $ ABS( WI1( J )-WI3( 1 ) ) + DO 154 I = 2, N + TEMP3 = MIN( TEMP3, ABS( WR1( J )-WR3( I ) )+ + $ ABS( WI1( J )-WI3( I ) ) ) + 154 CONTINUE + TEMP2 = MAX( TEMP2, SJ*TEMP3 ) + END IF 155 CONTINUE * RESULT( 11 ) = TEMP2 / MAX( UNFL, ULP*MAX( TEMP1, TEMP2 ) ) diff --git a/lapack-netlib/TESTING/EIG/zchkhs.f b/lapack-netlib/TESTING/EIG/zchkhs.f index e93ee29c1f..019d30d14c 100644 --- a/lapack-netlib/TESTING/EIG/zchkhs.f +++ b/lapack-netlib/TESTING/EIG/zchkhs.f @@ -467,8 +467,8 @@ SUBROUTINE ZCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, $ JJ, JSIZE, JTYPE, K, MTYPES, N, N1, NERRS, $ NMATS, NMAX, NTEST, NTESTT DOUBLE PRECISION ANINV, ANORM, COND, CONDS, OVFL, RTOVFL, RTULP, - $ RTULPI, RTUNFL, SJ, TEMP1, TEMP2, ULP, ULPINV, - $ UNFL, XNORM, YNORM + $ RTULPI, RTUNFL, SJ, TEMP1, TEMP2, TEMP3, ULP, + $ ULPINV, UNFL, XNORM, YNORM * .. * .. Local Arrays .. INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KCONDS( MAXTYP ), @@ -956,11 +956,10 @@ SUBROUTINE ZCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, * eigenvalue j of T1, is what makes the comparison meaningful. * A backward error eps in H moves that eigenvalue by * eps / s(j), so the two can only be asked to agree to within -* |dW(j)| s(j); s(j) = 1 for a normal matrix. Eigenvalues -* with s(j) < sqrt(ulp) are skipped: those are the ones the -* two paths have been seen to return in a different order, -* which the index-wise comparison could not tell apart from a -* real error. +* |dW(j)| s(j); s(j) = 1 for a normal matrix. The two +* paths may return the eigenvalues in a different order, so +* each eigenvalue of W1 is compared with the nearest one of +* W3. Eigenvalues with s(j) < sqrt(ulp) are skipped. * NTEST = 11 RESULT( 11 ) = ULPINV @@ -972,8 +971,13 @@ SUBROUTINE ZCHKHS( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH, SJ = ABS( ZDOTC( N, EVECTL( 1, J ), 1, $ EVECTR( 1, J ), 1 ) ) / MAX( XNORM*YNORM, UNFL ) TEMP1 = MAX( TEMP1, ABS( W1( J ) ), ABS( W3( J ) ) ) - IF( SJ.GE.RTULP ) - $ TEMP2 = MAX( TEMP2, SJ*ABS( W1( J )-W3( J ) ) ) + IF( SJ.GE.RTULP ) THEN + TEMP3 = ABS( W1( J )-W3( 1 ) ) + DO 154 I = 2, N + TEMP3 = MIN( TEMP3, ABS( W1( J )-W3( I ) ) ) + 154 CONTINUE + TEMP2 = MAX( TEMP2, SJ*TEMP3 ) + END IF 155 CONTINUE * RESULT( 11 ) = TEMP2 / MAX( UNFL, ULP*MAX( TEMP1, TEMP2 ) )