96 SUBROUTINE dlartgp( F, G, CS, SN, R )
104 DOUBLE PRECISION CS, F, G, R, SN
110 DOUBLE PRECISION ZERO
111 parameter ( zero = 0.0d0 )
113 parameter ( one = 1.0d0 )
115 parameter ( two = 2.0d0 )
120 DOUBLE PRECISION EPS, F1, G1, SAFMIN, SAFMN2, SAFMX2, SCALE
123 DOUBLE PRECISION DLAMCH
127 INTRINSIC abs, int, log, max, sign, sqrt
138 safmin = dlamch(
'S' )
140 safmn2 = dlamch(
'B' )**int( log( safmin / eps ) /
141 $ log( dlamch(
'B' ) ) / two )
142 safmx2 = one / safmn2
149 ELSE IF( f.EQ.zero )
THEN
156 scale = max( abs( f1 ), abs( g1 ) )
157 IF( scale.GE.safmx2 )
THEN
163 scale = max( abs( f1 ), abs( g1 ) )
164 IF( scale.GE.safmx2 )
166 r = sqrt( f1**2+g1**2 )
172 ELSE IF( scale.LE.safmn2 )
THEN
178 scale = max( abs( f1 ), abs( g1 ) )
179 IF( scale.LE.safmn2 )
181 r = sqrt( f1**2+g1**2 )
188 r = sqrt( f1**2+g1**2 )
subroutine dlartgp(F, G, CS, SN, R)
DLARTGP generates a plane rotation so that the diagonal is nonnegative.