#NEWLINE# def test_legendre( ) : #NEWLINE# #INDENT# ( x , w ) = gauss_legendre ( 1 , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '0' ] ) #NEWLINE# assert ( [ str ( r ) for r in r ] == [ '2.0000000000000000' ] ) #NEWLINE# ( x , w ) = gauss_legendre ( 2 , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.57735026918962576' , '0.57735026918962576' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '1.0000000000000000' , '1.0000000000000000' ] ) #NEWLINE# ( x , w ) = gauss_legendre ( 3 , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.77459666924148338' , '0' , '0.77459666924148338' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.55555555555555556' , '0.88888888888888889' , '0.55555555555555556' ] ) #NEWLINE# ( x , w ) = gauss_legendre ( 4 , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.86113631159405258' , '-0.33998104358485626' , '0.33998104358485626' , '0.86113631159405258' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.34785484513745386' , '0.65214515486254614' , '0.65214515486254614' , '0.34785484513745386' ] )