91 SUBROUTINE zptt01( N, D, E, DF, EF, WORK, RESID )
99 DOUBLE PRECISION RESID
102 DOUBLE PRECISION D( * ), DF( * )
103 COMPLEX*16 E( * ), EF( * ), WORK( * )
109 DOUBLE PRECISION ONE, ZERO
110 parameter( one = 1.0d+0, zero = 0.0d+0 )
114 DOUBLE PRECISION ANORM, EPS
118 DOUBLE PRECISION DLAMCH
122 INTRINSIC abs, dble, dconjg, max
133 eps = dlamch(
'Epsilon' )
137 work( 1 ) = df( 1 ) - d( 1 )
140 work( n+i ) = de - e( i )
141 work( 1+i ) = de*dconjg( ef( i ) ) + df( i+1 ) - d( i+1 )
148 resid = abs( work( 1 ) )
150 anorm = max( d( 1 )+abs( e( 1 ) ), d( n )+abs( e( n-1 ) ) )
151 resid = max( abs( work( 1 ) )+abs( work( n+1 ) ),
152 $ abs( work( n ) )+abs( work( 2*n-1 ) ) )
154 anorm = max( anorm, d( i )+abs( e( i ) )+abs( e( i-1 ) ) )
155 resid = max( resid, abs( work( i ) )+abs( work( n+i-1 ) )+
156 $ abs( work( n+i ) ) )
162 IF( anorm.LE.zero )
THEN
166 resid = ( ( resid / dble( n ) ) / anorm ) / eps
subroutine zptt01(n, d, e, df, ef, work, resid)
ZPTT01