def fps(f, x=None, x0=0, dir=1, hyper=True, order=4, rational=True, full=False):
 f = sympify(f)
 if (x is None):
  free = f.free_symbols
  if (len(free) == 1):
   x = free.pop()
  elif (not free):
   return f
  else:
   raise NotImplementedError('multivariate formal power series')
 result = compute_fps(f, x, x0, dir, hyper, order, rational, full)
 if (result is None):
  return f
 return FormalPowerSeries(f, x, x0, dir, result)

def fps ( f , x = None , x0 = 0 , dir = 1 , hyper = True , order = 4 , rational = True , full = False ) : f = sympify ( f ) if ( x is None ) : free = f . free_symbols if ( len ( free ) == 1 ) : x = free . pop ( ) elif ( not free ) : return f else : raise NotImplementedError ( 'multivariate formal power series' ) result = compute_fps ( f , x , x0 , dir , hyper , order , rational , full ) if ( result is None ) : return f return FormalPowerSeries ( f , x , x0 , dir , result )
generates formal power series of f .