code: public static int getKFromEpsilon(final double epsilon, final boolean pmf) {
      //Ensure that eps is >= than the lowest possible eps given MAX_K and pmf=false.
      final double eps = max(epsilon, 4.7634E-5);
      final double kdbl = pmf
          ? exp(log(2.446 / eps) / 0.9433)
          : exp(log(2.296 / eps) / 0.9723);
      final double krnd = round(kdbl);
      final double del = abs(krnd - kdbl);
      final int k = (int) ((del < 1E-6) ? krnd : ceil(kdbl));
      return max(MIN_K, min(MAX_K, k));
    }
docs: thousands of trials