def futrig(e, **kwargs):
 from sympy.simplify.fu import hyper_as_trig
 from sympy.simplify.simplify import bottom_up
 e = sympify(e)
 if (not isinstance(e, Basic)):
  return e
 if (not e.args):
  return e
 old = e
 e = bottom_up(e, (lambda x: _futrig(x, **kwargs)))
 if (kwargs.pop('hyper', True) and e.has(HyperbolicFunction)):
  (e, f) = hyper_as_trig(e)
  e = f(_futrig(e))
 if ((e != old) and e.is_Mul and e.args[0].is_Rational):
  e = Mul(*e.as_coeff_Mul())
 return e

def futrig ( e , ** kwargs ) : from sympy . simplify . fu import hyper_as_trig from sympy . simplify . simplify import bottom_up e = sympify ( e ) if ( not isinstance ( e , Basic ) ) : return e if ( not e . args ) : return e old = e e = bottom_up ( e , ( lambda x : _futrig ( x , ** kwargs ) ) ) if ( kwargs . pop ( 'hyper' , True ) and e . has ( HyperbolicFunction ) ) : ( e , f ) = hyper_as_trig ( e ) e = f ( _futrig ( e ) ) if ( ( e != old ) and e . is_Mul and e . args [ 0 ] . is_Rational ) : e = Mul ( * e . as_coeff_Mul ( ) ) return e
return simplified e using fu-like transformations .