docs: public static short computeSize(final int k) {
      if ((k < 1) || (k > MAX_ABS_VALUE)) {
        throw new SketchesArgumentException("Can only encode strictly positive sketch sizes "
                + "less than " + MAX_ABS_VALUE + ", found: " + k);
      }
  
      final int p = Util.toLog2(Util.floorPowerOf2(k), "computeSize: p");
  
      // because of floor() + 1 below, need to check power of 2 here
      if (Util.isPowerOf2(k)) {
        return (short) (((p & EXPONENT_MASK) << EXPONENT_SHIFT) & OUTPUT_MASK);
      }
  
      // mantissa is scalar in range [1,2); can reconstruct k as m * 2^p
      final double m = Math.pow(2.0, (Math.log(k) * INV_LN_2) - p);
  
      // Convert to index offset: ceil(m * BPO) - BPO
      // Typically in range range 0-(BINS_PER_OCTAVE-1) (but see note below)
      final int i = ((int) Math.floor(m * BINS_PER_OCTAVE) - BINS_PER_OCTAVE) + 1;
  
      // Due to ceiling, possible to overflow BINS_PER_OCTAVE
      // E.g., if BPO = 2048 then for k=32767 we have p=14. Except that 32767 > decodeValue
      // (p=14, i=2047)=32756, so we encode and return p+1
      if (i == BINS_PER_OCTAVE) {
        return (short) ((((p + 1) & EXPONENT_MASK) << EXPONENT_SHIFT) & OUTPUT_MASK);
      }
  
      return (short) (((p & EXPONENT_MASK) << EXPONENT_SHIFT) | ((i & INDEX_MASK) & OUTPUT_MASK));
    }