docs: protected static double computeSigma(int i, DoubleArray pij_row, double perplexity, double log_perp, double[] pij_i) {
      double max = pij_row.get((int) FastMath.ceil(perplexity)) / Math.E;
      double beta = 1 / max; // beta = 1. / (2*sigma*sigma)
      double diff = computeH(pij_row, pij_i, -beta) - log_perp;
      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(pij_row, pij_i, -beta) - log_perp;
      }
      return beta;
    }