392 $ af, ldaf, ipiv, colequ, c, b, ldb,
393 $ y, ldy, berr_out, n_norms,
394 $ err_bnds_norm, err_bnds_comp, res,
395 $ ayb, dy, y_tail, rcond, ithresh,
396 $ rthresh, dz_ub, ignore_cwise,
405 INTEGER info, lda, ldaf, ldb, ldy, n, nrhs, prec_type,
408 LOGICAL colequ, ignore_cwise
413 REAL a( lda, * ), af( ldaf, * ), b( ldb, * ),
414 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
415 REAL c( * ), ayb( * ), rcond, berr_out( * ),
416 $ err_bnds_norm( nrhs, * ),
417 $ err_bnds_comp( nrhs, * )
423 INTEGER uplo2, cnt, i, j, x_state, z_state
424 REAL yk, dyk, ymin, normy, normx, normdx, dxrat,
425 $ dzrat, prevnormdx, prev_dz_z, dxratmax,
426 $ dzratmax, dx_x, dz_z, final_dx_x, final_dz_z,
427 $ eps, hugeval, incr_thresh
428 LOGICAL incr_prec, upper
431 INTEGER unstable_state, working_state, conv_state,
432 $ noprog_state, y_prec_state, base_residual,
433 $ extra_residual, extra_y
434 parameter( unstable_state = 0, working_state = 1,
435 $ conv_state = 2, noprog_state = 3 )
436 parameter( base_residual = 0, extra_residual = 1,
438 INTEGER final_nrm_err_i, final_cmp_err_i, berr_i
439 INTEGER rcond_i, nrm_rcond_i, nrm_err_i, cmp_rcond_i
440 INTEGER cmp_err_i, piv_growth_i
441 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
443 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
444 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
446 INTEGER la_linrx_itref_i, la_linrx_ithresh_i,
448 parameter( la_linrx_itref_i = 1,
449 $ la_linrx_ithresh_i = 2 )
450 parameter( la_linrx_cwise_i = 3 )
451 INTEGER la_linrx_trust_i, la_linrx_err_i,
453 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
454 parameter( la_linrx_rcond_i = 3 )
468 INTRINSIC abs, max, min
473 upper =
lsame( uplo,
'U' )
474 IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
476 ELSE IF( n.LT.0 )
THEN
478 ELSE IF( nrhs.LT.0 )
THEN
480 ELSE IF( lda.LT.max( 1, n ) )
THEN
482 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
484 ELSE IF( ldb.LT.max( 1, n ) )
THEN
486 ELSE IF( ldy.LT.max( 1, n ) )
THEN
490 CALL
xerbla(
'SLA_SYRFSX_EXTENDED', -info )
494 hugeval =
slamch(
'Overflow' )
496 hugeval = hugeval * hugeval
498 incr_thresh =
REAL( n )*eps
500 IF (
lsame( uplo,
'L' ) )
THEN
507 y_prec_state = extra_residual
508 IF ( y_prec_state .EQ. extra_y )
THEN
525 x_state = working_state
526 z_state = unstable_state
534 CALL
scopy( n, b( 1, j ), 1, res, 1 )
535 IF (y_prec_state .EQ. base_residual)
THEN
536 CALL
ssymv( uplo, n, -1.0, a, lda, y(1,j), 1,
538 ELSE IF (y_prec_state .EQ. extra_residual)
THEN
539 CALL blas_ssymv_x( uplo2, n, -1.0, a, lda,
540 $ y( 1, j ), 1, 1.0, res, 1, prec_type )
542 CALL blas_ssymv2_x(uplo2, n, -1.0, a, lda,
543 $ y(1, j), y_tail, 1, 1.0, res, 1, prec_type)
547 CALL
scopy( n, res, 1, dy, 1 )
548 CALL
ssytrs( uplo, n, 1, af, ldaf, ipiv, dy, n, info )
559 yk = abs( y( i, j ) )
562 IF ( yk .NE. 0.0 )
THEN
563 dz_z = max( dz_z, dyk / yk )
564 ELSE IF ( dyk .NE. 0.0 )
THEN
568 ymin = min( ymin, yk )
570 normy = max( normy, yk )
573 normx = max( normx, yk * c( i ) )
574 normdx = max( normdx, dyk * c( i ) )
577 normdx = max(normdx, dyk)
581 IF ( normx .NE. 0.0 )
THEN
582 dx_x = normdx / normx
583 ELSE IF ( normdx .EQ. 0.0 )
THEN
589 dxrat = normdx / prevnormdx
590 dzrat = dz_z / prev_dz_z
594 IF ( ymin*rcond .LT. incr_thresh*normy
595 $ .AND. y_prec_state .LT. extra_y )
598 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
599 $ x_state = working_state
600 IF ( x_state .EQ. working_state )
THEN
601 IF ( dx_x .LE. eps )
THEN
603 ELSE IF ( dxrat .GT. rthresh )
THEN
604 IF ( y_prec_state .NE. extra_y )
THEN
607 x_state = noprog_state
610 IF ( dxrat .GT. dxratmax ) dxratmax = dxrat
612 IF ( x_state .GT. working_state ) final_dx_x = dx_x
615 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
616 $ z_state = working_state
617 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
618 $ z_state = working_state
619 IF ( z_state .EQ. working_state )
THEN
620 IF ( dz_z .LE. eps )
THEN
622 ELSE IF ( dz_z .GT. dz_ub )
THEN
623 z_state = unstable_state
626 ELSE IF ( dzrat .GT. rthresh )
THEN
627 IF ( y_prec_state .NE. extra_y )
THEN
630 z_state = noprog_state
633 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
635 IF ( z_state .GT. working_state ) final_dz_z = dz_z
638 IF ( x_state.NE.working_state.AND.
639 $ ( ignore_cwise.OR.z_state.NE.working_state ) )
642 IF ( incr_prec )
THEN
644 y_prec_state = y_prec_state + 1
655 IF (y_prec_state .LT. extra_y)
THEN
656 CALL
saxpy( n, 1.0, dy, 1, y(1,j), 1 )
667 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
668 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
672 IF ( n_norms .GE. 1 )
THEN
673 err_bnds_norm( j, la_linrx_err_i ) =
674 $ final_dx_x / (1 - dxratmax)
676 IF ( n_norms .GE. 2 )
THEN
677 err_bnds_comp( j, la_linrx_err_i ) =
678 $ final_dz_z / (1 - dzratmax)
688 CALL
scopy( n, b( 1, j ), 1, res, 1 )
689 CALL
ssymv( uplo, n, -1.0, a, lda, y(1,j), 1, 1.0, res, 1 )
692 ayb( i ) = abs( b( i, j ) )
698 $ a, lda, y(1, j), 1, 1.0, ayb, 1 )