code: def rs_series(expr, a, prec):
      """Return the series expansion of an expression about 0.
  
      Parameters
      ==========
  
      expr : :class:`Expr`
      a : :class:`Symbol` with respect to which expr is to be expanded
      prec : order of the series expansion
  
      Currently supports multivariate Taylor series expansion. This is much
      faster that SymPy's series method as it uses sparse polynomial operations.
  
      It automatically creates the simplest ring required to represent the series
      expansion through repeated calls to sring.
  
      Examples
      ========
  
      >>> from sympy.polys.ring_series import rs_series
      >>> from sympy import sin, cos, exp, tan, symbols, QQ
      >>> a, b, c = symbols('a, b, c')
      >>> rs_series(sin(a) + exp(a), a, 5)
      1/24*a**4 + 1/2*a**2 + 2*a + 1
      >>> series = rs_series(tan(a + b)*cos(a + c), a, 2)
      >>> series.as_expr()
      -a*sin(c)*tan(b) + a*cos(c)*tan(b)**2 + a*cos(c) + cos(c)*tan(b)
      >>> series = rs_series(exp(a**QQ(1,3) + a**QQ(2, 5)), a, 1)
      >>> series.as_expr()
      a**(11/15) + a**(4/5)/2 + a**(2/5) + a**(2/3)/2 + a**(1/3) + 1
  
      """
      R, series = sring(expr, domain=QQ, expand=False, series=True)
      if a not in R.symbols:
          R = R.add_gens(
              [
                  a,
              ]
          )
      series = series.set_ring(R)
      series = _rs_series(expr, series, a, prec)
      R = series.ring
      gen = R(a)
      prec_got = series.degree(gen) + 1
  
      if prec_got >= prec:
          return rs_trunc(series, gen, prec)
      else:
          # increase the requested number of terms to get the desired
          # number keep increasing (up to 9) until the received order
          # is different than the original order and then predict how
          # many additional terms are needed
          for more in range(1, 9):
              p1 = _rs_series(expr, series, a, prec=prec + more)
              gen = gen.set_ring(p1.ring)
              new_prec = p1.degree(gen) + 1
              if new_prec != prec_got:
                  prec_do = ceiling(
                      prec
                      + (prec - prec_got) * more / (new_prec - prec_got)
                  )
                  p1 = _rs_series(expr, series, a, prec=prec_do)
                  while p1.degree(gen) + 1 < prec:
                      p1 = _rs_series(expr, series, a, prec=prec_do)
                      gen = gen.set_ring(p1.ring)
                      prec_do *= 2
                  break
              else:
                  break
          else:
              raise ValueError(
                  "Could not calculate %s terms for %s"
                  % (str(prec), expr)
              )
          return rs_trunc(p1, gen, prec)
  
imports: from sympy.polys.domains import QQ, EX
  from sympy.polys.rings import PolyElement, ring, sring
  from sympy.polys.polyerrors import DomainError
  from sympy.polys.monomials import monomial_min, monomial_mul, monomial_div, monomial_ldiv
  from mpmath.libmp.libintmath import ifac
  from sympy.core import PoleError, Function, Expr
  from sympy.core.numbers import Rational
  from sympy.core.intfunc import igcd
  from sympy.functions import sin, cos, tan, atan, exp, atanh, tanh, log, ceiling
  from sympy.utilities.misc import as_int
  from mpmath.libmp.libintmath import giant_steps
  import math
label_desc: Use image node_id 50 for calling a global function with example usage: rs_series(expr, a, prec) and returns: rs_trunc, rs_trunc