(rv)
return bottom_up(rv, f)
Replace tan and cot with sin/cos and cos/sin

    Examples
    ========

    >>> from sympy.simplify.fu import TR2
    >>> from sympy.abc import x
    >>> from sympy import tan, cot, sin, cos
    >>> TR2(tan(x))
    sin(x)/cos(x)
    >>> TR2(cot(x))
    cos(x)/sin(x)
    >>> TR2(tan(tan(x) - sin(x)/cos(x)))
    0
Replace tan and cot with sin/cos and cos/sin
Replace tan and cot with sin / cos and cos / sin
def TR2(rv):
    """Replace tan and cot with sin/cos and cos/sin

    Examples
    ========

    >>> from sympy.simplify.fu import TR2
    >>> from sympy.abc import x
    >>> from sympy import tan, cot, sin, cos
    >>> TR2(tan(x))
    sin(x)/cos(x)
    >>> TR2(cot(x))
    cos(x)/sin(x)
    >>> TR2(tan(tan(x) - sin(x)/cos(x)))
    0

    """

    def f(rv):
        if rv.func is tan:
            a = rv.args[0]
            return sin(a)/cos(a)
        elif rv.func is cot:
            a = rv.args[0]
            return cos(a)/sin(a)
        return rv

    return bottom_up(rv, f)
def TR2 ( rv ) : def f ( rv ) : if rv . func is tan : a = rv . args [ 0 ] return sin ( a ) / cos ( a ) elif rv . func is cot : a = rv . args [ 0 ] return cos ( a ) / sin ( a ) return rv return bottom_up ( rv , f )