(ctx, f, root, tol=None, maxsteps=10, **kwargs)
return i
Return the multiplicity of a given root of f.

    Internally, numerical derivatives are used. This might be inefficient for
    higher order derviatives. Due to this, ``multiplicity`` cancels after
    evaluating 10 derivatives by default. You can be specify the n-th derivative
    using the dnf keyword.

    >>> from sympy.mpmath import *
    >>> multiplicity(lambda x: sin(x) - 1, pi/2)
    2
Return the multiplicity of a given root of f.
Return the multiplicity of a given root of f .
def multiplicity(ctx, f, root, tol=None, maxsteps=10, **kwargs):
    """
    Return the multiplicity of a given root of f.

    Internally, numerical derivatives are used. This might be inefficient for
    higher order derviatives. Due to this, ``multiplicity`` cancels after
    evaluating 10 derivatives by default. You can be specify the n-th derivative
    using the dnf keyword.

    >>> from sympy.mpmath import *
    >>> multiplicity(lambda x: sin(x) - 1, pi/2)
    2

    """
    if tol is None:
        tol = ctx.eps ** 0.8
    kwargs['d0f'] = f
    for i in xrange(maxsteps):
        dfstr = 'd' + str(i) + 'f'
        if dfstr in kwargs:
            df = kwargs[dfstr]
        else:
            df = lambda x: ctx.diff(f, x, i)
        if not abs(df(root)) < tol:
            break
    return i
def multiplicity ( ctx , f , root , tol = None , maxsteps = 10 , * * kwargs ) : if tol is None : tol = ctx . eps ** 0.8 kwargs [ 'd0f' ] = f for i in xrange ( maxsteps ) : dfstr = 'd' + str ( i ) + 'f' if dfstr in kwargs : df = kwargs [ dfstr ] else : df = lambda x : ctx . diff ( f , x , i ) if not abs ( df ( root ) ) < tol : break return i