149 SUBROUTINE dlasq4( I0, N0, Z, PP, N0IN, DMIN, DMIN1, DMIN2, DN,
150 $ DN1, DN2, TAU, TTYPE, G )
157 INTEGER I0, N0, N0IN, PP, TTYPE
158 DOUBLE PRECISION DMIN, DMIN1, DMIN2, DN, DN1, DN2, G, TAU
161 DOUBLE PRECISION Z( * )
167 DOUBLE PRECISION CNST1, CNST2, CNST3
168 parameter( cnst1 = 0.5630d0, cnst2 = 1.010d0,
170 DOUBLE PRECISION QURTR, THIRD, HALF, ZERO, ONE, TWO, HUNDRD
171 parameter( qurtr = 0.250d0, third = 0.3330d0,
172 $ half = 0.50d0, zero = 0.0d0, one = 1.0d0,
173 $ two = 2.0d0, hundrd = 100.0d0 )
177 DOUBLE PRECISION A2, B1, B2, GAM, GAP1, GAP2, S
180 INTRINSIC max, min, sqrt
187 IF( dmin.LE.zero )
THEN
194 IF( n0in.EQ.n0 )
THEN
198 IF( dmin.EQ.dn .OR. dmin.EQ.dn1 )
THEN
200 b1 = sqrt( z( nn-3 ) )*sqrt( z( nn-5 ) )
201 b2 = sqrt( z( nn-7 ) )*sqrt( z( nn-9 ) )
202 a2 = z( nn-7 ) + z( nn-5 )
206 IF( dmin.EQ.dn .AND. dmin1.EQ.dn1 )
THEN
207 gap2 = dmin2 - a2 - dmin2*qurtr
208 IF( gap2.GT.zero .AND. gap2.GT.b2 )
THEN
209 gap1 = a2 - dn - ( b2 / gap2 )*b2
211 gap1 = a2 - dn - ( b1+b2 )
213 IF( gap1.GT.zero .AND. gap1.GT.b1 )
THEN
214 s = max( dn-( b1 / gap1 )*b1, half*dmin )
220 IF( a2.GT.( b1+b2 ) )
221 $ s = min( s, a2-( b1+b2 ) )
222 s = max( s, third*dmin )
231 IF( dmin.EQ.dn )
THEN
234 IF( z( nn-5 ) .GT. z( nn-7 ) )
236 b2 = z( nn-5 ) / z( nn-7 )
241 IF( z( np-4 ) .GT. z( np-2 ) )
243 a2 = z( np-4 ) / z( np-2 )
244 IF( z( nn-9 ) .GT. z( nn-11 ) )
246 b2 = z( nn-9 ) / z( nn-11 )
253 DO 10 i4 = np, 4*i0 - 1 + pp, -4
257 IF( z( i4 ) .GT. z( i4-2 ) )
259 b2 = b2*( z( i4 ) / z( i4-2 ) )
261 IF( hundrd*max( b2, b1 ).LT.a2 .OR. cnst1.LT.a2 )
270 $ s = gam*( one-sqrt( a2 ) ) / ( one+a2 )
272 ELSE IF( dmin.EQ.dn2 )
THEN
285 IF( z( np-8 ).GT.b2 .OR. z( np-4 ).GT.b1 )
287 a2 = ( z( np-8 ) / b2 )*( one+z( np-4 ) / b1 )
291 IF( n0-i0.GT.2 )
THEN
292 b2 = z( nn-13 ) / z( nn-15 )
294 DO 30 i4 = nn - 17, 4*i0 - 1 + pp, -4
298 IF( z( i4 ) .GT. z( i4-2 ) )
300 b2 = b2*( z( i4 ) / z( i4-2 ) )
302 IF( hundrd*max( b2, b1 ).LT.a2 .OR. cnst1.LT.a2 )
310 $ s = gam*( one-sqrt( a2 ) ) / ( one+a2 )
315 IF( ttype.EQ.-6 )
THEN
316 g = g + third*( one-g )
317 ELSE IF( ttype.EQ.-18 )
THEN
326 ELSE IF( n0in.EQ.( n0+1 ) )
THEN
330 IF( dmin1.EQ.dn1 .AND. dmin2.EQ.dn2 )
THEN
336 IF( z( nn-5 ).GT.z( nn-7 ) )
338 b1 = z( nn-5 ) / z( nn-7 )
342 DO 50 i4 = 4*n0 - 9 + pp, 4*i0 - 1 + pp, -4
344 IF( z( i4 ).GT.z( i4-2 ) )
346 b1 = b1*( z( i4 ) / z( i4-2 ) )
348 IF( hundrd*max( b1, a2 ).LT.b2 )
352 b2 = sqrt( cnst3*b2 )
353 a2 = dmin1 / ( one+b2**2 )
354 gap2 = half*dmin2 - a2
355 IF( gap2.GT.zero .AND. gap2.GT.b2*a2 )
THEN
356 s = max( s, a2*( one-cnst2*a2*( b2 / gap2 )*b2 ) )
358 s = max( s, a2*( one-cnst2*b2 ) )
371 ELSE IF( n0in.EQ.( n0+2 ) )
THEN
377 IF( dmin2.EQ.dn2 .AND. two*z( nn-5 ).LT.z( nn-7 ) )
THEN
380 IF( z( nn-5 ).GT.z( nn-7 ) )
382 b1 = z( nn-5 ) / z( nn-7 )
386 DO 70 i4 = 4*n0 - 9 + pp, 4*i0 - 1 + pp, -4
387 IF( z( i4 ).GT.z( i4-2 ) )
389 b1 = b1*( z( i4 ) / z( i4-2 ) )
391 IF( hundrd*b1.LT.b2 )
395 b2 = sqrt( cnst3*b2 )
396 a2 = dmin2 / ( one+b2**2 )
397 gap2 = z( nn-7 ) + z( nn-9 ) -
398 $ sqrt( z( nn-11 ) )*sqrt( z( nn-9 ) ) - a2
399 IF( gap2.GT.zero .AND. gap2.GT.b2*a2 )
THEN
400 s = max( s, a2*( one-cnst2*a2*( b2 / gap2 )*b2 ) )
402 s = max( s, a2*( one-cnst2*b2 ) )
408 ELSE IF( n0in.GT.( n0+2 ) )
THEN
subroutine dlasq4(i0, n0, z, pp, n0in, dmin, dmin1, dmin2, dn, dn1, dn2, tau, ttype, g)
DLASQ4 computes an approximation to the smallest eigenvalue using values of d from the previous trans...