127 SUBROUTINE dstt21( N, KBAND, AD, AE, SD, SE, U, LDU, WORK,
136 INTEGER kband, ldu, n
139 DOUBLE PRECISION ad( * ), ae( * ), result( 2 ), sd( * ),
140 $ se( * ), u( ldu, * ), work( * )
146 DOUBLE PRECISION zero, one
147 parameter( zero = 0.0d0, one = 1.0d0 )
151 DOUBLE PRECISION anorm, temp1, temp2, ulp, unfl, wnorm
161 INTRINSIC abs, dble, max, min
172 unfl =
dlamch(
'Safe minimum' )
173 ulp =
dlamch(
'Precision' )
179 CALL
dlaset(
'Full', n, n, zero, zero, work, n )
185 work( ( n+1 )*( j-1 )+1 ) = ad( j )
186 work( ( n+1 )*( j-1 )+2 ) = ae( j )
187 temp2 = abs( ae( j ) )
188 anorm = max( anorm, abs( ad( j ) )+temp1+temp2 )
192 work( n**2 ) = ad( n )
193 anorm = max( anorm, abs( ad( n ) )+temp1, unfl )
198 CALL
dsyr(
'L', n, -sd( j ), u( 1, j ), 1, work, n )
201 IF( n.GT.1 .AND. kband.EQ.1 )
THEN
203 CALL
dsyr2(
'L', n, -se( j ), u( 1, j ), 1, u( 1, j+1 ), 1,
208 wnorm =
dlansy(
'1',
'L', n, work, n, work( n**2+1 ) )
210 IF( anorm.GT.wnorm )
THEN
211 result( 1 ) = ( wnorm / anorm ) / ( n*ulp )
213 IF( anorm.LT.one )
THEN
214 result( 1 ) = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
216 result( 1 ) = min( wnorm / anorm, dble( n ) ) / ( n*ulp )
224 CALL
dgemm(
'N',
'C', n, n, n, one, u, ldu, u, ldu, zero, work,
228 work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - one
231 result( 2 ) = min( dble( n ),
dlange(
'1', n, n, work, n,
232 $ work( n**2+1 ) ) ) / ( n*ulp )