code: private static long specialNStar(final long numSamplesI, final double p, final double delta) {
      final double q, numSamplesF;
      double tot, curTerm;
      long m;
      assertTrue(numSamplesI >= 1);
      assertTrue((0.0 < p) && (p < 1.0));
      assertTrue((0.0 < delta) && (delta < 1.0));
      q = 1.0 - p;
      numSamplesF = numSamplesI;
      // Use a different algorithm if the following isn't true; this one will be too slow, or worse.
      assertTrue((numSamplesF / p) < 500.0);
      curTerm = Math.pow(p, numSamplesF);  // curTerm = posteriorProbability (k, k, p)
      assertTrue(curTerm > 1e-100); // sanity check for non-use of logarithms
      tot = curTerm;
      m = numSamplesI;
      while (tot <= delta) { // this test can fail even the first time
        curTerm = (curTerm * q * (m)) / ((m + 1) - numSamplesI);
        tot += curTerm;
        m += 1;
      }
      // we have reached a state where tot > delta, so back up one
      return (m - 1);
    }
docs: in est = (numSamples / p), and that can be Very, Very Big.