124 SUBROUTINE dlanv2( A, B, C, D, RT1R, RT1I, RT2R, RT2I, CS, SN )
131 DOUBLE PRECISION A, B, C, CS, D, RT1I, RT1R, RT2I, RT2R, SN
137 DOUBLE PRECISION ZERO, HALF, ONE, TWO
138 parameter( zero = 0.0d+0, half = 0.5d+0, one = 1.0d+0,
140 DOUBLE PRECISION MULTPL
141 parameter( multpl = 4.0d+0 )
144 DOUBLE PRECISION AA, BB, BCMAX, BCMIS, CC, CS1, DD, EPS, P, SAB,
145 $ SAC, SCALE, SIGMA, SN1, TAU, TEMP, Z, SAFMIN,
150 DOUBLE PRECISION DLAMCH, DLAPY2
151 EXTERNAL dlamch, dlapy2
154 INTRINSIC abs, max, min, sign, sqrt
158 safmin = dlamch(
'S' )
160 safmn2 = dlamch(
'B' )**int( log( safmin / eps ) /
161 $ log( dlamch(
'B' ) ) / two )
162 safmx2 = one / safmn2
167 ELSE IF( b.EQ.zero )
THEN
179 ELSE IF( ( a-d ).EQ.zero .AND. sign( one, b ).NE.sign( one, c ) )
188 bcmax = max( abs( b ), abs( c ) )
189 bcmis = min( abs( b ), abs( c ) )*sign( one, b )*sign( one, c )
190 scale = max( abs( p ), bcmax )
191 z = ( p / scale )*p + ( bcmax / scale )*bcmis
196 IF( z.GE.multpl*eps )
THEN
200 z = p + sign( sqrt( scale )*sqrt( z ), p )
202 d = d - ( bcmax / z )*bcmis
221 scale = max( abs(temp), abs(sigma) )
222 IF( scale.GE.safmx2 )
THEN
223 sigma = sigma * safmn2
228 IF( scale.LE.safmn2 )
THEN
229 sigma = sigma * safmx2
235 tau = dlapy2( sigma, temp )
236 cs = sqrt( half*( one+abs( sigma ) / tau ) )
237 sn = -( p / ( tau*cs ) )*sign( one, sigma )
255 b = ( bb*cs ) + ( dd*sn )
256 c = -( aa*sn ) + ( cc*cs )
265 IF( sign( one, b ).EQ.sign( one, c ) )
THEN
269 sab = sqrt( abs( b ) )
270 sac = sqrt( abs( c ) )
271 p = sign( sab*sac, c )
272 tau = one / sqrt( abs( b+c ) )
279 temp = cs*cs1 - sn*sn1
303 rt1i = sqrt( abs( b ) )*sqrt( abs( c ) )
subroutine dlanv2(a, b, c, d, rt1r, rt1i, rt2r, rt2i, cs, sn)
DLANV2 computes the Schur factorization of a real 2-by-2 nonsymmetric matrix in standard form.