def _find_splitting_points(expr, x):
 (p, q) = [Wild(n, exclude=[x]) for n in 'pq']
 def compute_innermost(expr, res):
  if (not isinstance(expr, Expr)):
   return
  m = expr.match(((p * x) + q))
  if (m and (m[p] != 0)):
   res.add(((- m[q]) / m[p]))
   return
  if expr.is_Atom:
   return
  for arg in expr.args:
   compute_innermost(arg, res)
 innermost = set()
 compute_innermost(expr, innermost)
 return innermost

def _find_splitting_points ( expr , x ) : ( p , q ) = [ Wild ( n , exclude = [ x ] ) for n in 'pq' ] def compute_innermost ( expr , res ) : if ( not isinstance ( expr , Expr ) ) : return m = expr . match ( ( ( p * x ) + q ) ) if ( m and ( m [ p ] != 0 ) ) : res . add ( ( ( - m [ q ] ) / m [ p ] ) ) return if expr . is_Atom : return for arg in expr . args : compute_innermost ( arg , res ) innermost = set ( ) compute_innermost ( expr , innermost ) return innermost
find numbers a such that a linear substitution x -> x + a would simplify expr .