(f, *gens, **args)
Compute a list of greatest factorial factors of ``f``.

    Examples
    ========

    >>> from sympy import gff_list, ff
    >>> from sympy.abc import x

    >>> f = x**5 + 2*x**4 - x**3 - 2*x**2

    >>> gff_list(f)
    [(x, 1), (x + 2, 4)]

    >>> (ff(x, 1)*ff(x + 2, 4)).expand() == f
    True
Compute a list of greatest factorial factors of ``f``.
Compute a list of greatest factorial factors of f .
def gff_list(f, *gens, **args):
    """
    Compute a list of greatest factorial factors of ``f``.

    Examples
    ========

    >>> from sympy import gff_list, ff
    >>> from sympy.abc import x

    >>> f = x**5 + 2*x**4 - x**3 - 2*x**2

    >>> gff_list(f)
    [(x, 1), (x + 2, 4)]

    >>> (ff(x, 1)*ff(x + 2, 4)).expand() == f
    True

    """
    options.allowed_flags(args, ['polys'])

    try:
        F, opt = poly_from_expr(f, *gens, **args)
    except PolificationFailed as exc:
        raise ComputationFailed('gff_list', 1, exc)

    factors = F.gff_list()

    if not opt.polys:
        return [(g.as_expr(), k) for g, k in factors]
    else:
        return factors
def gff_list ( f , * gens , * * args ) : options . allowed_flags ( args , [ 'polys' ] ) try : F , opt = poly_from_expr ( f , * gens , * * args ) except PolificationFailed as exc : raise ComputationFailed ( 'gff_list' , 1 , exc ) factors = F . gff_list ( ) if not opt . polys : return [ ( g . as_expr ( ) , k ) for g , k in factors ] else : return factors