import math


def normalize_value(x, exponent_min, exponent_max):
    """
    Normalize the input value. Note that this assumes that `allocation: lg2` is used for the color space in
    the OpenColorIO configuration.
    :param x: Input value
    :param exponent_min: Smallest exponent for the input values
    :param exponent_max: Largest exponent for the input values
    :return: Normalized value
    """
    return (math.log2(x) - exponent_min) / abs(exponent_max - exponent_min)