def _tan1(p, x, prec):
    """
    Helper function of `rs\_tan`.

    Return the series expansion of tan of a univariate series using Newton's
    method. It takes advantage of the fact that series expansion of atan is
    easier than that of tan.

    Consider `f(x) = y - atan(x)`
    Let r be a root of f(x) found using Newton's method.
    Then `f(r) = 0`
    Or `y  = atan(x)` where `x = tan(y)` as required.
    """
    R = p.ring
    p1 = R(0)
    for precx in _giant_steps(prec):
        tmp = rs_atan(p1, x, precx) - p
        tmp = rs_mul(tmp, 1 + rs_square(p1, x, precx), x, precx)
        p1 += tmp
    return p1
dataset/ETHPy150Open sympy/sympy/sympy/polys/ring_series.py/_tan1/swapped operands of `-`