import mpmath


def _norm_delta_cdf(a, b):
    """
    Compute CDF(b) - CDF(a) for the standard normal distribution CDF.

    The function assumes a <= b.
    """
    with mpmath.extradps(5):
        if a == b:
            return mpmath.mp.zero
        if a > 0:
            delta = mpmath.ncdf(-a) - mpmath.ncdf(-b)
        else:
            delta = mpmath.ncdf(b) - mpmath.ncdf(a)
        return delta