#NEWLINE# def complex_ei_asymptotic( zre , zim , prec ) : #NEWLINE# #INDENT# _abs = abs #NEWLINE# one = ( MPZ_ONE << prec ) #NEWLINE# M = ( ( ( zim * zim ) + ( zre * zre ) ) >> prec ) #NEWLINE# xre = tre = ( ( zre << prec ) // M ) #NEWLINE# xim = tim = ( ( ( - zim ) << prec ) // M ) #NEWLINE# sre = ( one + xre ) #NEWLINE# sim = xim #NEWLINE# k = 2 #NEWLINE# while ( ( _abs ( tre ) + _abs ( tim ) ) > 1000 ) : #NEWLINE# #INDENT# ( tre , tim ) = ( ( ( ( ( tre * xre ) - ( tim * xim ) ) * k ) >> prec ) , ( ( ( ( M * xim ) + ( tim * xre ) ) * k ) >> prec ) ) #NEWLINE# sre += tre #NEWLINE# sim += tim #NEWLINE# k += 1 #NEWLINE# if ( k > prec ) : #NEWLINE# #INDENT# raise NoConvergence #NEWLINE# #UNINDENT# #UNINDENT# return ( sre , sim )