def bisect_dimension(lowerbounds, upperbounds, dim):
    """
    Returns two ranges of input variables with the dim-th original interval bisected
    """
    mid = (lowerbounds[dim] + upperbounds[dim]) / 2
    lb1 = lowerbounds.copy()
    ub1 = upperbounds.copy()
    ub1[dim] = mid
    lb2 = lowerbounds.copy()
    lb2[dim] = mid
    ub2 = upperbounds.copy()
    return (lb1, ub1), (lb2, ub2)