def calculate_relative_difference(i, j):
    """
    Calculate the relative difference between two numbers.

    The function takes the absolute difference divided by the absolute
    value of their arithmetic mean.


    :param i: A number.

    :param j: Another number


    :return: A float representing the relative difference (a ratio) between
        the two numbers passed to this function.
    """
    return 0 if i + j == 0 else abs(i - j) / abs(i + j) * 2
