126 SUBROUTINE dlanv2( A, B, C, D, RT1R, RT1I, RT2R, RT2I, CS, SN )
133 DOUBLE PRECISION A, B, C, CS, D, RT1I, RT1R, RT2I, RT2R, SN
139 DOUBLE PRECISION ZERO, HALF, ONE, TWO
140 parameter( zero = 0.0d+0, half = 0.5d+0, one = 1.0d+0,
142 DOUBLE PRECISION MULTPL
143 parameter( multpl = 4.0d+0 )
146 DOUBLE PRECISION AA, BB, BCMAX, BCMIS, CC, CS1, DD, EPS, P, SAB,
147 $ SAC, SCALE, SIGMA, SN1, TAU, TEMP, Z, SAFMIN,
152 DOUBLE PRECISION DLAMCH, DLAPY2
153 EXTERNAL dlamch, dlapy2
156 INTRINSIC abs, max, min, sign, sqrt
160 safmin = dlamch(
'S' )
162 safmn2 = dlamch(
'B' )**int( log( safmin / eps ) /
163 $ log( dlamch(
'B' ) ) / two )
164 safmx2 = one / safmn2
169 ELSE IF( b.EQ.zero )
THEN
181 ELSE IF( ( a-d ).EQ.zero .AND. sign( one, b ).NE.sign( one, c ) )
190 bcmax = max( abs( b ), abs( c ) )
191 bcmis = min( abs( b ), abs( c ) )*sign( one, b )*sign( one, c )
192 scale = max( abs( p ), bcmax )
193 z = ( p / scale )*p + ( bcmax / scale )*bcmis
198 IF( z.GE.multpl*eps )
THEN
202 z = p + sign( sqrt( scale )*sqrt( z ), p )
204 d = d - ( bcmax / z )*bcmis
223 scale = max( abs(temp), abs(sigma) )
224 IF( scale.GE.safmx2 )
THEN
225 sigma = sigma * safmn2
230 IF( scale.LE.safmn2 )
THEN
231 sigma = sigma * safmx2
237 tau = dlapy2( sigma, temp )
238 cs = sqrt( half*( one+abs( sigma ) / tau ) )
239 sn = -( p / ( tau*cs ) )*sign( one, sigma )
263 IF( sign( one, b ).EQ.sign( one, c ) )
THEN
267 sab = sqrt( abs( b ) )
268 sac = sqrt( abs( c ) )
269 p = sign( sab*sac, c )
270 tau = one / sqrt( abs( b+c ) )
277 temp = cs*cs1 - sn*sn1
301 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.