* Exceptional shift. Chosen for no particularly good reason.
* (Single shift only.)
*
- IF( ( DBLE( MAXIT )*SAFMIN )*ABS( H( ILAST-1, ILAST ) ).LT.
+ IF( ( DBLE( MAXIT )*SAFMIN )*ABS( H( ILAST, ILAST-1 ) ).LT.
$ ABS( T( ILAST-1, ILAST-1 ) ) ) THEN
- ESHIFT = ESHIFT + H( ILAST, ILAST-1 ) /
+ ESHIFT = H( ILAST, ILAST-1 ) /
$ T( ILAST-1, ILAST-1 )
ELSE
ESHIFT = ESHIFT + ONE / ( SAFMIN*DBLE( MAXIT ) )
$ T( ILAST-1, ILAST-1 ), LDT, SAFMIN*SAFETY, S1,
$ S2, WR, WR2, WI )
*
+ IF ( ABS( (WR/S1)*T( ILAST, ILAST ) - H( ILAST, ILAST ) )
+ $ .GT. ABS( (WR2/S2)*T( ILAST, ILAST )
+ $ - H( ILAST, ILAST ) ) ) THEN
+ TEMP = WR
+ WR = WR2
+ WR2 = TEMP
+ TEMP = S1
+ S1 = S2
+ S2 = TEMP
+ END IF
TEMP = MAX( S1, SAFMIN*MAX( ONE, ABS( WR ), ABS( WI ) ) )
IF( WI.NE.ZERO )
$ GO TO 200
* Exceptional shift. Chosen for no particularly good reason.
* (Single shift only.)
*
- IF( ( REAL( MAXIT )*SAFMIN )*ABS( H( ILAST-1, ILAST ) ).LT.
+ IF( ( REAL( MAXIT )*SAFMIN )*ABS( H( ILAST, ILAST-1 ) ).LT.
$ ABS( T( ILAST-1, ILAST-1 ) ) ) THEN
- ESHIFT = ESHIFT + H( ILAST, ILAST-1 ) /
+ ESHIFT = H( ILAST, ILAST-1 ) /
$ T( ILAST-1, ILAST-1 )
ELSE
ESHIFT = ESHIFT + ONE / ( SAFMIN*REAL( MAXIT ) )
$ T( ILAST-1, ILAST-1 ), LDT, SAFMIN*SAFETY, S1,
$ S2, WR, WR2, WI )
*
+ IF ( ABS( (WR/S1)*T( ILAST, ILAST ) - H( ILAST, ILAST ) )
+ $ .GT. ABS( (WR2/S2)*T( ILAST, ILAST )
+ $ - H( ILAST, ILAST ) ) ) THEN
+ TEMP = WR
+ WR = WR2
+ WR2 = TEMP
+ TEMP = S1
+ S1 = S2
+ S2 = TEMP
+ END IF
TEMP = MAX( S1, SAFMIN*MAX( ONE, ABS( WR ), ABS( WI ) ) )
IF( WI.NE.ZERO )
$ GO TO 200