docs: public static double computePi(DBIDRef ignore, DoubleDBIDListIter it, double[] p, double perplexity, double logPerp) {
      // Relation to paper: beta == 1. / (2*sigma*sigma)
      double beta = estimateInitialBeta(ignore, it, perplexity);
      double diff = computeH(ignore, it, p, -beta) - logPerp;
      double betaMin = 0.;
      double betaMax = Double.POSITIVE_INFINITY;
      for(int tries = 0; tries < PERPLEXITY_MAXITER && Math.abs(diff) > PERPLEXITY_ERROR; ++tries) {
        if(diff > 0) {
          betaMin = beta;
          beta += (betaMax == Double.POSITIVE_INFINITY) ? beta : ((betaMax - beta) * .5);
        }
        else {
          betaMax = beta;
          beta -= (beta - betaMin) * .5;
        }
        diff = computeH(ignore, it, p, -beta) - logPerp;
      }
      return beta;
    }