(expr)
return Add(*Q) + cancel(r/g)
Put an expression over a common denominator, cancel and reduce.

    Examples
    ========

    >>> from sympy import ratsimp
    >>> from sympy.abc import x, y
    >>> ratsimp(1/x + 1/y)
    (x + y)/(x*y)
Put an expression over a common denominator, cancel and reduce.
Put an expression over a common denominator cancel and reduce .
def ratsimp(expr):
    """
    Put an expression over a common denominator, cancel and reduce.

    Examples
    ========

    >>> from sympy import ratsimp
    >>> from sympy.abc import x, y
    >>> ratsimp(1/x + 1/y)
    (x + y)/(x*y)
    """

    f, g = cancel(expr).as_numer_denom()
    try:
        Q, r = reduced(f, [g], field=True, expand=False)
    except ComputationFailed:
        return f/g

    return Add(*Q) + cancel(r/g)
def ratsimp ( expr ) : f , g = cancel ( expr ) . as_numer_denom ( ) try : Q , r = reduced ( f , [ g ] , field = True , expand = False ) except ComputationFailed : return f / g return Add ( * Q ) + cancel ( r / g )