98 SUBROUTINE dlartg( F, G, CS, SN, R )
106 DOUBLE PRECISION CS, F, G, R, SN
112 DOUBLE PRECISION ZERO
113 parameter ( zero = 0.0d0 )
115 parameter ( one = 1.0d0 )
117 parameter ( two = 2.0d0 )
122 DOUBLE PRECISION EPS, F1, G1, SAFMIN, SAFMN2, SAFMX2, SCALE
125 DOUBLE PRECISION DLAMCH
129 INTRINSIC abs, int, log, max, sqrt
140 safmin = dlamch(
'S' )
142 safmn2 = dlamch(
'B' )**int( log( safmin / eps ) /
143 $ log( dlamch(
'B' ) ) / two )
144 safmx2 = one / safmn2
151 ELSE IF( f.EQ.zero )
THEN
158 scale = max( abs( f1 ), abs( g1 ) )
159 IF( scale.GE.safmx2 )
THEN
165 scale = max( abs( f1 ), abs( g1 ) )
166 IF( scale.GE.safmx2 )
168 r = sqrt( f1**2+g1**2 )
174 ELSE IF( scale.LE.safmn2 )
THEN
180 scale = max( abs( f1 ), abs( g1 ) )
181 IF( scale.LE.safmn2 )
183 r = sqrt( f1**2+g1**2 )
190 r = sqrt( f1**2+g1**2 )
194 IF( abs( f ).GT.abs( g ) .AND. cs.LT.zero )
THEN
subroutine dlartg(F, G, CS, SN, R)
DLARTG generates a plane rotation with real cosine and real sine.