#NEWLINE# def _eval_rewrite_as_exp( self , arg ) : #NEWLINE# #INDENT# I = S . ImaginaryUnit #NEWLINE# if ( isinstance ( arg , TrigonometricFunction ) or isinstance ( arg , HyperbolicFunction ) ) : #NEWLINE# #INDENT# arg = arg . func ( arg . args [ 0 ] ) . rewrite ( exp ) #NEWLINE# #UNINDENT# ( neg_exp , pos_exp ) = ( exp ( ( ( - arg ) * I ) ) , exp ( ( arg * I ) ) ) #NEWLINE# return ( ( I * ( neg_exp - pos_exp ) ) / ( neg_exp + pos_exp ) )