189 SUBROUTINE ztbt05( UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, B,
190 $ ldb, x, ldx, xact, ldxact, ferr, berr, reslts )
198 CHARACTER diag, trans, uplo
199 INTEGER kd, ldab, ldb, ldx, ldxact, n, nrhs
202 DOUBLE PRECISION berr( * ), ferr( * ), reslts( * )
203 COMPLEX*16 ab( ldab, * ), b( ldb, * ), x( ldx, * ),
210 DOUBLE PRECISION zero, one
211 parameter( zero = 0.0d+0, one = 1.0d+0 )
214 LOGICAL notran, unit, upper
215 INTEGER i, ifu, imax, j, k, nz
216 DOUBLE PRECISION axbi, diff, eps, errbnd, ovfl, tmp, unfl, xnorm
226 INTRINSIC abs, dble, dimag, max, min
229 DOUBLE PRECISION cabs1
232 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
238 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
245 unfl =
dlamch(
'Safe minimum' )
247 upper =
lsame( uplo,
'U' )
248 notran =
lsame( trans,
'N' )
249 unit =
lsame( diag,
'U' )
250 nz = min( kd, n-1 ) + 1
258 imax =
izamax( n, x( 1, j ), 1 )
259 xnorm = max( cabs1( x( imax, j ) ), unfl )
262 diff = max( diff, cabs1( x( i, j )-xact( i, j ) ) )
265 IF( xnorm.GT.one )
THEN
267 ELSE IF( diff.LE.ovfl*xnorm )
THEN
275 IF( diff / xnorm.LE.ferr( j ) )
THEN
276 errbnd = max( errbnd, ( diff / xnorm ) / ferr( j ) )
291 tmp = cabs1( b( i, k ) )
293 IF( .NOT.notran )
THEN
294 DO 40 j = max( i-kd, 1 ), i - ifu
295 tmp = tmp + cabs1( ab( kd+1-i+j, i ) )*
299 $ tmp = tmp + cabs1( x( i, k ) )
302 $ tmp = tmp + cabs1( x( i, k ) )
303 DO 50 j = i + ifu, min( i+kd, n )
304 tmp = tmp + cabs1( ab( kd+1+i-j, j ) )*
310 DO 60 j = max( i-kd, 1 ), i - ifu
311 tmp = tmp + cabs1( ab( 1+i-j, j ) )*
315 $ tmp = tmp + cabs1( x( i, k ) )
318 $ tmp = tmp + cabs1( x( i, k ) )
319 DO 70 j = i + ifu, min( i+kd, n )
320 tmp = tmp + cabs1( ab( 1+j-i, i ) )*
328 axbi = min( axbi, tmp )
331 tmp = berr( k ) / ( nz*eps+nz*unfl / max( axbi, nz*unfl ) )
335 reslts( 2 ) = max( reslts( 2 ), tmp )