def TR3(rv):
 from sympy.simplify.simplify import signsimp
 def f(rv):
  if (not isinstance(rv, TrigonometricFunction)):
   return rv
  rv = rv.func(signsimp(rv.args[0]))
  if ((rv.args[0] - (S.Pi / 4)).is_positive is ((S.Pi / 2) - rv.args[0]).is_positive is True):
   fmap = {cos: sin, sin: cos, tan: cot, cot: tan, sec: csc, csc: sec}
   rv = fmap[rv.func](((S.Pi / 2) - rv.args[0]))
  return rv
 return bottom_up(rv, f)

def TR3 ( rv ) : from sympy . simplify . simplify import signsimp def f ( rv ) : if ( not isinstance ( rv , TrigonometricFunction ) ) : return rv rv = rv . func ( signsimp ( rv . args [ 0 ] ) ) if ( ( rv . args [ 0 ] - ( S . Pi / 4 ) ) . is_positive is ( ( S . Pi / 2 ) - rv . args [ 0 ] ) . is_positive is True ) : fmap = { cos : sin , sin : cos , tan : cot , cot : tan , sec : csc , csc : sec } rv = fmap [ rv . func ] ( ( ( S . Pi / 2 ) - rv . args [ 0 ] ) ) return rv return bottom_up ( rv , f )
induced formula: example sin = -sin(a) examples .