@debug
@timeit
def calculate_series(e, x, logx=None):
 from sympy.polys import cancel
 for t in e.lseries(x, logx=logx):
  t = cancel(t)
  if (t.has(exp) and t.has(log)):
   t = powdenest(t)
  if t.simplify():
   break
 return t

@ debug @ timeit def calculate_series ( e , x , logx = None ) : from sympy . polys import cancel for t in e . lseries ( x , logx = logx ) : t = cancel ( t ) if ( t . has ( exp ) and t . has ( log ) ) : t = powdenest ( t ) if t . simplify ( ) : break return t
calculates at least one term of the series of "e" in "x" .