150 SUBROUTINE zptt05( N, NRHS, D, E, B, LDB, X, LDX, XACT, LDXACT,
151 $ ferr, berr, reslts )
159 INTEGER LDB, LDX, LDXACT, N, NRHS
162 DOUBLE PRECISION BERR( * ), D( * ), FERR( * ), RESLTS( * )
163 COMPLEX*16 B( ldb, * ), E( * ), X( ldx, * ),
170 DOUBLE PRECISION ZERO, ONE
171 parameter ( zero = 0.0d+0, one = 1.0d+0 )
174 INTEGER I, IMAX, J, K, NZ
175 DOUBLE PRECISION AXBI, DIFF, EPS, ERRBND, OVFL, TMP, UNFL, XNORM
180 DOUBLE PRECISION DLAMCH
181 EXTERNAL izamax, dlamch
184 INTRINSIC abs, dble, dimag, max, min
187 DOUBLE PRECISION CABS1
190 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
196 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
202 eps = dlamch(
'Epsilon' )
203 unfl = dlamch(
'Safe minimum' )
213 imax = izamax( n, x( 1, j ), 1 )
214 xnorm = max( cabs1( x( imax, j ) ), unfl )
217 diff = max( diff, cabs1( x( i, j )-xact( i, j ) ) )
220 IF( xnorm.GT.one )
THEN
222 ELSE IF( diff.LE.ovfl*xnorm )
THEN
230 IF( diff / xnorm.LE.ferr( j ) )
THEN
231 errbnd = max( errbnd, ( diff / xnorm ) / ferr( j ) )
243 axbi = cabs1( b( 1, k ) ) + cabs1( d( 1 )*x( 1, k ) )
245 axbi = cabs1( b( 1, k ) ) + cabs1( d( 1 )*x( 1, k ) ) +
246 $ cabs1( e( 1 ) )*cabs1( x( 2, k ) )
248 tmp = cabs1( b( i, k ) ) + cabs1( e( i-1 ) )*
249 $ cabs1( x( i-1, k ) ) + cabs1( d( i )*x( i, k ) ) +
250 $ cabs1( e( i ) )*cabs1( x( i+1, k ) )
251 axbi = min( axbi, tmp )
253 tmp = cabs1( b( n, k ) ) + cabs1( e( n-1 ) )*
254 $ cabs1( x( n-1, k ) ) + cabs1( d( n )*x( n, k ) )
255 axbi = min( axbi, tmp )
257 tmp = berr( k ) / ( nz*eps+nz*unfl / max( axbi, nz*unfl ) )
261 reslts( 2 ) = max( reslts( 2 ), tmp )
subroutine zptt05(N, NRHS, D, E, B, LDB, X, LDX, XACT, LDXACT, FERR, BERR, RESLTS)
ZPTT05