107 SUBROUTINE clarfg( N, ALPHA, X, INCX, TAU )
126 parameter( one = 1.0e+0, zero = 0.0e+0 )
130 REAL alphi, alphr, beta, rsafmn, safmin, xnorm
138 INTRINSIC abs, aimag, cmplx,
REAL, sign
150 xnorm =
scnrm2( n-1, x, incx )
151 alphr =
REAL( alpha )
152 alphi = aimag( alpha )
154 IF( xnorm.EQ.zero .AND. alphi.EQ.zero )
THEN
163 beta = -sign(
slapy3( alphr, alphi, xnorm ), alphr )
165 rsafmn = one / safmin
168 IF( abs( beta ).LT.safmin )
THEN
174 CALL
csscal( n-1, rsafmn, x, incx )
178 IF( abs( beta ).LT.safmin )
183 xnorm =
scnrm2( n-1, x, incx )
184 alpha = cmplx( alphr, alphi )
185 beta = -sign(
slapy3( alphr, alphi, xnorm ), alphr )
187 tau = cmplx( ( beta-alphr ) / beta, -alphi / beta )
188 alpha =
cladiv( cmplx( one ), alpha-beta )
189 CALL
cscal( n-1, alpha, x, incx )