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
129 INTRINSIC abs, int, log, max, sqrt
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