private static byte checkHistogram(long packAddr,
                                       long minVal, long maxVal,
                                       long packMin, long packMax,
                                       boolean isFloat) {
        if (intervalTooLarge(minVal, maxVal) || intervalTooLarge(packMin, packMax)) {
            return RSValue.Some;
        }
        int minBit, maxBit;
        if (isFloat) {
            double dminVal = Double.longBitsToDouble(minVal);
            double dmaxVal = Double.longBitsToDouble(maxVal);
            double dpackMin = Double.longBitsToDouble(packMin);
            double dpackMax = Double.longBitsToDouble(packMax);
            assert dminVal <= dmaxVal;
            assert dpackMin <= dpackMax;
            if (dmaxVal < dpackMin || dminVal > dpackMax) {
                return RSValue.None;
            }
            if (dmaxVal >= dpackMax && dminVal <= dpackMin) {
                return RSValue.All;
            }
            if (dmaxVal >= dpackMax || dminVal <= dpackMin) {
                return RSValue.Some;
            }
            double intervalLen = (dpackMax - dpackMin) / (double) PACK_HISTO_SIZE_BIT;
            minBit = (int) ((dminVal - dpackMin) / intervalLen);
            maxBit = (int) ((dmaxVal - dpackMin) / intervalLen);
        } else {
            if (maxVal < packMin || minVal > packMax) {
                return RSValue.None;
            }
            if (maxVal >= packMax && minVal <= packMin) {
                return RSValue.All;
            }
            if (maxVal >= packMax || minVal <= packMin) {
                return RSValue.Some;
            }
            if (exactMode(packMin, packMax)) {
                minBit = (int) (minVal - packMin - 1);
                maxBit = (int) (maxVal - packMin - 1);
            } else {
                double intervalLen = (packMax - packMin) / (double) PACK_HISTO_SIZE_BIT;
                minBit = (int) ((minVal - packMin - 1) / intervalLen);
                maxBit = (int) ((maxVal - packMin - 1) / intervalLen);
            }
        }
        assert minBit >= 0;
        assert maxBit >= 0;
        if (maxBit >= PACK_HISTO_SIZE_BIT) {
            return RSValue.Some;
        }

        int index = -1;
        int histIntValue = 0;
        for (int bit = minBit; bit <= maxBit; bit++) {
            int newIndex = bit >>> 5;
            if (newIndex != index) {
                index = newIndex;
                histIntValue = MemoryUtil.getInt(packAddr + (index << 2));
                //System.out.printf("index: %s, histIntValue: %s\n", index, histIntValue);
            }
            if (((histIntValue >>> (bit & MOD_32)) & 1) != 0) {
                return RSValue.Some;
            }
        }
        return RSValue.None;
    }
Hash + Histogram, each takes 1024 bits.

| hash index0 | histo index0 | hash index1 | histo index1 | ...
|  1024 bits  |  1024 bits   |  1024 bits  |  1024 bits   | ...
indexr-segment/src/main/java/io/indexr/segment/index/RSIndex_Histogram_V2.java