139 SUBROUTINE dlaed6( KNITER, ORGATI, RHO, D, Z, FINIT, TAU, INFO )
148 DOUBLE PRECISION FINIT, RHO, TAU
151 DOUBLE PRECISION D( 3 ), Z( 3 )
158 parameter( maxit = 40 )
159 DOUBLE PRECISION ZERO, ONE, TWO, THREE, FOUR, EIGHT
160 parameter( zero = 0.0d0, one = 1.0d0, two = 2.0d0,
161 $ three = 3.0d0, four = 4.0d0, eight = 8.0d0 )
164 DOUBLE PRECISION DLAMCH
168 DOUBLE PRECISION DSCALE( 3 ), ZSCALE( 3 )
172 INTEGER I, ITER, NITER
173 DOUBLE PRECISION A, B, BASE, C, DDF, DF, EPS, ERRETM, ETA, F,
174 $ FC, SCLFAC, SCLINV, SMALL1, SMALL2, SMINV1,
175 $ SMINV2, TEMP, TEMP1, TEMP2, TEMP3, TEMP4,
179 INTRINSIC abs, int, log, max, min, sqrt
192 IF( finit .LT. zero )
THEN
200 IF( kniter.EQ.2 )
THEN
202 temp = ( d( 3 )-d( 2 ) ) / two
203 c = rho + z( 1 ) / ( ( d( 1 )-d( 2 ) )-temp )
204 a = c*( d( 2 )+d( 3 ) ) + z( 2 ) + z( 3 )
205 b = c*d( 2 )*d( 3 ) + z( 2 )*d( 3 ) + z( 3 )*d( 2 )
207 temp = ( d( 1 )-d( 2 ) ) / two
208 c = rho + z( 3 ) / ( ( d( 3 )-d( 2 ) )-temp )
209 a = c*( d( 1 )+d( 2 ) ) + z( 1 ) + z( 2 )
210 b = c*d( 1 )*d( 2 ) + z( 1 )*d( 2 ) + z( 2 )*d( 1 )
212 temp = max( abs( a ), abs( b ), abs( c ) )
218 ELSE IF( a.LE.zero )
THEN
219 tau = ( a-sqrt( abs( a*a-four*b*c ) ) ) / ( two*c )
221 tau = two*b / ( a+sqrt( abs( a*a-four*b*c ) ) )
223 IF( tau .LT. lbd .OR. tau .GT. ubd )
224 $ tau = ( lbd+ubd )/two
225 IF( d(1).EQ.tau .OR. d(2).EQ.tau .OR. d(3).EQ.tau )
THEN
228 temp = finit + tau*z(1)/( d(1)*( d( 1 )-tau ) ) +
229 $ tau*z(2)/( d(2)*( d( 2 )-tau ) ) +
230 $ tau*z(3)/( d(3)*( d( 3 )-tau ) )
231 IF( temp .LE. zero )
THEN
236 IF( abs( finit ).LE.abs( temp ) )
247 eps = dlamch(
'Epsilon' )
248 base = dlamch(
'Base' )
249 small1 = base**( int( log( dlamch(
'SafMin' ) ) / log( base ) /
251 sminv1 = one / small1
252 small2 = small1*small1
253 sminv2 = sminv1*sminv1
259 temp = min( abs( d( 2 )-tau ), abs( d( 3 )-tau ) )
261 temp = min( abs( d( 1 )-tau ), abs( d( 2 )-tau ) )
264 IF( temp.LE.small1 )
THEN
266 IF( temp.LE.small2 )
THEN
283 dscale( i ) = d( i )*sclfac
284 zscale( i ) = z( i )*sclfac
303 temp = one / ( dscale( i )-tau )
304 temp1 = zscale( i )*temp
307 fc = fc + temp1 / dscale( i )
313 IF( abs( f ).LE.zero )
315 IF( f .LE. zero )
THEN
334 DO 50 niter = iter, maxit
337 temp1 = dscale( 2 ) - tau
338 temp2 = dscale( 3 ) - tau
340 temp1 = dscale( 1 ) - tau
341 temp2 = dscale( 2 ) - tau
343 a = ( temp1+temp2 )*f - temp1*temp2*df
345 c = f - ( temp1+temp2 )*df + temp1*temp2*ddf
346 temp = max( abs( a ), abs( b ), abs( c ) )
352 ELSE IF( a.LE.zero )
THEN
353 eta = ( a-sqrt( abs( a*a-four*b*c ) ) ) / ( two*c )
355 eta = two*b / ( a+sqrt( abs( a*a-four*b*c ) ) )
357 IF( f*eta.GE.zero )
THEN
362 IF( tau .LT. lbd .OR. tau .GT. ubd )
363 $ tau = ( lbd + ubd )/two
370 IF ( ( dscale( i )-tau ).NE.zero )
THEN
371 temp = one / ( dscale( i )-tau )
372 temp1 = zscale( i )*temp
375 temp4 = temp1 / dscale( i )
377 erretm = erretm + abs( temp4 )
385 erretm = eight*( abs( finit )+abs( tau )*erretm ) +
387 IF( ( abs( f ).LE.four*eps*erretm ) .OR.
388 $ ( (ubd-lbd).LE.four*eps*abs(tau) ) )
390 IF( f .LE. zero )
THEN
subroutine dlaed6(kniter, orgati, rho, d, z, finit, tau, info)
DLAED6 used by DSTEDC. Computes one Newton step in solution of the secular equation.