(f, *gens, **args)
Compute discriminant of ``f``.

    Examples
    ========

    >>> from sympy import discriminant
    >>> from sympy.abc import x

    >>> discriminant(x**2 + 2*x + 3)
    -8
Compute discriminant of ``f``.
Compute discriminant of f .
def discriminant(f, *gens, **args):
    """
    Compute discriminant of ``f``.

    Examples
    ========

    >>> from sympy import discriminant
    >>> from sympy.abc import x

    >>> discriminant(x**2 + 2*x + 3)
    -8

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

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

    result = F.discriminant()

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