LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dlasq6 ( integer  I0,
integer  N0,
double precision, dimension( * )  Z,
integer  PP,
double precision  DMIN,
double precision  DMIN1,
double precision  DMIN2,
double precision  DN,
double precision  DNM1,
double precision  DNM2 
)

DLASQ6 computes one dqd transform in ping-pong form. Used by sbdsqr and sstegr.

Download DLASQ6 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 DLASQ6 computes one dqd (shift equal to zero) transform in
 ping-pong form, with protection against underflow and overflow.
Parameters
[in]I0
          I0 is INTEGER
        First index.
[in]N0
          N0 is INTEGER
        Last index.
[in]Z
          Z is DOUBLE PRECISION array, dimension ( 4*N )
        Z holds the qd array. EMIN is stored in Z(4*N0) to avoid
        an extra argument.
[in]PP
          PP is INTEGER
        PP=0 for ping, PP=1 for pong.
[out]DMIN
          DMIN is DOUBLE PRECISION
        Minimum value of d.
[out]DMIN1
          DMIN1 is DOUBLE PRECISION
        Minimum value of d, excluding D( N0 ).
[out]DMIN2
          DMIN2 is DOUBLE PRECISION
        Minimum value of d, excluding D( N0 ) and D( N0-1 ).
[out]DN
          DN is DOUBLE PRECISION
        d(N0), the last value of d.
[out]DNM1
          DNM1 is DOUBLE PRECISION
        d(N0-1).
[out]DNM2
          DNM2 is DOUBLE PRECISION
        d(N0-2).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
September 2012

Definition at line 121 of file dlasq6.f.

121 *
122 * -- LAPACK computational routine (version 3.4.2) --
123 * -- LAPACK is a software package provided by Univ. of Tennessee, --
124 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
125 * September 2012
126 *
127 * .. Scalar Arguments ..
128  INTEGER i0, n0, pp
129  DOUBLE PRECISION dmin, dmin1, dmin2, dn, dnm1, dnm2
130 * ..
131 * .. Array Arguments ..
132  DOUBLE PRECISION z( * )
133 * ..
134 *
135 * =====================================================================
136 *
137 * .. Parameter ..
138  DOUBLE PRECISION zero
139  parameter ( zero = 0.0d0 )
140 * ..
141 * .. Local Scalars ..
142  INTEGER j4, j4p2
143  DOUBLE PRECISION d, emin, safmin, temp
144 * ..
145 * .. External Function ..
146  DOUBLE PRECISION dlamch
147  EXTERNAL dlamch
148 * ..
149 * .. Intrinsic Functions ..
150  INTRINSIC min
151 * ..
152 * .. Executable Statements ..
153 *
154  IF( ( n0-i0-1 ).LE.0 )
155  $ RETURN
156 *
157  safmin = dlamch( 'Safe minimum' )
158  j4 = 4*i0 + pp - 3
159  emin = z( j4+4 )
160  d = z( j4 )
161  dmin = d
162 *
163  IF( pp.EQ.0 ) THEN
164  DO 10 j4 = 4*i0, 4*( n0-3 ), 4
165  z( j4-2 ) = d + z( j4-1 )
166  IF( z( j4-2 ).EQ.zero ) THEN
167  z( j4 ) = zero
168  d = z( j4+1 )
169  dmin = d
170  emin = zero
171  ELSE IF( safmin*z( j4+1 ).LT.z( j4-2 ) .AND.
172  $ safmin*z( j4-2 ).LT.z( j4+1 ) ) THEN
173  temp = z( j4+1 ) / z( j4-2 )
174  z( j4 ) = z( j4-1 )*temp
175  d = d*temp
176  ELSE
177  z( j4 ) = z( j4+1 )*( z( j4-1 ) / z( j4-2 ) )
178  d = z( j4+1 )*( d / z( j4-2 ) )
179  END IF
180  dmin = min( dmin, d )
181  emin = min( emin, z( j4 ) )
182  10 CONTINUE
183  ELSE
184  DO 20 j4 = 4*i0, 4*( n0-3 ), 4
185  z( j4-3 ) = d + z( j4 )
186  IF( z( j4-3 ).EQ.zero ) THEN
187  z( j4-1 ) = zero
188  d = z( j4+2 )
189  dmin = d
190  emin = zero
191  ELSE IF( safmin*z( j4+2 ).LT.z( j4-3 ) .AND.
192  $ safmin*z( j4-3 ).LT.z( j4+2 ) ) THEN
193  temp = z( j4+2 ) / z( j4-3 )
194  z( j4-1 ) = z( j4 )*temp
195  d = d*temp
196  ELSE
197  z( j4-1 ) = z( j4+2 )*( z( j4 ) / z( j4-3 ) )
198  d = z( j4+2 )*( d / z( j4-3 ) )
199  END IF
200  dmin = min( dmin, d )
201  emin = min( emin, z( j4-1 ) )
202  20 CONTINUE
203  END IF
204 *
205 * Unroll last two steps.
206 *
207  dnm2 = d
208  dmin2 = dmin
209  j4 = 4*( n0-2 ) - pp
210  j4p2 = j4 + 2*pp - 1
211  z( j4-2 ) = dnm2 + z( j4p2 )
212  IF( z( j4-2 ).EQ.zero ) THEN
213  z( j4 ) = zero
214  dnm1 = z( j4p2+2 )
215  dmin = dnm1
216  emin = zero
217  ELSE IF( safmin*z( j4p2+2 ).LT.z( j4-2 ) .AND.
218  $ safmin*z( j4-2 ).LT.z( j4p2+2 ) ) THEN
219  temp = z( j4p2+2 ) / z( j4-2 )
220  z( j4 ) = z( j4p2 )*temp
221  dnm1 = dnm2*temp
222  ELSE
223  z( j4 ) = z( j4p2+2 )*( z( j4p2 ) / z( j4-2 ) )
224  dnm1 = z( j4p2+2 )*( dnm2 / z( j4-2 ) )
225  END IF
226  dmin = min( dmin, dnm1 )
227 *
228  dmin1 = dmin
229  j4 = j4 + 4
230  j4p2 = j4 + 2*pp - 1
231  z( j4-2 ) = dnm1 + z( j4p2 )
232  IF( z( j4-2 ).EQ.zero ) THEN
233  z( j4 ) = zero
234  dn = z( j4p2+2 )
235  dmin = dn
236  emin = zero
237  ELSE IF( safmin*z( j4p2+2 ).LT.z( j4-2 ) .AND.
238  $ safmin*z( j4-2 ).LT.z( j4p2+2 ) ) THEN
239  temp = z( j4p2+2 ) / z( j4-2 )
240  z( j4 ) = z( j4p2 )*temp
241  dn = dnm1*temp
242  ELSE
243  z( j4 ) = z( j4p2+2 )*( z( j4p2 ) / z( j4-2 ) )
244  dn = z( j4p2+2 )*( dnm1 / z( j4-2 ) )
245  END IF
246  dmin = min( dmin, dn )
247 *
248  z( j4+2 ) = dn
249  z( 4*n0-pp ) = emin
250  RETURN
251 *
252 * End of DLASQ6
253 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65

Here is the caller graph for this function: