def _computeNumBitDistance(numBits1, numBits2):
    """Define pairwise distance metric between vectors of numBits.

    Assigns a smaller distance to vectors that are long compared to short
    vectors despite similar delta between them. This is favorable because if we
    merge two formats with numBits 6 and 7 the relative increase in bits is
    smaller than if we merge such with numBits 1 and 2.

    :param np.ndarray numBits1: First vector of numBits.
    :param np.ndarray numBits2: Second vector of numBits.
    :return: Distance measure.
    :rtype: float
    """

    numBitsDelta = numBits1 - numBits2
    numBitsSum = numBits1 + numBits2
    return numBitsDelta.dot(numBitsDelta) / numBitsSum.dot(numBitsSum)