107 SUBROUTINE dlarfg( N, ALPHA, X, INCX, TAU )
116 DOUBLE PRECISION alpha, tau
119 DOUBLE PRECISION x( * )
125 DOUBLE PRECISION one, zero
126 parameter( one = 1.0d+0, zero = 0.0d+0 )
130 DOUBLE PRECISION beta, rsafmn, safmin, xnorm
149 xnorm =
dnrm2( n-1, x, incx )
151 IF( xnorm.EQ.zero )
THEN
160 beta = -sign(
dlapy2( alpha, xnorm ), alpha )
163 IF( abs( beta ).LT.safmin )
THEN
167 rsafmn = one / safmin
170 CALL
dscal( n-1, rsafmn, x, incx )
173 IF( abs( beta ).LT.safmin )
178 xnorm =
dnrm2( n-1, x, incx )
179 beta = -sign(
dlapy2( alpha, xnorm ), alpha )
181 tau = ( beta-alpha ) / beta
182 CALL
dscal( n-1, one / ( alpha-beta ), x, incx )