 LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 subroutine dlasd5 ( integer I, double precision, dimension( 2 ) D, double precision, dimension( 2 ) Z, double precision, dimension( 2 ) DELTA, double precision RHO, double precision DSIGMA, double precision, dimension( 2 ) WORK )

DLASD5 computes the square root of the i-th eigenvalue of a positive symmetric rank-one modification of a 2-by-2 diagonal matrix. Used by sbdsdc.

Purpose:
``` This subroutine computes the square root of the I-th eigenvalue
of a positive symmetric rank-one modification of a 2-by-2 diagonal
matrix

diag( D ) * diag( D ) +  RHO * Z * transpose(Z) .

The diagonal entries in the array D are assumed to satisfy

0 <= D(i) < D(j)  for  i < j .

We also assume RHO > 0 and that the Euclidean norm of the vector
Z is one.```
Parameters
 [in] I ``` I is INTEGER The index of the eigenvalue to be computed. I = 1 or I = 2.``` [in] D ``` D is DOUBLE PRECISION array, dimension ( 2 ) The original eigenvalues. We assume 0 <= D(1) < D(2).``` [in] Z ``` Z is DOUBLE PRECISION array, dimension ( 2 ) The components of the updating vector.``` [out] DELTA ``` DELTA is DOUBLE PRECISION array, dimension ( 2 ) Contains (D(j) - sigma_I) in its j-th component. The vector DELTA contains the information necessary to construct the eigenvectors.``` [in] RHO ``` RHO is DOUBLE PRECISION The scalar in the symmetric updating formula.``` [out] DSIGMA ``` DSIGMA is DOUBLE PRECISION The computed sigma_I, the I-th updated eigenvalue.``` [out] WORK ``` WORK is DOUBLE PRECISION array, dimension ( 2 ) WORK contains (D(j) + sigma_I) in its j-th component.```
Date
September 2012
Contributors:
Ren-Cang Li, Computer Science Division, University of California at Berkeley, USA

Definition at line 118 of file dlasd5.f.

118 *
119 * -- LAPACK auxiliary routine (version 3.4.2) --
120 * -- LAPACK is a software package provided by Univ. of Tennessee, --
121 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
122 * September 2012
123 *
124 * .. Scalar Arguments ..
125  INTEGER i
126  DOUBLE PRECISION dsigma, rho
127 * ..
128 * .. Array Arguments ..
129  DOUBLE PRECISION d( 2 ), delta( 2 ), work( 2 ), z( 2 )
130 * ..
131 *
132 * =====================================================================
133 *
134 * .. Parameters ..
135  DOUBLE PRECISION zero, one, two, three, four
136  parameter ( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0,
137  \$ three = 3.0d+0, four = 4.0d+0 )
138 * ..
139 * .. Local Scalars ..
140  DOUBLE PRECISION b, c, del, delsq, tau, w
141 * ..
142 * .. Intrinsic Functions ..
143  INTRINSIC abs, sqrt
144 * ..
145 * .. Executable Statements ..
146 *
147  del = d( 2 ) - d( 1 )
148  delsq = del*( d( 2 )+d( 1 ) )
149  IF( i.EQ.1 ) THEN
150  w = one + four*rho*( z( 2 )*z( 2 ) / ( d( 1 )+three*d( 2 ) )-
151  \$ z( 1 )*z( 1 ) / ( three*d( 1 )+d( 2 ) ) ) / del
152  IF( w.GT.zero ) THEN
153  b = delsq + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
154  c = rho*z( 1 )*z( 1 )*delsq
155 *
156 * B > ZERO, always
157 *
158 * The following TAU is DSIGMA * DSIGMA - D( 1 ) * D( 1 )
159 *
160  tau = two*c / ( b+sqrt( abs( b*b-four*c ) ) )
161 *
162 * The following TAU is DSIGMA - D( 1 )
163 *
164  tau = tau / ( d( 1 )+sqrt( d( 1 )*d( 1 )+tau ) )
165  dsigma = d( 1 ) + tau
166  delta( 1 ) = -tau
167  delta( 2 ) = del - tau
168  work( 1 ) = two*d( 1 ) + tau
169  work( 2 ) = ( d( 1 )+tau ) + d( 2 )
170 * DELTA( 1 ) = -Z( 1 ) / TAU
171 * DELTA( 2 ) = Z( 2 ) / ( DEL-TAU )
172  ELSE
173  b = -delsq + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
174  c = rho*z( 2 )*z( 2 )*delsq
175 *
176 * The following TAU is DSIGMA * DSIGMA - D( 2 ) * D( 2 )
177 *
178  IF( b.GT.zero ) THEN
179  tau = -two*c / ( b+sqrt( b*b+four*c ) )
180  ELSE
181  tau = ( b-sqrt( b*b+four*c ) ) / two
182  END IF
183 *
184 * The following TAU is DSIGMA - D( 2 )
185 *
186  tau = tau / ( d( 2 )+sqrt( abs( d( 2 )*d( 2 )+tau ) ) )
187  dsigma = d( 2 ) + tau
188  delta( 1 ) = -( del+tau )
189  delta( 2 ) = -tau
190  work( 1 ) = d( 1 ) + tau + d( 2 )
191  work( 2 ) = two*d( 2 ) + tau
192 * DELTA( 1 ) = -Z( 1 ) / ( DEL+TAU )
193 * DELTA( 2 ) = -Z( 2 ) / TAU
194  END IF
195 * TEMP = SQRT( DELTA( 1 )*DELTA( 1 )+DELTA( 2 )*DELTA( 2 ) )
196 * DELTA( 1 ) = DELTA( 1 ) / TEMP
197 * DELTA( 2 ) = DELTA( 2 ) / TEMP
198  ELSE
199 *
200 * Now I=2
201 *
202  b = -delsq + rho*( z( 1 )*z( 1 )+z( 2 )*z( 2 ) )
203  c = rho*z( 2 )*z( 2 )*delsq
204 *
205 * The following TAU is DSIGMA * DSIGMA - D( 2 ) * D( 2 )
206 *
207  IF( b.GT.zero ) THEN
208  tau = ( b+sqrt( b*b+four*c ) ) / two
209  ELSE
210  tau = two*c / ( -b+sqrt( b*b+four*c ) )
211  END IF
212 *
213 * The following TAU is DSIGMA - D( 2 )
214 *
215  tau = tau / ( d( 2 )+sqrt( d( 2 )*d( 2 )+tau ) )
216  dsigma = d( 2 ) + tau
217  delta( 1 ) = -( del+tau )
218  delta( 2 ) = -tau
219  work( 1 ) = d( 1 ) + tau + d( 2 )
220  work( 2 ) = two*d( 2 ) + tau
221 * DELTA( 1 ) = -Z( 1 ) / ( DEL+TAU )
222 * DELTA( 2 ) = -Z( 2 ) / TAU
223 * TEMP = SQRT( DELTA( 1 )*DELTA( 1 )+DELTA( 2 )*DELTA( 2 ) )
224 * DELTA( 1 ) = DELTA( 1 ) / TEMP
225 * DELTA( 2 ) = DELTA( 2 ) / TEMP
226  END IF
227  RETURN
228 *
229 * End of DLASD5
230 *

Here is the caller graph for this function: