126 SUBROUTINE slanv2( A, B, C, D, RT1R, RT1I, RT2R, RT2I, CS, SN )
133 REAL A, B, C, CS, D, RT1I, RT1R, RT2I, RT2R, SN
139 REAL ZERO, HALF, ONE, TWO
140 parameter( zero = 0.0e+0, half = 0.5e+0, one = 1.0e+0,
143 parameter( multpl = 4.0e+0 )
146 REAL AA, BB, BCMAX, BCMIS, CC, CS1, DD, EPS, P, SAB,
147 $ SAC, SCALE, SIGMA, SN1, TAU, TEMP, Z, SAFMIN,
153 EXTERNAL slamch, slapy2
156 INTRINSIC abs, max, min, sign, sqrt
160 safmin = slamch(
'S' )
162 safmn2 = slamch(
'B' )**int( log( safmin / eps ) /
163 $ log( slamch(
'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.
182 $ sign( one, c ) )
THEN
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 = slapy2( 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 slanv2(a, b, c, d, rt1r, rt1i, rt2r, rt2i, cs, sn)
SLANV2 computes the Schur factorization of a real 2-by-2 nonsymmetric matrix in standard form.