def get_case(d, t):
 if (not d.has(t)):
  if d.is_one:
   return 'base'
  return 'primitive'
 if d.rem(Poly(t, t)).is_zero:
  return 'exp'
 if d.rem(Poly((1 + (t ** 2)), t)).is_zero:
  return 'tan'
 if (d.degree(t) > 1):
  return 'other_nonlinear'
 return 'other_linear'

def get_case ( d , t ) : if ( not d . has ( t ) ) : if d . is_one : return 'base' return 'primitive' if d . rem ( Poly ( t , t ) ) . is_zero : return 'exp' if d . rem ( Poly ( ( 1 + ( t ** 2 ) ) , t ) ) . is_zero : return 'tan' if ( d . degree ( t ) > 1 ) : return 'other_nonlinear' return 'other_linear'
returns the type of the derivation d .