99 DOUBLE PRECISION CS, F, G, R, SN
105 DOUBLE PRECISION ZERO
106 parameter( zero = 0.0d0 )
108 parameter( one = 1.0d0 )
110 parameter( two = 2.0d0 )
115 DOUBLE PRECISION EPS, F1, G1, SAFMIN, SAFMN2, SAFMX2, SCALE
118 DOUBLE PRECISION DLAMCH
122 INTRINSIC abs, int, log, max, sign, sqrt
133 safmin = dlamch(
'S' )
135 safmn2 = dlamch(
'B' )**int( log( safmin / eps ) /
136 $ log( dlamch(
'B' ) ) / two )
137 safmx2 = one / safmn2
144 ELSE IF( f.EQ.zero )
THEN
151 scale = max( abs( f1 ), abs( g1 ) )
152 IF( scale.GE.safmx2 )
THEN
158 scale = max( abs( f1 ), abs( g1 ) )
159 IF( scale.GE.safmx2 .AND. count .LT. 20 )
161 r = sqrt( f1**2+g1**2 )
167 ELSE IF( scale.LE.safmn2 )
THEN
173 scale = max( abs( f1 ), abs( g1 ) )
174 IF( scale.LE.safmn2 )
176 r = sqrt( f1**2+g1**2 )
183 r = sqrt( f1**2+g1**2 )
subroutine dlartgp(f, g, cs, sn, r)
DLARTGP generates a plane rotation so that the diagonal is nonnegative.