(m)
return L, U
Find ``(L, U)`` such that ``L <= phi^-1(m) <= U``.

    Examples
    ========

    >>> from sympy.polys.polyroots import _inv_totient_estimate

    >>> _inv_totient_estimate(192)
    (192, 840)
    >>> _inv_totient_estimate(400)
    (400, 1750)
Find ``(L, U)`` such that ``L <= phi^-1(m) <= U``.
Find ( L U ) such that L < = phi^ - 1 ( m ) < = U .
def _inv_totient_estimate(m):
    """
    Find ``(L, U)`` such that ``L <= phi^-1(m) <= U``.

    Examples
    ========

    >>> from sympy.polys.polyroots import _inv_totient_estimate

    >>> _inv_totient_estimate(192)
    (192, 840)
    >>> _inv_totient_estimate(400)
    (400, 1750)

    """
    primes = [ d + 1 for d in divisors(m) if isprime(d + 1) ]

    a, b = 1, 1

    for p in primes:
        a *= p
        b *= p - 1

    L = m
    U = int(math.ceil(m*(float(a)/b)))

    P = p = 2
    primes = []

    while P <= U:
        p = nextprime(p)
        primes.append(p)
        P *= p

    P //= p
    b = 1

    for p in primes[:-1]:
        b *= p - 1

    U = int(math.ceil(m*(float(P)/b)))

    return L, U
def _inv_totient_estimate ( m ) : primes = [ d + 1 for d in divisors ( m ) if isprime ( d + 1 ) ] a , b = 1 , 1 for p in primes : a *= p b *= p - 1 L = m U = int ( math . ceil ( m * ( float ( a ) / b ) ) ) P = p = 2 primes = [ ] while P <= U : p = nextprime ( p ) primes . append ( p ) P *= p P //= p b = 1 for p in primes [ : - 1 ] : b *= p - 1 U = int ( math . ceil ( m * ( float ( P ) / b ) ) ) return L , U