def length_compare(s1, s2):
    """Returns a number between 0 and 1:
        How similiar len(s1) is to len(s2).
    If s1 is more than 2X the length of s2 similiarity is 0.
    If s1 is shorter than s2, similiarity is the ratio of len(s1) to len(s2).
    If s1 is longer than s2, but less than double:
        similiarity is the ratio of the amount len(s1) exceeds len(s2) to len(s2).
    Strings of identical length will have a length similiarity of 1.
    """
    l1, l2 = len(s1), len(s2)
    return 0.0 if l1 > 2 * l2 else (l1 if l1 <= l2 else (l2 - (l1 - l2))) / l2