import mpmath


def cdf(x):
    """
    Cumulative distribution function (CDF) of the raised cosine distribution.

    The CDF of the raised cosine distribution is

        F(x) = (pi + x + sin(x))/(2*pi)
    """
    with mpmath.extradps(5):
        x = mpmath.mpf(x)
        if x <= -mpmath.pi:
            return mpmath.mp.zero
        if x >= mpmath.pi:
            return mpmath.mp.one
        return mpmath.mpf('1/2') + (x + mpmath.sin(x))/(2*mpmath.pi)