1 SUBROUTINE dlasq3( I0, N0, Z, PP, DMIN, SIGMA, DESIG, QMAX, NFAIL,
11 INTEGER I0, ITER, N0, NDIV, NFAIL, PP
12 DOUBLE PRECISION DESIG, DMIN, QMAX, SIGMA
15 DOUBLE PRECISION Z( * )
70 DOUBLE PRECISION CBIAS
71 parameter( cbias = 1.50d0 )
72 DOUBLE PRECISION ZERO, QURTR, HALF, ONE, TWO, HUNDRD
73 parameter( zero = 0.0d0, qurtr = 0.250d0, half = 0.5d0,
74 $ one = 1.0d0, two = 2.0d0, hundrd = 100.0d0 )
77 INTEGER IPN4, J4, N0IN, NN, TTYPE
78 DOUBLE PRECISION DMIN1, DMIN2, DN, DN1, DN2, EPS, S, SAFMIN, T,
79 $ tau, temp, tol, tol2
85 DOUBLE PRECISION DLAMCH
89 INTRINSIC abs, min, sqrt
93 SAVE dmin1, dmin2, dn, dn1, dn2, tau
97 DATA dmin1 / zero /, dmin2 / zero /, dn / zero /,
98 $ dn1 / zero /, dn2 / zero /, tau / zero /
103 eps = dlamch(
'Precision' )
104 safmin = dlamch(
'Safe minimum' )
122 IF( z( nn-5 ).GT.tol2*( sigma+z( nn-3 ) ) .AND.
123 $ z( nn-2*pp-4 ).GT.tol2*z( nn-7 ) )
128 z( 4*n0-3 ) = z( 4*n0+pp-3 ) + sigma
136 IF( z( nn-9 ).GT.tol2*sigma .AND.
137 $ z( nn-2*pp-8 ).GT.tol2*z( nn-11 ) )
142 IF( z( nn-3 ).GT.z( nn-7 ) )
THEN
144 z( nn-3 ) = z( nn-7 )
147 IF( z( nn-5 ).GT.z( nn-3 )*tol2 )
THEN
148 t = half*( ( z( nn-7 )-z( nn-3 ) )+z( nn-5 ) )
149 s = z( nn-3 )*( z( nn-5 ) / t )
151 s = z( nn-3 )*( z( nn-5 ) /
152 $ ( t*( one+sqrt( one+s / t ) ) ) )
154 s = z( nn-3 )*( z( nn-5 ) / ( t+sqrt( t )*sqrt( t+s ) ) )
156 t = z( nn-7 ) + ( s+z( nn-5 ) )
157 z( nn-3 ) = z( nn-3 )*( z( nn-7 ) / t )
160 z( 4*n0-7 ) = z( nn-7 ) + sigma
161 z( 4*n0-3 ) = z( nn-3 ) + sigma
169 IF( dmin.LE.zero .OR. n0.LT.n0in )
THEN
170 IF( cbias*z( 4*i0+pp-3 ).LT.z( 4*n0+pp-3 ) )
THEN
172 DO 60 j4 = 4*i0, 2*( i0+n0-1 ), 4
174 z( j4-3 ) = z( ipn4-j4-3 )
175 z( ipn4-j4-3 ) = temp
177 z( j4-2 ) = z( ipn4-j4-2 )
178 z( ipn4-j4-2 ) = temp
180 z( j4-1 ) = z( ipn4-j4-5 )
181 z( ipn4-j4-5 ) = temp
183 z( j4 ) = z( ipn4-j4-4 )
184 z( ipn4-j4-4 ) = temp
186 IF( n0-i0.LE.4 )
THEN
187 z( 4*n0+pp-1 ) = z( 4*i0+pp-1 )
188 z( 4*n0-pp ) = z( 4*i0-pp )
190 dmin2 = min( dmin2, z( 4*n0+pp-1 ) )
191 z( 4*n0+pp-1 ) = min( z( 4*n0+pp-1 ), z( 4*i0+pp-1 ),
193 z( 4*n0-pp ) = min( z( 4*n0-pp ), z( 4*i0-pp ),
195 qmax = max( qmax, z( 4*i0+pp-3 ), z( 4*i0+pp+1 ) )
202 IF( dmin.LT.zero .OR. safmin*qmax.LT.min( z( 4*n0+pp-1 ),
203 $ z( 4*n0+pp-9 ), dmin2+z( 4*n0-pp ) ) )
THEN
207 CALL dlasq4( i0, n0, z, pp, n0in, dmin, dmin1, dmin2, dn, dn1,
214 CALL dlasq5( i0, n0, z, pp, tau, dmin, dmin1, dmin2, dn,
217 ndiv = ndiv + ( n0-i0+2 )
222 IF( dmin.GE.zero .AND. dmin1.GT.zero )
THEN
228 ELSE IF( dmin.LT.zero .AND. dmin1.GT.zero .AND.
229 $ z( 4*( n0-1 )-pp ).LT.tol*( sigma+dn1 ) .AND.
230 $ abs( dn ).LT.tol*sigma )
THEN
234 z( 4*( n0-1 )-pp+2 ) = zero
237 ELSE IF( dmin.LT.zero )
THEN
242 IF( ttype.LT.-22 )
THEN
247 ELSE IF( dmin1.GT.zero )
THEN
251 tau = ( tau+dmin )*( one-two*eps )
261 ELSE IF( dmin.NE.dmin )
THEN
278 CALL dlasq6( i0, n0, z, pp, dmin, dmin1, dmin2, dn, dn1, dn2 )
279 ndiv = ndiv + ( n0-i0+2 )
284 IF( tau.LT.sigma )
THEN
287 desig = desig - ( t-sigma )
290 desig = sigma - ( t-tau ) + desig
subroutine dlasq3(I0, N0, Z, PP, DMIN, SIGMA, DESIG, QMAX, NFAIL, ITER, NDIV, IEEE)
subroutine dlasq4(I0, N0, Z, PP, N0IN, DMIN, DMIN1, DMIN2, DN, DN1, DN2, TAU, TTYPE)
subroutine dlasq5(I0, N0, Z, PP, TAU, DMIN, DMIN1, DMIN2, DN, DNM1, DNM2, IEEE)
subroutine dlasq6(I0, N0, Z, PP, DMIN, DMIN1, DMIN2, DN, DNM1, DNM2)