154 SUBROUTINE zget54( N, A, LDA, B, LDB, S, LDS, T, LDT, U, LDU, V,
155 $ LDV, WORK, RESULT )
162 INTEGER LDA, LDB, LDS, LDT, LDU, LDV, N
163 DOUBLE PRECISION RESULT
166 COMPLEX*16 A( LDA, * ), B( LDB, * ), S( LDS, * ),
167 $ t( ldt, * ), u( ldu, * ), v( ldv, * ),
174 DOUBLE PRECISION ZERO, ONE
175 parameter( zero = 0.0d+0, one = 1.0d+0 )
176 COMPLEX*16 CZERO, CONE
177 parameter( czero = ( 0.0d+0, 0.0d+0 ),
178 $ cone = ( 1.0d+0, 0.0d+0 ) )
181 DOUBLE PRECISION ABNORM, ULP, UNFL, WNORM
184 DOUBLE PRECISION DUM( 1 )
187 DOUBLE PRECISION DLAMCH, ZLANGE
188 EXTERNAL dlamch, zlange
194 INTRINSIC dble, max, min
204 unfl = dlamch(
'Safe minimum' )
205 ulp = dlamch(
'Epsilon' )*dlamch(
'Base' )
209 CALL zlacpy(
'Full', n, n, a, lda, work, n )
210 CALL zlacpy(
'Full', n, n, b, ldb, work( n*n+1 ), n )
211 abnorm = max( zlange(
'1', n, 2*n, work, n, dum ), unfl )
215 CALL zlacpy(
' ', n, n, a, lda, work, n )
216 CALL zgemm(
'N',
'N', n, n, n, cone, u, ldu, s, lds, czero,
219 CALL zgemm(
'N',
'C', n, n, n, -cone, work( n*n+1 ), n, v, ldv,
224 CALL zlacpy(
' ', n, n, b, ldb, work( n*n+1 ), n )
225 CALL zgemm(
'N',
'N', n, n, n, cone, u, ldu, t, ldt, czero,
226 $ work( 2*n*n+1 ), n )
228 CALL zgemm(
'N',
'C', n, n, n, -cone, work( 2*n*n+1 ), n, v, ldv,
229 $ cone, work( n*n+1 ), n )
233 wnorm = zlange(
'1', n, 2*n, work, n, dum )
235 IF( abnorm.GT.wnorm )
THEN
236 result = ( wnorm / abnorm ) / ( 2*n*ulp )
238 IF( abnorm.LT.one )
THEN
239 result = ( min( wnorm, 2*n*abnorm ) / abnorm ) / ( 2*n*ulp )
241 result = min( wnorm / abnorm, dble( 2*n ) ) / ( 2*n*ulp )
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zget54(n, a, lda, b, ldb, s, lds, t, ldt, u, ldu, v, ldv, work, result)
ZGET54