def ramp(x):
    """smooth ramp function from curl noise paper"""
    if x > 1.0:
        return 1.0
    elif x < -1.0:
        return -1.0
    else:
        return 15.0 / 8.0 * x - 10.0 / 8.0 * x * x * x + 3.0 / 8.0 * x * x * x * x * x