#NEWLINE# def test_jacobi( ) : #NEWLINE# #INDENT# ( x , w ) = gauss_jacobi ( 1 , ( - S . Half ) , S . Half , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '0.50000000000000000' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '3.1415926535897932' ] ) #NEWLINE# ( x , w ) = gauss_jacobi ( 2 , ( - S . Half ) , S . Half , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.30901699437494742' , '0.80901699437494742' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.86831485369082398' , '2.2732777998989693' ] ) #NEWLINE# ( x , w ) = gauss_jacobi ( 3 , ( - S . Half ) , S . Half , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.62348980185873353' , '0.22252093395631440' , '0.90096886790241913' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.33795476356635433' , '1.0973322242791115' , '1.7063056657443274' ] ) #NEWLINE# ( x , w ) = gauss_jacobi ( 4 , ( - S . Half ) , S . Half , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.76604444311897804' , '-0.17364817766693035' , '0.50000000000000000' , '0.93969262078590838' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.16333179083642836' , '0.57690240318269103' , '1.0471975511965977' , '1.3541609083740761' ] ) #NEWLINE# ( x , w ) = gauss_jacobi ( 5 , ( - S . Half ) , S . Half , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.84125353283118117' , '-0.41541501300188643' , '0.14231483827328514' , '0.65486073394528506' , '0.95949297361449739' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.090675770007435371' , '0.33391416373675607' , '0.65248870981926643' , '0.94525424081394926' , '1.1192597692123861' ] ) #NEWLINE# ( x , w ) = gauss_jacobi ( 1 , 2 , 3 , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '0.14285714285714286' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '1.0666666666666667' ] ) #NEWLINE# ( x , w ) = gauss_jacobi ( 2 , 2 , 3 , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.24025307335204215' , '0.46247529557426437' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.48514624517838660' , '0.58152042148828007' ] ) #NEWLINE# ( x , w ) = gauss_jacobi ( 3 , 2 , 3 , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.46115870378089762' , '0.10438533038323902' , '0.62950064612493132' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.17937613502213266' , '0.61595640991147154' , '0.27133412173306246' ] ) #NEWLINE# ( x , w ) = gauss_jacobi ( 4 , 2 , 3 , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.59903470850824782' , '-0.14761105199952565' , '0.32554377081188859' , '0.72879429738819258' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.067809641836772187' , '0.38956404952032481' , '0.47995970868024150' , '0.12933326662932816' ] ) #NEWLINE# ( x , w ) = gauss_jacobi ( 5 , 2 , 3 , 17 ) #NEWLINE# assert ( [ str ( r ) for r in x ] == [ '-0.69045775012676106' , '-0.32651993134900065' , '0.082337849552034905' , '0.47517887061283164' , '0.79279429464422850' ] ) #NEWLINE# assert ( [ str ( r ) for r in w ] == [ '0.027410178066337099' , '0.21291786060364828' , '0.43908437944395081' , '0.32220656547221822' , '0.065047683080512268' ] )