81 SUBROUTINE crscl( N, A, X, INCX )
99 parameter( zero = 0.0e+0, one = 1.0e+0 )
102 REAL SAFMAX, SAFMIN, OV, AR, AI, ABSR, ABSI, UR
108 EXTERNAL slamch, cladiv
125 safmin = slamch(
'S' )
126 safmax = one / safmin
136 IF( ai.EQ.zero )
THEN
138 CALL csrscl( n, ar, x, incx )
140 ELSE IF( ar.EQ.zero )
THEN
143 IF( absi.GT.safmax )
THEN
144 CALL csscal( n, safmin, x, incx )
145 CALL cscal( n, cmplx( zero, -safmax / ai ), x, incx )
146 ELSE IF( absi.LT.safmin )
THEN
147 CALL cscal( n, cmplx( zero, -safmin / ai ), x, incx )
148 CALL csscal( n, safmax, x, incx )
150 CALL cscal( n, cmplx( zero, -one / ai ), x, incx )
161 ur = ar + ai * ( ai / ar )
162 ui = ai + ar * ( ar / ai )
164 IF( (abs( ur ).LT.safmin).OR.(abs( ui ).LT.safmin) )
THEN
166 CALL cscal( n, cmplx( safmin / ur, -safmin / ui ), x,
168 CALL csscal( n, safmax, x, incx )
169 ELSE IF( (abs( ur ).GT.safmax).OR.(abs( ui ).GT.safmax) )
THEN
170 IF( (absr.GT.ov).OR.(absi.GT.ov) )
THEN
172 CALL cscal( n, cmplx( one / ur, -one / ui ), x, incx )
174 CALL csscal( n, safmin, x, incx )
175 IF( (abs( ur ).GT.ov).OR.(abs( ui ).GT.ov) )
THEN
177 IF( absr.GE.absi )
THEN
179 ur = (safmin * ar) + safmin * (ai * ( ai / ar ))
180 ui = (safmin * ai) + ar * ( (safmin * ar) / ai )
183 ur = (safmin * ar) + ai * ( (safmin * ai) / ar )
184 ui = (safmin * ai) + safmin * (ar * ( ar / ai ))
186 CALL cscal( n, cmplx( one / ur, -one / ui ), x,
189 CALL cscal( n, cmplx( safmax / ur, -safmax / ui ),
194 CALL cscal( n, cmplx( one / ur, -one / ui ), x, incx )
subroutine crscl(n, a, x, incx)
CRSCL multiplies a vector by the reciprocal of a real scalar.
subroutine csrscl(n, sa, sx, incx)
CSRSCL multiplies a vector by the reciprocal of a real scalar.