(f, n=15, maxsteps=50, cleanup=True)
return F.nroots(n=n, maxsteps=maxsteps, cleanup=cleanup)
Compute numerical approximations of roots of ``f``.

    Examples
    ========

    >>> from sympy import nroots
    >>> from sympy.abc import x

    >>> nroots(x**2 - 3, n=15)
    [-1.73205080756888, 1.73205080756888]
    >>> nroots(x**2 - 3, n=30)
    [-1.73205080756887729352744634151, 1.73205080756887729352744634151]
Compute numerical approximations of roots of ``f``.
Compute numerical approximations of roots of f .
def nroots(f, n=15, maxsteps=50, cleanup=True):
    """
    Compute numerical approximations of roots of ``f``.

    Examples
    ========

    >>> from sympy import nroots
    >>> from sympy.abc import x

    >>> nroots(x**2 - 3, n=15)
    [-1.73205080756888, 1.73205080756888]
    >>> nroots(x**2 - 3, n=30)
    [-1.73205080756887729352744634151, 1.73205080756887729352744634151]

    """
    try:
        F = Poly(f, greedy=False)
    except GeneratorsNeeded:
        raise PolynomialError(
            "can't compute numerical roots of %s, not a polynomial" % f)

    return F.nroots(n=n, maxsteps=maxsteps, cleanup=cleanup)
def nroots ( f , n = 15 , maxsteps = 50 , cleanup = True ) : try : F = Poly ( f , greedy = False ) except GeneratorsNeeded : raise PolynomialError ( "can't compute numerical roots of %s, not a polynomial" % f ) return F . nroots ( n = n , maxsteps = maxsteps , cleanup = cleanup )