def accuracy_efficiency(rk1, parallel=False, mode='float', tol=1e-14, p=None):
    """
    Compute the accuracy efficiency of method rk1.

    The accuracy efficiency is

    `\\eta = \\frac{1}{s_1} \\left(\\frac{1}{A_1}\\right)^{1/p+1}`

    where `s_1` are the number of stages of the the method and
    `A_1` is its principal error norms.

    **Examples**::

        Accuracy efficiency of Dormand-Prince
        >>> from nodepy import rk
        >>> dp5 = rk.loadRKM('DP5')
        >>> rk.accuracy_efficiency(dp5) # doctest: +ELLIPSIS
        0.5264921944121...
    """
    if p is None:
        p = rk1.order(mode=mode, tol=tol)
    A1 = rk1.principal_error_norm(mode=mode, tol=tol)
    if parallel:
        return 1.0 / rk1.num_seq_dep_stages() * (1.0 / A1) ** (1.0 / (p + 1))
    else:
        return 1.0 / len(rk1) * (1.0 / A1) ** (1.0 / (p + 1))
