def new_domain_from_affine(old_domain, a=1.0, b=0.0):
    """
    old domain: domain of u(t)
    new domain: domain of u(f(t)), f(t) = a * t + b
    """
    if a == 0:
        raise ValueError("a cannot be zero")
    new_domain = (np.array(old_domain) - b) / a
    if a < 0:
        new_domain = new_domain[::-1]
    return tuple(new_domain)

    old domain: domain of u(t)
    new domain: domain of u(f(t)), f(t) = a * t + b
    
infinigen/core/util/math.py