1 SUBROUTINE dlartg( F, G, CS, SN, R )
9 DOUBLE PRECISION CS, F, G, R, SN
52 parameter( zero = 0.0d0 )
54 parameter( one = 1.0d0 )
56 parameter( two = 2.0d0 )
61 DOUBLE PRECISION EPS, F1, G1, SAFMIN, SAFMN2, SAFMX2, SCALE
64 DOUBLE PRECISION DLAMCH
68 INTRINSIC abs, int, log, max, sqrt
71 SAVE first, safmx2, safmin, safmn2
80 safmin = dlamch(
'S' )
82 safmn2 = dlamch(
'B' )**int( log( safmin / eps ) /
83 $ log( dlamch(
'B' ) ) / two )
90 ELSE IF( f.EQ.zero )
THEN
97 scale = max( abs( f1 ), abs( g1 ) )
98 IF( scale.GE.safmx2 )
THEN
104 scale = max( abs( f1 ), abs( g1 ) )
105 IF( scale.GE.safmx2 )
107 r = sqrt( f1**2+g1**2 )
113 ELSE IF( scale.LE.safmn2 )
THEN
119 scale = max( abs( f1 ), abs( g1 ) )
120 IF( scale.LE.safmn2 )
122 r = sqrt( f1**2+g1**2 )
129 r = sqrt( f1**2+g1**2 )
133 IF( abs( f ).GT.abs( g ) .AND. cs.LT.zero )
THEN
subroutine dlartg(F, G, CS, SN, R)