107 SUBROUTINE zlarfg( N, ALPHA, X, INCX, TAU )
116 COMPLEX*16 alpha, tau
125 DOUBLE PRECISION one, zero
126 parameter( one = 1.0d+0, zero = 0.0d+0 )
130 DOUBLE PRECISION alphi, alphr, beta, rsafmn, safmin, xnorm
138 INTRINSIC abs, dble, dcmplx, dimag, sign
150 xnorm =
dznrm2( n-1, x, incx )
151 alphr = dble( alpha )
152 alphi = dimag( alpha )
154 IF( xnorm.EQ.zero .AND. alphi.EQ.zero )
THEN
163 beta = -sign(
dlapy3( alphr, alphi, xnorm ), alphr )
165 rsafmn = one / safmin
168 IF( abs( beta ).LT.safmin )
THEN
174 CALL
zdscal( n-1, rsafmn, x, incx )
178 IF( abs( beta ).LT.safmin )
183 xnorm =
dznrm2( n-1, x, incx )
184 alpha = dcmplx( alphr, alphi )
185 beta = -sign(
dlapy3( alphr, alphi, xnorm ), alphr )
187 tau = dcmplx( ( beta-alphr ) / beta, -alphi / beta )
188 alpha =
zladiv( dcmplx( one ), alpha-beta )
189 CALL
zscal( n-1, alpha, x, incx )