def rs_cos_sin(p, x, prec):
    """
    Return the tuple `(rs\_cos(p, x, prec)`, `rs\_sin(p, x, prec))`.

    Is faster than calling rs_cos and rs_sin separately
    """
    if rs_is_puiseux(p, x):
        return rs_puiseux(rs_cos_sin, p, x, prec)
    t = rs_tan(p/2, x, prec)
    t2 = rs_square(t, x, prec)
    p1 = rs_series_inversion(1 + t2, x, prec)
    return (rs_mul(p1, 1 - t2, x, prec), rs_mul(p1, 2*t, x, prec))
dataset/ETHPy150Open sympy/sympy/sympy/polys/ring_series.py/rs_cos_sin/original