#NEWLINE# def test_djtheta( ) : #NEWLINE# #INDENT# mp . dps = 30 #NEWLINE# z = ( ( one / 7 ) + ( j / 3 ) ) #NEWLINE# q = ( ( one / 8 ) + ( j / 5 ) ) #NEWLINE# res = ( mpf ( '1.5555195883277196036090928995803201' ) - ( mpf ( '0.02439761276895463494054149673076275' ) * j ) ) #NEWLINE# result = jtheta ( 1 , z , q , 1 ) #NEWLINE# assert mpc_ae ( result , res ) #NEWLINE# res = ( mpf ( '0.19825296689470982332701283509685662' ) - ( mpf ( '0.46038135182282106983251742935250009' ) * j ) ) #NEWLINE# result = jtheta ( 2 , z , q , 1 ) #NEWLINE# assert mpc_ae ( result , res ) #NEWLINE# res = ( mpf ( '0.36492498415476212680896699407390026' ) - ( mpf ( '0.57743812698666990209897034525640369' ) * j ) ) #NEWLINE# result = jtheta ( 3 , z , q , 1 ) #NEWLINE# assert mpc_ae ( result , res ) #NEWLINE# res = ( mpf ( '-0.38936892528126996010818803742007352' ) + ( mpf ( '0.66549886179739128256269617407313625' ) * j ) ) #NEWLINE# result = jtheta ( 4 , z , q , 1 ) #NEWLINE# assert mpc_ae ( result , res ) #NEWLINE# for i in range ( 10 ) : #NEWLINE# #INDENT# q = ( ( ( one * random . random ( ) ) + ( j * random . random ( ) ) ) / 2 ) #NEWLINE# a = jtheta ( 1 , 0 , q , 1 ) #NEWLINE# b = ( ( jtheta ( 2 , 0 , q ) * jtheta ( 3 , 0 , q ) ) * jtheta ( 4 , 0 , q ) ) #NEWLINE# assert a . ae ( b ) #NEWLINE# #UNINDENT# mp . dps = 20 #NEWLINE# for ( q , z ) in [ ( ( one / 3 ) , ( one / 5 ) ) , ( ( ( one / 3 ) + ( j / 8 ) ) , ( one / 5 ) ) , ( ( one / 3 ) , ( ( one / 5 ) + ( j / 8 ) ) ) , ( ( ( one / 3 ) + ( j / 7 ) ) , ( ( one / 5 ) + ( j / 8 ) ) ) ] : #NEWLINE# #INDENT# for n in [ 1 , 2 , 3 , 4 ] : #NEWLINE# #INDENT# r = jtheta ( n , z , q , 2 ) #NEWLINE# r1 = diff ( ( lambda zz : jtheta ( n , zz , q ) ) , z , n = 2 ) #NEWLINE# assert r . ae ( r1 ) #NEWLINE# r = jtheta ( n , z , q , 3 ) #NEWLINE# r1 = diff ( ( lambda zz : jtheta ( n , zz , q ) ) , z , n = 3 ) #NEWLINE# assert r . ae ( r1 ) #NEWLINE# #UNINDENT# #UNINDENT# q = ( one / 3 ) #NEWLINE# z = zero #NEWLINE# a = ( [ 0 ] * 5 ) #NEWLINE# a [ 1 ] = ( jtheta ( 1 , z , q , 3 ) / jtheta ( 1 , z , q , 1 ) ) #NEWLINE# for n in [ 2 , 3 , 4 ] : #NEWLINE# #INDENT# a [ n ] = ( jtheta ( n , z , q , 2 ) / jtheta ( n , z , q ) ) #NEWLINE# #UNINDENT# equality = ( ( ( a [ 2 ] + a [ 3 ] ) + a [ 4 ] ) - a [ 1 ] ) #NEWLINE# assert equality . ae ( 0 ) #NEWLINE# mp . dps = 15