107 SUBROUTINE slarfg( N, ALPHA, X, INCX, TAU )
126 parameter( one = 1.0e+0, zero = 0.0e+0 )
130 REAL beta, rsafmn, safmin, xnorm
149 xnorm =
snrm2( n-1, x, incx )
151 IF( xnorm.EQ.zero )
THEN
160 beta = -sign(
slapy2( alpha, xnorm ), alpha )
163 IF( abs( beta ).LT.safmin )
THEN
167 rsafmn = one / safmin
170 CALL
sscal( n-1, rsafmn, x, incx )
173 IF( abs( beta ).LT.safmin )
178 xnorm =
snrm2( n-1, x, incx )
179 beta = -sign(
slapy2( alpha, xnorm ), alpha )
181 tau = ( beta-alpha ) / beta
182 CALL
sscal( n-1, one / ( alpha-beta ), x, incx )