1 SUBROUTINE cpot05( UPLO, N, NRHS, A, LDA, B, LDB, X, LDX, XACT,
2 $ ldxact, ferr, berr, reslts )
10 INTEGER lda, ldb, ldx, ldxact, n, nrhs
13 REAL berr( * ), ferr( * ), reslts( * )
14 COMPLEX a( lda, * ), b( ldb, * ), x( ldx, * ),
104 parameter( zero = 0.0e+0, one = 1.0e+0 )
108 INTEGER i, imax, j, k
109 REAL axbi, diff, eps, errbnd, ovfl, tmp, unfl, xnorm
116 EXTERNAL lsame, icamax, slamch
119 INTRINSIC abs, aimag,
max,
min, real
125 cabs1( zdum ) = abs(
REAL( ZDUM ) ) + abs( aimag( zdum ) )
131 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
137 eps = slamch(
'Epsilon' )
138 unfl = slamch(
'Safe minimum' )
140 upper = lsame(
uplo,
'U' )
148 imax = icamax( n, x( 1, j ), 1 )
149 xnorm =
max( cabs1( x( imax, j ) ), unfl )
152 diff =
max( diff, cabs1( x( i, j )-xact( i, j ) ) )
155 IF( xnorm.GT.one )
THEN
157 ELSE IF( diff.LE.ovfl*xnorm )
THEN
165 IF( diff / xnorm.LE.ferr( j ) )
THEN
166 errbnd =
max( errbnd, ( diff / xnorm ) / ferr( j ) )
178 tmp = cabs1( b( i, k ) )
181 tmp = tmp + cabs1( a( j, i ) )*cabs1( x( j, k ) )
183 tmp = tmp + abs(
REAL( A( I, I ) ) )*cabs1( x( i, k ) )
185 tmp = tmp + cabs1( a( i, j ) )*cabs1( x( j, k ) )
189 tmp = tmp + cabs1( a( i, j ) )*cabs1( x( j, k ) )
191 tmp = tmp + abs(
REAL( A( I, I ) ) )*cabs1( x( i, k ) )
193 tmp = tmp + cabs1( a( j, i ) )*cabs1( x( j, k ) )
199 axbi =
min( axbi, tmp )
202 tmp = berr( k ) / ( ( n+1 )*eps+( n+1 )*unfl /
203 $
max( axbi, ( n+1 )*unfl ) )
207 reslts( 2 ) =
max( reslts( 2 ), tmp )