#NEWLINE# def _futrig( e , **kwargs ) : #NEWLINE# #INDENT# 'Helper for futrig.' #NEWLINE# from sympy.simplify.fu import TR1 , TR2 , TR3 , TR2i , TR10 , L , TR10i , TR8 , TR6 , TR15 , TR16 , TR111 , TR5 , TRmorrie , TR11 , TR14 , TR22 , TR12 #NEWLINE# from sympy.core.compatibility import _nodes #NEWLINE# if ( not e . has ( TrigonometricFunction ) ) : #NEWLINE# #INDENT# return e #NEWLINE# #UNINDENT# if coeff . is_Mul : #NEWLINE# #INDENT# ( coeff , e ) = e . as_independent ( TrigonometricFunction ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# coeff = S . One #NEWLINE# #UNINDENT# Lops = ( lambda x : ( L ( x ) , x . count_ops ( ) , _nodes ( x ) , len ( x . args ) , x . is_Add ) ) #NEWLINE# trigs = ( lambda x : x . has ( TrigonometricFunction ) ) #NEWLINE# tree = [ identity , ( TR3 , TR1 , TR12 , ( lambda x : _eapply ( factor , x , trigs ) ) , TR2 , [ identity , ( lambda x : _eapply ( _mexpand , x , trigs ) ) ] , TR2i , ( lambda x : _eapply ( ( lambda i : factor ( i . normal ( ) ) ) , x , trigs ) ) , TR14 , TR5 , TR10 , TR11 , TR6 , ( lambda x : _eapply ( factor , x , trigs ) ) , TR14 , [ identity , ( lambda x : _eapply ( _mexpand , x , trigs ) ) ] , TRmorrie , TR10i , [ identity , TR8 ] , [ identity , ( lambda x : TR2i ( TR2 ( x ) ) ) ] , [ ( lambda x : _eapply ( expand_mul , TR5 ( x ) , trigs ) ) , ( lambda x : _eapply ( expand_mul , TR15 ( x ) , trigs ) ) ] , [ ( lambda x : _eapply ( expand_mul , TR6 ( x ) , trigs ) ) , ( lambda x : _eapply ( expand_mul , TR16 ( x ) , trigs ) ) ] , TR111 , [ identity , TR2i ] , [ identity , ( lambda x : _eapply ( expand_mul , TR22 ( x ) , trigs ) ) ] , TR1 , TR2 , TR2i , [ identity , ( lambda x : _eapply ( factor_terms , TR12 ( x ) , trigs ) ) ] ) ] #NEWLINE# e = greedy ( tree , objective = Lops ) ( e ) #NEWLINE# return ( coeff * e )