def compute_fps(f, x, x0=0, dir=1, hyper=True, order=4, rational=True, full=False):
 f = sympify(f)
 x = sympify(x)
 if (not f.has(x)):
  return None
 x0 = sympify(x0)
 if (dir == '+'):
  dir = S.One
 elif (dir == '-'):
  dir = (- S.One)
 elif (dir not in [S.One, (- S.One)]):
  raise ValueError("Dir must be '+' or '-'")
 else:
  dir = sympify(dir)
 return _compute_fps(f, x, x0, dir, hyper, order, rational, full)

def compute_fps ( f , x , x0 = 0 , dir = 1 , hyper = True , order = 4 , rational = True , full = False ) : f = sympify ( f ) x = sympify ( x ) if ( not f . has ( x ) ) : return None x0 = sympify ( x0 ) if ( dir == '+' ) : dir = S . One elif ( dir == '-' ) : dir = ( - S . One ) elif ( dir not in [ S . One , ( - S . One ) ] ) : raise ValueError ( "Dir must be '+' or '-'" ) else : dir = sympify ( dir ) return _compute_fps ( f , x , x0 , dir , hyper , order , rational , full )
computes the formula for formal power series of a function .