123subroutine dlassq( n, x, incx, scale, sumsq )
135 real(wp) :: scale, sumsq
143 real(wp) :: abig, amed, asml, ax, ymax, ymin
149 if( sumsq == zero ) scale = one
150 if( scale == zero )
then
171 if( incx < 0 ) ix = 1 - (n-1)*incx
175 abig = abig + (ax*sbig)**2
177 else if (ax < tsml)
then
178 if (notbig) asml = asml + (ax*ssml)**2
187 if( sumsq > zero )
then
188 ax = scale*sqrt( sumsq )
190 if (scale > one)
then
192 abig = abig + scale * (scale * sumsq)
195 abig = abig + scale * (scale * (sbig * (sbig * sumsq)))
197 else if (ax < tsml)
then
199 if (scale < one)
then
201 asml = asml + scale * (scale * sumsq)
204 asml = asml + scale * (scale * (ssml * (ssml * sumsq)))
208 amed = amed + scale * (scale * sumsq)
215 if (abig > zero)
then
219 if (amed > zero .or.
la_isnan(amed))
then
220 abig = abig + (amed*sbig)*sbig
224 else if (asml > zero)
then
228 if (amed > zero .or.
la_isnan(amed))
then
230 asml = sqrt(asml) / ssml
231 if (asml > amed)
then
239 sumsq = ymax**2*( one + (ymin/ymax)**2 )
subroutine dlassq(n, x, incx, scale, sumsq)
DLASSQ updates a sum of squares represented in scaled form.
real(dp), parameter dtsml
real(dp), parameter dzero
real(dp), parameter dsbig
real(dp), parameter dtbig
real(dp), parameter dssml
LA_CONSTANTS is a module for the scaling constants for the compiled Fortran single and double precisi...