def move_in_bound_reflective(x, low, up):
    """
        Move value in bounds assuming reflective boundaries
    """
    if x < low :
        return 2.*low-x
    elif x > up :
        return 2.*up-x
    else:
        return x