code: def _sample_d(self):
          
  
          p = self._get_next() / PRNG_MAX_RAND
          for ix, v in enumerate(self.cdf):
              if v > p:
                  return ix + 1
          return ix + 1
docs: Samples degree given the precomputed
          distributions above and the linear PRNG output