146 $ d, e2, pivmin, reltol, w, werr, info)
155 DOUBLE PRECISION pivmin, reltol, gl, gu, w, werr
158 DOUBLE PRECISION d( * ), e2( * )
164 DOUBLE PRECISION fudge, half, two, zero
165 parameter( half = 0.5d0, two = 2.0d0,
166 $ fudge = two, zero = 0.0d0 )
169 INTEGER i, it, itmax, negcnt
170 DOUBLE PRECISION atoli, eps, left, mid, right, rtoli, tmp1,
178 INTRINSIC abs, int, log, max
185 tnorm = max( abs( gl ), abs( gu ) )
187 atoli = fudge*two*pivmin
189 itmax = int( ( log( tnorm+pivmin )-log( pivmin ) ) /
194 left = gl - fudge*tnorm*eps*n - fudge*two*pivmin
195 right = gu + fudge*tnorm*eps*n + fudge*two*pivmin
202 tmp1 = abs( right - left )
203 tmp2 = max( abs(right), abs(left) )
204 IF( tmp1.LT.max( atoli, pivmin, rtoli*tmp2 ) )
THEN
215 mid = half * (left + right)
218 IF( abs( tmp1 ).LT.pivmin )
221 $ negcnt = negcnt + 1
224 tmp1 = d( i ) - e2( i-1 ) / tmp1 - mid
225 IF( abs( tmp1 ).LT.pivmin )
228 $ negcnt = negcnt + 1
231 IF(negcnt.GE.iw)
THEN
242 w = half * (left + right)
243 werr = half * abs( right - left )