def make_simp(z):
 def simp(expr):
  ' Efficiently simplify the rational function ``expr``. '
  (numer, denom) = expr.as_numer_denom()
  (c, numer, denom) = poly(numer, z).cancel(poly(denom, z))
  return ((c * numer.as_expr()) / denom.as_expr())
 return simp

def make_simp ( z ) : def simp ( expr ) : ( numer , denom ) = expr . as_numer_denom ( ) ( c , numer , denom ) = poly ( numer , z ) . cancel ( poly ( denom , z ) ) return ( ( c * numer . as_expr ( ) ) / denom . as_expr ( ) ) return simp
create a function that simplifies rational functions in z .