108 parameter( zero = 0.0e0 )
110 parameter( one = 1.0e0 )
112 parameter( two = 2.0e0 )
117 REAL EPS, F1, G1, SAFMIN, SAFMN2, SAFMX2, SCALE
124 INTRINSIC abs, int, log, max, sign, sqrt
135 safmin = slamch(
'S' )
137 safmn2 = slamch(
'B' )**int( log( safmin / eps ) /
138 $ log( slamch(
'B' ) ) / two )
139 safmx2 = one / safmn2
146 ELSE IF( f.EQ.zero )
THEN
153 scale = max( abs( f1 ), abs( g1 ) )
154 IF( scale.GE.safmx2 )
THEN
160 scale = max( abs( f1 ), abs( g1 ) )
161 IF( scale.GE.safmx2 .AND. count .LT. 20)
163 r = sqrt( f1**2+g1**2 )
169 ELSE IF( scale.LE.safmn2 )
THEN
175 scale = max( abs( f1 ), abs( g1 ) )
176 IF( scale.LE.safmn2 )
178 r = sqrt( f1**2+g1**2 )
185 r = sqrt( f1**2+g1**2 )
subroutine slartgp(f, g, cs, sn, r)
SLARTGP generates a plane rotation so that the diagonal is nonnegative.