code: def _rapRperiAxiFindStart(R,E,L,pot,rap=False,startsign=1.):
      
      if rap:
          rtry= 2.*R
      else:
          rtry= R/2.
      while startsign*_rapRperiAxiEq(rtry,E,L,pot) > 0. \
              and rtry > 0.000000001:
          if rap:
              if rtry > 100.: #pragma: no cover
                  raise UnboundError("Orbit seems to be unbound")
              rtry*= 2.
          else:
              rtry/= 2.
      if rtry < 0.000000001: return 0.
      return rtry
docs: NAME:
         _rapRperiAxiFindStart
      PURPOSE:
         Find adequate start or end points to solve for rap and rperi
      INPUT:
         R - Galactocentric radius
         E - energy
         L - angular momentum
         pot - potential
         rap - if True, find the rap end-point
         startsign= set to -1 if the function is not positive (due to gamma)
      OUTPUT:
         rstart or rend
      HISTORY:
         2010-12-01 - Written - Bovy (NYU)