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
127 INTRINSIC abs, int, log, max, sign, sqrt
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 )