55 DOUBLE PRECISION FUNCTION dznrm2(N,X,INCX)
72 DOUBLE PRECISION one,zero
73 parameter(one=1.0d+0,zero=0.0d+0)
76 DOUBLE PRECISION norm,scale,ssq,temp
80 INTRINSIC abs,dble,dimag,sqrt
82 IF (n.LT.1 .OR. incx.LT.1)
THEN
91 DO 10 ix = 1,1 + (n-1)*incx,incx
92 IF (dble(x(ix)).NE.zero)
THEN
93 temp = abs(dble(x(ix)))
94 IF (scale.LT.temp)
THEN
95 ssq = one + ssq* (scale/temp)**2
98 ssq = ssq + (temp/scale)**2
101 IF (dimag(x(ix)).NE.zero)
THEN
102 temp = abs(dimag(x(ix)))
103 IF (scale.LT.temp)
THEN
104 ssq = one + ssq* (scale/temp)**2
107 ssq = ssq + (temp/scale)**2
111 norm = scale*sqrt(ssq)