def METHOD_NAME(x, target, accel, decel):
    if x < target:
        x += accel
        return min(x, target)
    elif x > target:
        x -= decel
        return max(x, target)
    else:
        return x