@debug
@timeit
@cacheit
def mrv_leadterm(e, x):
 Omega = SubsSet()
 if (not e.has(x)):
  return (e, S.Zero)
 if (Omega == SubsSet()):
  (Omega, exps) = mrv(e, x)
 if (not Omega):
  series = calculate_series(e, x)
  (c0, e0) = series.leadterm(x)
  if (e0 != 0):
   raise ValueError('e0 should be 0')
  return (c0, e0)
 if (x in Omega):
  Omega_up = moveup2(Omega, x)
  e_up = moveup([e], x)[0]
  exps_up = moveup([exps], x)[0]
  e = e_up
  Omega = Omega_up
  exps = exps_up
 w = Dummy('w', real=True, positive=True, finite=True)
 (f, logw) = rewrite(exps, Omega, x, w)
 series = calculate_series(f, w, logx=logw)
 return series.leadterm(w)

@ debug @ timeit @ cacheit def mrv_leadterm ( e , x ) : Omega = SubsSet ( ) if ( not e . has ( x ) ) : return ( e , S . Zero ) if ( Omega == SubsSet ( ) ) : ( Omega , exps ) = mrv ( e , x ) if ( not Omega ) : series = calculate_series ( e , x ) ( c0 , e0 ) = series . leadterm ( x ) if ( e0 != 0 ) : raise ValueError ( 'e0 should be 0' ) return ( c0 , e0 ) if ( x in Omega ) : Omega_up = moveup2 ( Omega , x ) e_up = moveup ( [ e ] , x ) [ 0 ] exps_up = moveup ( [ exps ] , x ) [ 0 ] e = e_up Omega = Omega_up exps = exps_up w = Dummy ( 'w' , real = True , positive = True , finite = True ) ( f , logw ) = rewrite ( exps , Omega , x , w ) series = calculate_series ( f , w , logx = logw ) return series . leadterm ( w )
returns for e .