--- 
:name: slarrb
:md5sum: ac43c9637a4b29c89256e616a3b9c674
:category: :subroutine
:arguments: 
- n: 
    :type: integer
    :intent: input
- d: 
    :type: real
    :intent: input
    :dims: 
    - n
- lld: 
    :type: real
    :intent: input
    :dims: 
    - n-1
- ifirst: 
    :type: integer
    :intent: input
- ilast: 
    :type: integer
    :intent: input
- rtol1: 
    :type: real
    :intent: input
- rtol2: 
    :type: real
    :intent: input
- offset: 
    :type: integer
    :intent: input
- w: 
    :type: real
    :intent: input/output
    :dims: 
    - n
- wgap: 
    :type: real
    :intent: input/output
    :dims: 
    - n-1
- werr: 
    :type: real
    :intent: input/output
    :dims: 
    - n
- work: 
    :type: real
    :intent: workspace
    :dims: 
    - 2*n
- iwork: 
    :type: integer
    :intent: workspace
    :dims: 
    - 2*n
- pivmin: 
    :type: real
    :intent: input
- spdiam: 
    :type: real
    :intent: input
- twist: 
    :type: integer
    :intent: input
- info: 
    :type: integer
    :intent: output
:substitutions: {}

:fortran_help: "      SUBROUTINE SLARRB( N, D, LLD, IFIRST, ILAST, RTOL1, RTOL2, OFFSET, W, WGAP, WERR, WORK, IWORK, PIVMIN, SPDIAM, TWIST, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  Given the relatively robust representation(RRR) L D L^T, SLARRB\n\
  *  does \"limited\" bisection to refine the eigenvalues of L D L^T,\n\
  *  W( IFIRST-OFFSET ) through W( ILAST-OFFSET ), to more accuracy. Initial\n\
  *  guesses for these eigenvalues are input in W, the corresponding estimate\n\
  *  of the error in these guesses and their gaps are input in WERR\n\
  *  and WGAP, respectively. During bisection, intervals\n\
  *  [left, right] are maintained by storing their mid-points and\n\
  *  semi-widths in the arrays W and WERR respectively.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The order of the matrix.\n\
  *\n\
  *  D       (input) REAL             array, dimension (N)\n\
  *          The N diagonal elements of the diagonal matrix D.\n\
  *\n\
  *  LLD     (input) REAL             array, dimension (N-1)\n\
  *          The (N-1) elements L(i)*L(i)*D(i).\n\
  *\n\
  *  IFIRST  (input) INTEGER\n\
  *          The index of the first eigenvalue to be computed.\n\
  *\n\
  *  ILAST   (input) INTEGER\n\
  *          The index of the last eigenvalue to be computed.\n\
  *\n\
  *  RTOL1   (input) REAL            \n\
  *  RTOL2   (input) REAL            \n\
  *          Tolerance for the convergence of the bisection intervals.\n\
  *          An interval [LEFT,RIGHT] has converged if\n\
  *          RIGHT-LEFT.LT.MAX( RTOL1*GAP, RTOL2*MAX(|LEFT|,|RIGHT|) )\n\
  *          where GAP is the (estimated) distance to the nearest\n\
  *          eigenvalue.\n\
  *\n\
  *  OFFSET  (input) INTEGER\n\
  *          Offset for the arrays W, WGAP and WERR, i.e., the IFIRST-OFFSET\n\
  *          through ILAST-OFFSET elements of these arrays are to be used.\n\
  *\n\
  *  W       (input/output) REAL             array, dimension (N)\n\
  *          On input, W( IFIRST-OFFSET ) through W( ILAST-OFFSET ) are\n\
  *          estimates of the eigenvalues of L D L^T indexed IFIRST throug\n\
  *          ILAST.\n\
  *          On output, these estimates are refined.\n\
  *\n\
  *  WGAP    (input/output) REAL             array, dimension (N-1)\n\
  *          On input, the (estimated) gaps between consecutive\n\
  *          eigenvalues of L D L^T, i.e., WGAP(I-OFFSET) is the gap between\n\
  *          eigenvalues I and I+1. Note that if IFIRST.EQ.ILAST\n\
  *          then WGAP(IFIRST-OFFSET) must be set to ZERO.\n\
  *          On output, these gaps are refined.\n\
  *\n\
  *  WERR    (input/output) REAL             array, dimension (N)\n\
  *          On input, WERR( IFIRST-OFFSET ) through WERR( ILAST-OFFSET ) are\n\
  *          the errors in the estimates of the corresponding elements in W.\n\
  *          On output, these errors are refined.\n\
  *\n\
  *  WORK    (workspace) REAL             array, dimension (2*N)\n\
  *          Workspace.\n\
  *\n\
  *  IWORK   (workspace) INTEGER array, dimension (2*N)\n\
  *          Workspace.\n\
  *\n\
  *  PIVMIN  (input) REAL\n\
  *          The minimum pivot in the Sturm sequence.\n\
  *\n\
  *  SPDIAM  (input) REAL\n\
  *          The spectral diameter of the matrix.\n\
  *\n\
  *  TWIST   (input) INTEGER\n\
  *          The twist index for the twisted factorization that is used\n\
  *          for the negcount.\n\
  *          TWIST = N: Compute negcount from L D L^T - LAMBDA I = L+ D+ L+^T\n\
  *          TWIST = 1: Compute negcount from L D L^T - LAMBDA I = U- D- U-^T\n\
  *          TWIST = R: Compute negcount from L D L^T - LAMBDA I = N(r) D(r) N(r)\n\
  *\n\
  *  INFO    (output) INTEGER\n\
  *          Error flag.\n\
  *\n\n\
  *  Further Details\n\
  *  ===============\n\
  *\n\
  *  Based on contributions by\n\
  *     Beresford Parlett, University of California, Berkeley, USA\n\
  *     Jim Demmel, University of California, Berkeley, USA\n\
  *     Inderjit Dhillon, University of Texas, Austin, USA\n\
  *     Osni Marques, LBNL/NERSC, USA\n\
  *     Christof Voemel, University of California, Berkeley, USA\n\
  *\n\
  *  =====================================================================\n\
  *\n"
