def finearc(x):
    is2 = (x >= 0.5)
    if is2:
        x = 1.0 - x
    v = ((x * 2) ** 2) * 0.5
    if is2:
        v = 1.0 - v
    return v