From eabf0a7594f91250276cd53343446862221975d7 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Tue, 26 Sep 2017 10:21:42 +0200 Subject: [PATCH 01/28] Initial tests units --- tests/unittests/alltest.py | 37 ++++ tests/unittests/bern.py | 57 +++++ tests/unittests/bestappr.py | 76 +++++++ tests/unittests/characteristic.py | 56 +++++ tests/unittests/chinese.py | 55 +++++ tests/unittests/disc.py | 67 ++++++ tests/unittests/ellanal.py | 147 +++++++++++++ tests/unittests/ellmodulareqn.py | 56 +++++ tests/unittests/factorint.py | 52 +++++ tests/unittests/galpol.py | 120 +++++++++++ tests/unittests/gamma.py | 339 ++++++++++++++++++++++++++++++ tests/unittests/idealappr.py | 46 ++++ tests/unittests/idealramgroups.py | 109 ++++++++++ tests/unittests/isprime.py | 81 +++++++ tests/unittests/lambert.py | 109 ++++++++++ tests/unittests/lex.py | 139 ++++++++++++ tests/unittests/lindep.py | 100 +++++++++ tests/unittests/polylog.py | 95 +++++++++ tests/unittests/set.py | 98 +++++++++ tests/unittests/subcyclo.py | 26 +++ 20 files changed, 1865 insertions(+) create mode 100644 tests/unittests/alltest.py create mode 100644 tests/unittests/bern.py create mode 100644 tests/unittests/bestappr.py create mode 100644 tests/unittests/characteristic.py create mode 100644 tests/unittests/chinese.py create mode 100644 tests/unittests/disc.py create mode 100644 tests/unittests/ellanal.py create mode 100644 tests/unittests/ellmodulareqn.py create mode 100644 tests/unittests/factorint.py create mode 100644 tests/unittests/galpol.py create mode 100644 tests/unittests/gamma.py create mode 100644 tests/unittests/idealappr.py create mode 100644 tests/unittests/idealramgroups.py create mode 100644 tests/unittests/isprime.py create mode 100644 tests/unittests/lambert.py create mode 100644 tests/unittests/lex.py create mode 100644 tests/unittests/lindep.py create mode 100644 tests/unittests/polylog.py create mode 100644 tests/unittests/set.py create mode 100644 tests/unittests/subcyclo.py diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py new file mode 100644 index 0000000..7916a54 --- /dev/null +++ b/tests/unittests/alltest.py @@ -0,0 +1,37 @@ +import unittest + +testmodules = [ + 'bern', + 'bestappr', + 'set', + 'polylog', + 'subcyclo', + 'characteristic', + 'chinese', + 'disc', + 'ellanal', + 'ellmodulareqn', + 'factorint', + 'gamma', + 'galpol', + 'idealappr', + 'idealramgroups', + 'isprime', + 'lambert', + 'lex', + 'lindep' + ] + +suite = unittest.TestSuite() + +for t in testmodules: + try: + # If the module defines a suite() function, call it to get the suite. + mod = __import__(t, globals(), locals(), ['suite']) + suitefn = getattr(mod, 'suite') + suite.addTest(suitefn()) + except (ImportError, AttributeError): + # else, just load all the test cases from the module. + suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t)) + +unittest.TextTestRunner().run(suite) diff --git a/tests/unittests/bern.py b/tests/unittests/bern.py new file mode 100644 index 0000000..1e321ed --- /dev/null +++ b/tests/unittests/bern.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/19/2017 + +"""Original pari/GP test file bern : +bernfrac(0); +bernfrac(1); +for(k = 1, 20, print(bernfrac(k))); +for(k = 0, 5, print(bernpol(k))); +bernfrac(-1) +bernreal(-1) +bernpol(-1) +bernvec(30) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestBern(unittest.TestCase): + def test_bern(self): + pari.bernfrac(0); + pari.bernfrac(1); + + t = ('-1/2', '1/6', '0', '-1/30', '0', '1/42', '0', '-1/30', '0', '5/66', '0', '-691/2730', + '0', '7/6', '0', '-3617/510', '0', '43867/798', '0', '-174611/330') + for k in range(1, 21): + self.assertEquals(pari.bernfrac(k), t[k-1]) + + t = ('1', 'x - 1/2', 'x^2 - x + 1/6', 'x^3 - 3/2*x^2 + 1/2*x', 'x^4 - 2*x^3 + x^2 - 1/30', + 'x^5 - 5/2*x^4 + 5/3*x^3 - 1/6*x') + for k in range(0, 6): + self.assertEquals(pari.bernpol(k), t[k]) + + with self.assertRaises(PariError) as context: + pari.bernfrac(-1) + self.assertTrue('domain error in bernfrac: index < 0' in context.exception) + + with self.assertRaises(PariError) as context: + pari.bernreal(-1) + self.assertTrue('domain error in bernreal: index < 0' in context.exception) + + with self.assertRaises(PariError) as context: + pari.bernpol(-1) + + self.assertTrue('domain error in bernpol: index < 0' in context.exception) + + def test_bernvec(self): + self.assertEquals(pari.bernvec(30), '[1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510, 43867/798,' + + ' -174611/330, 854513/138, -236364091/2730, 8553103/6, -23749461029/870, 8615841276005/1432' + + '2, -7709321041217/510, 2577687858367/6, -26315271553053477373/1919190, 2929993913841559/6,' + + ' -261082718496449122051/13530, 1520097643918070802691/1806, -27833269579301024235023/690, ' + + '596451111593912163277961/282, -5609403368997817686249127547/46410, 49505720524107964821247' + + '7525/66, -801165718135489957347924991853/1590, 29149963634884862421418123812691/798, -2479' + + '392929313226753685415739663229/870, 84483613348880041862046775994036021/354, -121523314048' + + '3755572040304994079820246041491/56786730]') diff --git a/tests/unittests/bestappr.py b/tests/unittests/bestappr.py new file mode 100644 index 0000000..c8f0478 --- /dev/null +++ b/tests/unittests/bestappr.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/19/2017 + +"""Original pari/GP test file bestappr : +bestappr(-1./7, 7) +bestappr(-1./7, 6) +bestappr(Mod(-1/7,100)) +bestappr(Mod(-1/7,100), 6) +bestappr(Mod(-1/7,100), 7) +bestappr(-1/7 + O(5^10)) +bestappr(-1/7 + O(5^10), 6) +type( bestappr(1+0.*I) ) + +bestapprPade((x^3+1)/(x^10+2)) +bestapprPade((x^3+1)/(x^10+2), 4) +bestapprPade(1/(1+x+O(x^10))) +bestapprPade(1/(1+x+O(x^10)), 5) +bestapprPade(1/(1+x^6+O(x^13)), 5) +bestapprPade(1/(1+x^6+O(x^13))) +bestapprPade(Mod(x^3+x^2+x+1, x^5-2)) +bestapprPade(x^2+x^3+x^4+O(x^5)) +bestapprPade(x^-4+x^-3+x^-2+O(x^-1)) +bestapprPade(x^10/(1-x)^11+O(x^22)) +""" +import unittest +import cypari2 + +pari = cypari2.Pari() + + +class TestBestappr(unittest.TestCase): + def test_bestappr(self): + self.assertEquals(pari.bestappr(-1./7, 7), '-1/7') + self.assertEquals(pari.bestappr(-1./7, 6), '-1/6') + self.assertEquals(pari.bestappr(pari.Mod('-1/7', 100)), '-1/7') + self.assertEquals(pari.bestappr(pari.Mod('-1/7', 100), 6), '[]') + self.assertEquals(pari.bestappr(pari.Mod('-1/7', 100), 7), '-1/7') + self.assertEquals(pari.bestappr('-1/7 + O(5^10)'), '-1/7') + self.assertEquals(pari.bestappr('-1/7 + O(5^10)', 6), '[]') + self.assertEquals(pari.type( pari.bestappr('1+0.*I')), '"t_INT"') + self.assertEquals(pari.bestapprPade('(x^3+1)/(x^10+2)'), '(x^3 + 1)/(x^10 + 2)') + self.assertEquals(pari.bestapprPade('(x^3+1)/(x^10+2)', 4), '1/2*x^3 + 1/2') + self.assertEquals(pari.bestapprPade('1/(1+x+O(x^10))'), '1/(x + 1)') + self.assertEquals(pari.bestapprPade('1/(1+x+O(x^10))', 5), '1/(x + 1)') + self.assertEquals(pari.bestapprPade('1/(1+x^6+O(x^13))', 5), '[]') + self.assertEquals(pari.bestapprPade('1/(1+x^6+O(x^13))'), '1/(x^6 + 1)') + self.assertEquals(pari.bestapprPade(pari.Mod('x^3+x^2+x+1', 'x^5-2')), '(x - 2)/(-x^2 + x)') + self.assertEquals(pari.bestapprPade('x^2+x^3+x^4+O(x^5)'), 'x^2/(-x + 1)') + self.assertEquals(pari.bestapprPade('x^-4+x^-3+x^-2+O(x^-1)'), '1/(-x^5 + x^4)') + self.assertEquals(pari.bestapprPade('x^10/(1-x)^11+O(x^22)'), """x^10/(-x^11 + 11*x^10 - 55*x^9 + 165*x^8 - + 330*x^7 + 462*x^6 - 462*x^5 + 330*x^4 - 165*x^3 + 55*x^2 - 11*x + 1)""") + +""" **** Expected results **** + +-1/7 +-1/6 +-1/7 +[] +-1/7 +-1/7 +[] +"t_INT" +(x^3 + 1)/(x^10 + 2) +1/2*x^3 + 1/2 +1/(x + 1) +1/(x + 1) +[] +1/(x^6 + 1) +(x - 2)/(-x^2 + x) +x^2/(-x + 1) +1/(-x^5 + x^4) +x^10/(-x^11 + 11*x^10 - 55*x^9 + 165*x^8 - 330*x^7 + 462*x^6 - 462*x^5 + 330 +*x^4 - 165*x^3 + 55*x^2 - 11*x + 1) + +""" diff --git a/tests/unittests/characteristic.py b/tests/unittests/characteristic.py new file mode 100644 index 0000000..e07fc6f --- /dev/null +++ b/tests/unittests/characteristic.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file characteristic : +v=[1,1.,Mod(1,6),1/2,I+Mod(1,3), O(2), quadgen(5)*Mod(1,3), Mod(1,x)]; +for (i=1,#v, print(characteristic(v[i]))) +characteristic(v) +characteristic(matid(2)*Mod(1,2)) +characteristic([]) +characteristic(List()) +characteristic(ffgen(2^3)) +characteristic([ffgen(2),ffgen(3)]) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestCharacteristic(unittest.TestCase): + def test_characteristic(self): + v = [1, '1.', pari.Mod(1, 6), '1/2', 'I' + pari.Mod(1, 3), 'O(2)', pari.quadgen(5) * pari.Mod(1, 3), + pari.Mod(1, 'x')] + d = ['0', '0', '6', '0', '3', '0', '3', '0'] + for i in range(0,len(v)): + self.assertEquals(str(pari.characteristic(v[i])), d[i]) + self.assertEquals(str(pari.characteristic(v)), '3') + self.assertEquals(str(pari.characteristic(pari.matid(2)*pari.Mod(1,2))), '2') + self.assertEquals(str(pari.characteristic([])), '0') + self.assertEquals(str(pari.characteristic(pari.List())), '0') + self.assertEquals(str(pari.characteristic(pari.ffgen('2^3'))), '2') + with self.assertRaises(PariError) as context: + pari.characteristic([pari.ffgen(2), pari.ffgen(3)]) + self.assertTrue('inconsistent moduli in characteristic: 2 != 3' in str(context.exception)) + +"""**** Original expected results **** + +0 +0 +6 +0 +3 +0 +3 +0 +3 +2 +0 +0 +2 + *** at top-level: characteristic([ffge + *** ^-------------------- + *** characteristic: inconsistent moduli in characteristic: 2 != 3 + +""" diff --git a/tests/unittests/chinese.py b/tests/unittests/chinese.py new file mode 100644 index 0000000..bfad209 --- /dev/null +++ b/tests/unittests/chinese.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file chinese : +chinese(Mod(x,x^2+1),Mod(x,x^2+1)) +chinese(Mod(x,x^2+1),Mod(x,x^2-1)) +chinese(Mod(1,2)*x+Mod(1,2), Mod(2,3)*x^2+Mod(1,3)*x+Mod(1,3)) +chinese([Mod(1,2),Mod(1,3)], [Mod(1,4),Mod(1,2)]) +chinese(1) +chinese([]) +chinese(Mod(1+x,x^2),Mod(0,1)) +chinese(Mod(1+x,x^2),Mod(1,2)) +chinese(Mod(0,1),Mod(1+x,x^2)) + +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestChinese(unittest.TestCase): + def test_chinese(self): + self.assertEquals(pari.chinese(pari.Mod('x', 'x^2+1'), pari.Mod('x', 'x^2+1')), 'Mod(x, x^2 + 1)') + self.assertEquals(pari.chinese(pari.Mod('x', 'x^2+1'), pari.Mod('x', 'x^2-1')), 'Mod(x, x^4 - 1)') + self.assertEquals(str(pari.chinese(pari.Mod(1, 2) * 'x' + pari.Mod(1, 2), + pari.Mod(2, 3) * 'x^2' + pari.Mod(1, 3) * 'x' + pari.Mod(1, 3))), + 'Mod(2, 3)*x^2 + Mod(1, 6)*x + Mod(1, 6)') + self.assertEquals(pari.chinese([pari.Mod(1, 2), pari.Mod(1, 3)], [pari.Mod(1, 4), pari.Mod(1, 2)]), + '[Mod(1, 4), Mod(1, 6)]') + with self.assertRaises(PariError) as context: + pari.chinese(1) + self.assertTrue('incorrect type in association (t_INT)' in str(context.exception)) + self.assertEquals(pari.chinese([]), 'Mod(0, 1)') + self.assertEquals(pari.chinese(pari.Mod('1+x', 'x^2'), pari.Mod(0, 1)), 'Mod(x + 1, x^2)') + self.assertEquals(pari.chinese(pari.Mod('1+x', 'x^2'), pari.Mod(1, 2)), 'Mod(x + 1, 2*x^2)') + self.assertEquals(pari.chinese(pari.Mod(0, 1), pari.Mod('1+x', 'x^2')), 'Mod(x + 1, x^2)') + + +"""**** Original expected results **** + +Mod(x, x^2 + 1) +Mod(x, x^4 - 1) +Mod(2, 3)*x^2 + Mod(1, 6)*x + Mod(1, 6) +[Mod(1, 4), Mod(1, 6)] + *** at top-level: chinese(1) + *** ^---------- + *** chinese: incorrect type in association (t_INT). +Mod(0, 1) +Mod(x + 1, x^2) +Mod(x + 1, 2*x^2) +Mod(x + 1, x^2) + +""" diff --git a/tests/unittests/disc.py b/tests/unittests/disc.py new file mode 100644 index 0000000..85a46b9 --- /dev/null +++ b/tests/unittests/disc.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file disc : +poldisc(Mod(1, 2)*x) +poldisc(Mod(1, 3)*(2*x^3+x^2+5)) +poldisc(Mod(1, 3)*(2*x^3+x+5)) +poldisc((a*x^3+b*x^2+c*x+d)) +poldisc((a*x^3+b*x^2+c*x+d)*Mod(1,3)) +poldisc((a*x^3+c*x+d)*Mod(1,3)) + +\\ #1830 +p=Pol([1,12,-41,-1046,-1152,39768,128414,-829340,-4525890,8899442,94079590,4385944,-1307089619,-1852433280,12494993027,34801502551,-77942248052,-390957423498,215189990152,3107265788332,1420485007463,-18347443916369,-23277245912959,80992666070621,174175172136656,-256947893746801,-907981487991468,484717098540915,3624070471203629,223320207786810,-11495832122433637,-5970240860086125,29459554866159718,27626780885543732,-61174934576020682,-85453537075841594,101601090502467492,205071787088061635,-128623032844198712,-402298722797595630,103257810302253206,661593554032027685,13023738437946757,-924770373478411117,-228669477020600489,1106930103187315214,501417832370076217,-1137744012688843614,-748484700066174875,1002096690610670198,887074929263872304,-749681502970099140,-878282874862417133,466192451440777121,743397334132464078,-228293327650766293,-544343133811559511,73246386276267014,346915388490966115,2655042441806609,-192876875700267550,-25542640982995001,93481097097188652,23309890824202258,-39341812220193672,-14459562353785875,14260775252163516,7110363380474628,-4385795657650451,-2904911553101253,1111356927314961,1003888928894249,-216866559082696,-295159994592569,25722943511905,73725762974324,1493634668853,-15527611742629,-1817577645774,2717078090720,579368368367,-384681131682,-124276266074,41834786710,20049074850,-3059594663,-2480136051,67764972,231104576,16656470,-15345258,-2573079,629755,190125,-7992,-7579,-537,116,21,1]); +poldisc(p) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestDisc(unittest.TestCase): + def test_disc(self): + self.assertEquals(pari.poldisc(pari.Mod(1, 2)*'x'), 'Mod(1, 2)') + self.assertEquals(pari.poldisc(pari.Mod(1, 3)*'(2*x^3+x^2+5)'), 'Mod(1, 3)') + self.assertEquals(pari.poldisc(pari.Mod(1, 3)*'(2*x^3+x+5)'), 'Mod(1, 3)') + self.assertEquals(pari.poldisc('(a*x^3+b*x^2+c*x+d)'), + '-27*d^2*a^2 + (18*d*c*b - 4*c^3)*a + (-4*d*b^3 + c^2*b^2)') + self.assertEquals(pari.poldisc('(a*x^3+b*x^2+c*x+d)' * pari.Mod(1, 3)), + 'Mod(2, 3)*c^3*a + (Mod(2, 3)*d*b^3 + Mod(1, 3)*c^2*b^2)') + self.assertEquals(pari.poldisc('(a*x^3+c*x+d)'*pari.Mod(1,3)), 'Mod(2, 3)*c^3*a') + + p = pari.Pol( + [1, 12, -41, -1046, -1152, 39768, 128414, -829340, -4525890, 8899442, 94079590, 4385944, -1307089619, + -1852433280, 12494993027, 34801502551, -77942248052, -390957423498, 215189990152, 3107265788332, + 1420485007463, -18347443916369, -23277245912959, 80992666070621, 174175172136656, -256947893746801, + -907981487991468, 484717098540915, 3624070471203629, 223320207786810, -11495832122433637, + -5970240860086125, 29459554866159718, 27626780885543732, -61174934576020682, -85453537075841594, + 101601090502467492, 205071787088061635, -128623032844198712, -402298722797595630, 103257810302253206, + 661593554032027685, 13023738437946757, -924770373478411117, -228669477020600489, 1106930103187315214, + 501417832370076217, -1137744012688843614, -748484700066174875, 1002096690610670198, 887074929263872304, + -749681502970099140, -878282874862417133, 466192451440777121, 743397334132464078, -228293327650766293, + -544343133811559511, 73246386276267014, 346915388490966115, 2655042441806609, -192876875700267550, + -25542640982995001, 93481097097188652, 23309890824202258, -39341812220193672, -14459562353785875, + 14260775252163516, 7110363380474628, -4385795657650451, -2904911553101253, 1111356927314961, + 1003888928894249, -216866559082696, -295159994592569, 25722943511905, 73725762974324, 1493634668853, + -15527611742629, -1817577645774, 2717078090720, 579368368367, -384681131682, -124276266074, 41834786710, + 20049074850, -3059594663, -2480136051, 67764972, 231104576, 16656470, -15345258, -2573079, 629755, 190125, + -7992, -7579, -537, 116, 21, 1]); + self.assertEquals(pari.poldisc(p), '-1466510154829726293392657799494718982280019324678223081569643138650941' + + '8786507377255173112139726969385025460405653232785506791516185715571718938055758748427882' + + '056024408462365432062266407566752265468717307291') + +"""**** Original expected results **** + +Mod(1, 2) +Mod(1, 3) +Mod(1, 3) +-27*d^2*a^2 + (18*d*c*b - 4*c^3)*a + (-4*d*b^3 + c^2*b^2) +Mod(2, 3)*c^3*a + (Mod(2, 3)*d*b^3 + Mod(1, 3)*c^2*b^2) +Mod(2, 3)*c^3*a +-146651015482972629339265779949471898228001932467822308156964313865094187865 +0737725517311213972696938502546040565323278550679151618571557171893805575874 +8427882056024408462365432062266407566752265468717307291 + +""" diff --git a/tests/unittests/ellanal.py b/tests/unittests/ellanal.py new file mode 100644 index 0000000..90a761c --- /dev/null +++ b/tests/unittests/ellanal.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file ellanal : +default(realprecision,38); +rk(x)=x=ellinit(x);ellanalyticrank(x); +rk([0, -1, 1, -10, -20]) +rk([0, 0, 1, -1, 0]) +rk([0, 1, 1, -2, 0]) +rk([0, 0, 1, -7, 6]) +rk([-5187, 176830]) + +he(x)=x=ellinit(x);ellheegner(x); +he([1, 1, 0, -1297, -18530]) +he([0, -1, 1, -33, 93]) +he([-157^2,0]) +he([0,0,-9/484,0,-27/234256]) +getheap()[1] + +E=ellinit([0,-1437004800,0,458885065605120000,0]); +ellglobalred(E); ellheegner(E) + +L = ellinit([0,0,1,7,6]); +ellL1(L) +ellL1(L,1) +ellL1(L,3) +ellL1(ellinit([0,1,1,-2,0]),2) +default(realprecision,115); +ellL1(L) +ellL1(L,1) +ellL1(L,3) +ellL1(ellinit([0,1,1,-2,0]),2) + +default(realprecision,19); +ellmoddegree(ellinit([0,1,0,-4,-4])) +ellmoddegree(ellinit([-4,0])) +ellmoddegree(ellinit([0,-1,0,4,-4])) +ellmoddegree(ellinit([0,-1,0,-8,-16])) +ellmoddegree(ellinit([0,0,1,0,-7])) +ellmoddegree(ellinit([1,-1,0,0,-5])) +ellmoddegree(ellinit([1,-1,0,-69,-208])) +localbitprec(9); ellmoddegree(ellinit([0, -1, 1, 0, 0])) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestEllanal(unittest.TestCase): + + def test_ellanal(self): + pari.set_real_precision(38) + + def rk(x): + x = pari.ellinit(x, precision=127) + return pari.ellanalyticrank(x, precision=127) + + self.assertEquals(str(rk([0, -1, 1, -10, -20])), '[0, 0.25384186085591068433775892335090946105]') + self.assertEquals(str(rk([0, 0, 1, -1, 0])), '[1, 0.30599977383405230182048368332167647445]') + self.assertEquals(str(rk([0, 1, 1, -2, 0])), '[2, 1.5186330005768535404603852157894440381]') + self.assertEquals(str(rk([0, 0, 1, -7, 6])), '[3, 10.391099400715804138751850510360917070]') + self.assertEquals(str(rk([-5187, 176830])), '[5, 9997.0334671722554999496820788093288461]') + + def test_ellheegner(self): + pari.set_real_precision(38) + + def he(x): + x = pari.ellinit(x) + return pari.ellheegner(x) + + self.assertEquals(str(he([1, 1, 0, -1297, -18530])), '[-339/16, 691/64]') + self.assertEquals(str(he([0, -1, 1, -33, 93])), '[-3, 12]') + self.assertEquals(str(he([-157^2,0])), '[69648970982596494254458225/166136231668185267540804, 538962435089604615078004307258785218335/67716816556077455999228495435742408]') + self.assertEquals(str(he([0,0,-9/484,0,-27/234256])), '[553/17424, 25469/2299968]') + self.assertEquals(str(pari.getheap()[0]), '30') + + E = pari.ellinit([0, -1437004800, 0, 458885065605120000, 0]); + pari.ellglobalred(E); + self.assertEquals(str(pari.ellheegner(E)), '[1317254400, 19916886528000]') + + def test_ellL1(self): + pari.set_real_precision(38) + L = pari.ellinit([0, 0, 1, 7, 6], precision=127); + self.assertEquals(str(pari.ellL1(L, precision=127)), '0') + self.assertEquals(str(pari.ellL1(L, 1, precision=127)), '2.8053554406276820682921020105298729343') + self.assertEquals(str(pari.ellL1(L, 3, precision=127)), '98.900778292211279593460469548777701093') + self.assertEquals(str(pari.ellL1(pari.ellinit([0, 1, 1, -2, 0], precision=127), 2, precision=127)), + '1.5186330005768535404603852157894440381') + pari.set_real_precision(115) + self.assertEquals(pari.ellL1(L, precision=383), '0') + self.assertEquals(str(pari.ellL1(L, 1, precision=383)), '2.8053554406276820682921020105298729342739341928943' + + '14010515738738778963706069444052334712747100820315923332165307854') + self.assertEquals(str(pari.ellL1(L, 3, precision=383)), '98.900778292211279593460469548777701093725662786697' + + '61921051303471931786459834656024843050255154457301289878660746149') + self.assertEquals(str(pari.ellL1(pari.ellinit([0, 1, 1, -2, 0]), 2, precision=383)), '1.51863300057685354046' + + '03852157894440381561950329898487031716101850959821454955611048804318700046577183337542984' + + '13640') + + def test_ellmoddegree(self): + # pari.set_real_precision(19) + self.assertEquals(pari.ellmoddegree(pari.ellinit([0, 1, 0, -4, -4]), precision=64), '[2, -53]') + self.assertEquals(pari.ellmoddegree(pari.ellinit([-4, 0]), precision=64), '[2, -53]') + self.assertEquals(pari.ellmoddegree(pari.ellinit([0, -1, 0, 4, -4]), precision=64), '[4, -55]') + self.assertEquals(pari.ellmoddegree(pari.ellinit([0, -1, 0, -8, -16]), precision=64), '[8, -54]') + self.assertEquals(pari.ellmoddegree(pari.ellinit([0, 0, 1, 0, -7]), precision=64), '[1, -55]') + self.assertEquals(pari.ellmoddegree(pari.ellinit([1, -1, 0, 0, -5]), precision=64), '[2, -56]') + self.assertEquals(pari.ellmoddegree(pari.ellinit([1, -1, 0, -69, -208]), precision=64), '[72, -62]') + # pari.localbitprec(9); + self.assertEquals(pari.ellmoddegree(pari.ellinit([0, -1, 1, 0, 0]), precision=9), '[1/5, -11]') + +"""**** Original expected results **** + +[0, 0.25384186085591068433775892335090946105] +[1, 0.30599977383405230182048368332167647445] +[2, 1.5186330005768535404603852157894440381] +[3, 10.391099400715804138751850510360917070] +[5, 9997.0334671722554999496820788093288461] +[-339/16, 691/64] +[-3, 12] +[69648970982596494254458225/166136231668185267540804, 5389624350896046150780 +04307258785218335/67716816556077455999228495435742408] +[553/17424, 25469/2299968] +30 +[1317254400, 19916886528000] +0 +2.8053554406276820682921020105298729343 +98.900778292211279593460469548777701093 +1.5186330005768535404603852157894440381 +0 +2.80535544062768206829210201052987293427393419289431401051573873877896370606 +9444052334712747100820315923332165307854 +98.9007782922112795934604695487777010937256627866976192105130347193178645983 +4656024843050255154457301289878660746149 +1.51863300057685354046038521578944403815619503298984870317161018509598214549 +5561104880431870004657718333754298413640 +[2, -53] +[2, -53] +[4, -55] +[8, -54] +[1, -55] +[2, -56] +[72, -62] +[1/5, -11] + +""" diff --git a/tests/unittests/ellmodulareqn.py b/tests/unittests/ellmodulareqn.py new file mode 100644 index 0000000..bfd9eed --- /dev/null +++ b/tests/unittests/ellmodulareqn.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file ellmodulareqn : +\\package:seadata + +ellmodulareqn(2) +ellmodulareqn(11) +ellmodulareqn(3,y,z) +\\ errors +ellmodulareqn(1) +ellmodulareqn(2,y,x) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestEllmodulareqn(unittest.TestCase): + + def test_ellmodulareqn(self): + self.assertEquals(pari.ellmodulareqn(2), '[x^3 + 48*x^2 + (-y + 768)*x + 4096, 0]') + self.assertEquals(pari.ellmodulareqn(11), '[x^12 + (-y + 744)*x^11 + 196680*x^10 + (187*y + 21354080)*x' + + '^9 + (506*y + 830467440)*x^8 + (-11440*y + 16875327744)*x^7 + (-57442*y + 2085649589' + + '76)*x^6 + (184184*y + 1678582287360)*x^5 + (1675784*y + 9031525113600)*x^4 + (186771' + + '2*y + 32349979904000)*x^3 + (-8252640*y + 74246810880000)*x^2 + (-19849600*y + 98997' + + '734400000)*x + (y^2 - 8720000*y + 58411072000000), 1]') + self.assertEquals(pari.ellmodulareqn(3, 'y', 'z'), '[y^4 + 36*y^3 + 270*y^2 + (-z + 756)*y + 729, 0]') + + def test_ellmodulareqn_errors(self): + with self.assertRaises(PariError) as context: + pari.ellmodulareqn(1) + self.assertTrue('not a prime number in ellmodulareqn (level): 1' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.ellmodulareqn(2, 'y', 'x') + self.assertTrue('incorrect priority in ellmodulareqn: variable y >= x' in str(context.exception)) + +"""**** Original expected results **** + +[x^3 + 48*x^2 + (-y + 768)*x + 4096, 0] +[x^12 + (-y + 744)*x^11 + 196680*x^10 + (187*y + 21354080)*x^9 + (506*y + 83 +0467440)*x^8 + (-11440*y + 16875327744)*x^7 + (-57442*y + 208564958976)*x^6 + + (184184*y + 1678582287360)*x^5 + (1675784*y + 9031525113600)*x^4 + (186771 +2*y + 32349979904000)*x^3 + (-8252640*y + 74246810880000)*x^2 + (-19849600*y + + 98997734400000)*x + (y^2 - 8720000*y + 58411072000000), 1] +[y^4 + 36*y^3 + 270*y^2 + (-z + 756)*y + 729, 0] + *** at top-level: ellmodulareqn(1) + *** ^---------------- + *** ellmodulareqn: not a prime number in ellmodulareqn (level): 1. + *** at top-level: ellmodulareqn(2,y,x) + *** ^-------------------- + *** ellmodulareqn: incorrect priority in ellmodulareqn: variable y >= x + +""" diff --git a/tests/unittests/factorint.py b/tests/unittests/factorint.py new file mode 100644 index 0000000..e1c31c1 --- /dev/null +++ b/tests/unittests/factorint.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file factorint : +factorint(-33623546348886051018593728804851,1) +factorint(691160558642,1) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestFactorint(unittest.TestCase): + def test_factorint(self): + self.assertEquals(str(pari.factorint(-33623546348886051018593728804851, 1)), + '[-1, 1; 3, 5; 73, 1; 181, 1; 223, 1; 293, 2; 4157, 2; 112573, 1; 281191, 1]') + self.assertEquals(str(pari.factorint(691160558642,1)), '[2, 1; 397, 1; 27031, 1; 32203, 1]') + +"""**** Original expected results **** + + +[ -1 1] + +[ 3 5] + +[ 73 1] + +[ 181 1] + +[ 223 1] + +[ 293 2] + +[ 4157 2] + +[112573 1] + +[281191 1] + + +[ 2 1] + +[ 397 1] + +[27031 1] + +[32203 1] + + +""" diff --git a/tests/unittests/galpol.py b/tests/unittests/galpol.py new file mode 100644 index 0000000..b7d885f --- /dev/null +++ b/tests/unittests/galpol.py @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file galpol : +\\ package: galpol + +galoisgetpol(8) +for(i=1,5,print(galoisgetpol(8,i))) +for(i=1,5,print(galoisgetpol(8,i,2))) +galoisgetpol(8,6) +galoisgetpol(3,1,3) +galoisgetpol(3,1,2) +test(n,k)= + if(galoisidentify(galoisinit(galoisgetpol(n,k)[1])) != [n,k], error([n,k])); +test(8,3) +test(18,5) +test(27,3) +test(45,2) +test(30,4) +test(32,4) +test(32,13) +test(32,30) +test(32,32) +test(42,2) +test(48,12) +test(64,3) +test(64,14) +test(64,16) +test(64,48) +test(64,51) +test(64,70) +test(64,68) +test(64,80) +test(64,44) +galoisidentify(galoisinit(polcyclo(390))) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestGalpol(unittest.TestCase): + def test_galpol(self): + # package: galpol + + self.assertEquals(pari.galoisgetpol(8), '5') + l = ['[x^8 - x^7 - 7*x^6 + 6*x^5 + 15*x^4 - 10*x^3 - 10*x^2 + 4*x + 1, 1]', + '[x^8 - 7*x^6 + 14*x^4 - 8*x^2 + 1, 1]', + '[x^8 - 4*x^7 - 8*x^6 + 24*x^5 + 30*x^4 - 16*x^3 - 20*x^2 + 2, 3]', + '[x^8 - 12*x^6 + 36*x^4 - 36*x^2 + 9, 3]', + '[x^8 - 12*x^6 + 23*x^4 - 12*x^2 + 1, 7]'] + for i in range(1,6): + self.assertEquals(pari.galoisgetpol(8,i), l[i-1]) + l = ['[x^8 + 8*x^6 + 20*x^4 + 16*x^2 + 2, 1]', + '[x^8 - x^7 + x^5 - x^4 + x^3 - x + 1, 1]', + '[x^8 + 3*x^4 + 1, 1]', + '[x^8 + 12*x^6 + 36*x^4 + 36*x^2 + 9, 3]', + '[x^8 - x^4 + 1, 1]'] + for i in range(1, 6): + self.assertEquals(pari.galoisgetpol(8, i, 2), l[i - 1]) + with self.assertRaises(PariError) as context: + pari.galoisgetpol(8, 6) + self.assertTrue('domain error in galoisgetpol: group index > 5' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.galoisgetpol(3, 1, 3) + self.assertTrue('invalid flag in galoisgetpol' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.galoisgetpol(3, 1, 2) + self.assertTrue('domain error in galoisgetpol: s > 1' in str(context.exception)) + # test(n,k)= + # if(pari.galoisidentify(pari.galoisinit(pari.galoisgetpol(n,k)[1])) != [n,k], error([n,k])); + # test(8,3) + # test(18,5) + # test(27,3) + # test(45,2) + # test(30,4) + # test(32,4) + # test(32,13) + # test(32,30) + # test(32,32) + # test(42,2) + # test(48,12) + # test(64,3) + # test(64,14) + # test(64,16) + # test(64,48) + # test(64,51) + # test(64,70) + # test(64,68) + # test(64,80) + # test(64,44) + self.assertEquals(pari.galoisidentify(pari.galoisinit(pari.polcyclo(390))), '[96, 161]') + +"""**** Original expected results **** + +5 +[x^8 - x^7 - 7*x^6 + 6*x^5 + 15*x^4 - 10*x^3 - 10*x^2 + 4*x + 1, 1] +[x^8 - 7*x^6 + 14*x^4 - 8*x^2 + 1, 1] +[x^8 - 4*x^7 - 8*x^6 + 24*x^5 + 30*x^4 - 16*x^3 - 20*x^2 + 2, 3] +[x^8 - 12*x^6 + 36*x^4 - 36*x^2 + 9, 3] +[x^8 - 12*x^6 + 23*x^4 - 12*x^2 + 1, 7] +[x^8 + 8*x^6 + 20*x^4 + 16*x^2 + 2, 1] +[x^8 - x^7 + x^5 - x^4 + x^3 - x + 1, 1] +[x^8 + 3*x^4 + 1, 1] +[x^8 + 12*x^6 + 36*x^4 + 36*x^2 + 9, 3] +[x^8 - x^4 + 1, 1] + *** at top-level: galoisgetpol(8,6) + *** ^----------------- + *** galoisgetpol: domain error in galoisgetpol: group index > 5 + *** at top-level: galoisgetpol(3,1,3) + *** ^------------------- + *** galoisgetpol: invalid flag in galoisgetpol. + *** at top-level: galoisgetpol(3,1,2) + *** ^------------------- + *** galoisgetpol: domain error in galoisgetpol: s > 1 +[96, 161] + +""" diff --git a/tests/unittests/gamma.py b/tests/unittests/gamma.py new file mode 100644 index 0000000..83e4b0d --- /dev/null +++ b/tests/unittests/gamma.py @@ -0,0 +1,339 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file gamma : +default(realprecision,38); +default(seriesprecision,6); +gamma(2+I+x) +gamma(1+x) +gamma(2+x) +gamma(-2+x) +lngamma(2+I+x) +lngamma(1+x) +lngamma(-2+x) +lngamma(2+x) +lngamma(1) +lngamma(1.) +psi(2+I+x) +psi(1+x) +psi(-2+x) +gamma(-1/2+x) +gamma(1+a*x+O(x^2)) +lngamma(1+a*x+O(x^2)) +gamma(O(x)) +lngamma(O(x)) +psi(O(x)) + +psi(x) +gamma(x) +gamma(1000) +psi(2^400) +psi(-1.5) +psi(x+O(x^2)) +gamma(x+O(x^2)) +gamma(-1-10^-16) +gamma(10^-16) +lngamma(-1-10^-16) +lngamma(10^-16) + +binomial(2^64+1,2) +binomial(1001.,1000) + +lngamma(2^301) +lngamma(2^301 + 2*I) +lngamma(2^64 + 2*I) +lngamma(-200.5) +gammah(400) +gammah(400+I) +default(realprecision,115); +lngamma(2^301 + 2*I) +lngamma(2^301 + 200*I) +default(realprecision,154); +lngamma(2^301 + 2000*I) + +gamma(1+10^-30) +gamma(-1e-6) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestGamma(unittest.TestCase): + def test_gamma(self): + pari.set_real_precision(38) + pari.set_series_precision(6) + self.assertEquals(str(pari.gamma('2+I+x', precision=127)), + '(0.65296549642016672783864624794608469715 + 0.3430658398165453575' + + '8873598697831148676*I) + (0.19044897540645184469078131473790885364 + 0.580552467319476' + + '92349794265298068695525*I)*x + (0.090862784286733058570355592072096462602 + 0.21088392' + + '899265350361451872767550590408*I)*x^2 + (0.034253752000523576920016074597694397590 + 0' + + '.15168994440796279268955277197772465641*I)*x^3 + (-0.009313921054078589415919785948439' + + '2067432 + 0.033064651796439913976828620551277428299*I)*x^4 + (0.0066762623841895560506' + + '752315759505427095 + 0.015164046675666586697065188398143396917*I)*x^5 + O(x^6)') + self.assertEquals(str(pari.gamma('1+x', precision=127)), '1 - 0.57721566490153286060651209008240243104*x ' + + '+ 0.98905599532797255539539565150063470794*x^2 - 0.90747907608088628901656016735627511' + + '493*x^3 + 0.98172808683440018733638029402185085036*x^4 - 0.981995068903145202104701413' + + '79137467551*x^5 + O(x^6)') + self.assertEquals(str(pari.gamma('2+x', precision=127)), '1 + 0.42278433509846713939348790991759756896*x ' + + '+ 0.41184033042643969478888356141823227689*x^2 + 0.08157691924708626637883548414435959' + + '3009*x^3 + 0.074249010753513898319820126665575735431*x^4 - 0.0002669820687450147683211' + + '1976952382515602*x^5 + O(x^6)') + self.assertEquals(str(pari.gamma('-2+x', precision=127)), '0.50000000000000000000000000000000000000*x^-1 ' + + '+ 0.46139216754923356969674395495879878448 + 0.93661624898783663224281375818851553069*' + + 'x + 0.72048875166669501900756857612523634633*x^2 + 1.103289046423324306058136132104522' + + '1793*x^3 + O(x^4)') + self.assertEquals(str(pari.gamma('-1/2+x', precision=127)), '-3.5449077018110320545963349666822903656 - 0' + + '.12935358979554005531547953707588123112*x - 15.838884621997332891305490359174586834*x^' + + '2 - 0.088235140923071374511750322744686276244*x^3 - 63.9341199241678177373752902777138' + + '85431*x^4 - 0.042848354492868684268292005312709223076*x^5 + O(x^6)') + self.assertEquals(str(pari.gamma('1+a*x+O(x^2)', precision=127)), + '1 - 0.57721566490153286060651209008240243104*a*x + O(x^2)') + + with self.assertRaises(PariError) as context: + pari.gamma('O(x)', precision=127) + self.assertTrue('domain error in gamma: argument = 0' in str(context.exception)) + + self.assertEquals(str(pari.gamma('x', precision=127)), 'x^-1 - 0.57721566490153286060651209008240243104 + ' + + '0.98905599532797255539539565150063470794*x - 0.90747907608088628901656016735627511493*x' + + '^2 + 0.98172808683440018733638029402185085036*x^3 - 0.981995068903145202104701413791374' + + '67551*x^4 + O(x^5)') + self.assertEquals(str(pari.gamma(1000, precision=127)), '4.0238726007709377354370243392300398572 E2564') + self.assertEquals(str(pari.gamma('x+O(x^2)', precision=127)), 'x^-1 + O(x^0)') + self.assertEquals(str(pari.gamma('-1-10^-16', precision=127)), '9999999999999999.5772156649015330017905') + self.assertEquals(str(pari.gamma('10^-16', precision=127)), '9999999999999999.4227843350984672382991') + + self.assertEquals(str(pari.binomial('2^64+1', 2)), '170141183460469231740910675752738881536') + self.assertEquals(str(pari.binomial('1001.', 1000)), '1001.0000000000000000000000000000000000') + + self.assertEquals(str(pari.gammah(400, precision=127)), '3.2007257594901922498857741835634344245 E867') + self.assertEquals(str(pari.gammah('400+I', precision=127)), + '3.0616681090421088936612867355651954590 E867 - 9.1937706728127042134545128900883765323 E' + + '866*I') + + pari.set_real_precision(154) + self.assertEquals(str(pari.gamma('1+10^-30', precision=512)), + '0.99999999999999999999999999999942278433509846713939348790991858662495316863661547179684' + + '57324923439953758567745265933287771985525453403691462945597162933800') + self.assertEquals(str(pari.gamma('-1e-6', precision=512)), + '-1000000.5772166539584356686368774405975327324364299837039157908236471064277420795292528' + + '95286760197004854674329979420483457441111886014601499071559796851143') + + def test_psi(self): + pari.set_real_precision(38) + pari.set_series_precision(6) + self.assertEquals(str(pari.psi('2+I+x', precision=127)), '(0.59465032062247697727187848272191072247 + 0.5' + + '7667404746858117413405079475000049045*I) + (0.46300009662276378629832651818418579441 -' + + ' 0.29423354275931886558301361715690299591*I)*x + (-0.065723534206032414131682728509702' + + '607416 + 0.13332642517253310620134768881568504070*I)*x^2 + (-0.00381240815891599630224' + + '72229013688544964 - 0.052881096443660109736465443839034730260*I)*x^3 + (0.011646173710' + + '168721646303099647994255377 + 0.017474497859917982232442372031895951470*I)*x^4 + (-0.0' + + '077757069690405743408170730434310459472 - 0.0040345642341327827815714280332882428196*I' + + ')*x^5 + O(x^6)') + self.assertEquals(str(pari.psi('1+x', precision=127)), '-0.57721566490153286060651209008240243104 + 1.644' + + '9340668482264364724151666460251892*x - 1.2020569031595942853997381615114499908*x^2 + 1' + + '.0823232337111381915160036965411679028*x^3 - 1.0369277551433699263313654864570341681*x' + + '^4 + 1.0173430619844491397145179297909205279*x^5 + O(x^6)') + self.assertEquals(str(pari.psi('-2+x', precision=127)), '-x^-1 + 0.92278433509846713939348790991759756896' + + ' + 2.8949340668482264364724151666460251892*x - 0.0770569031595942853997381615114499907' + + '62*x^2 + 2.1448232337111381915160036965411679028*x^3 + O(x^4)') + self.assertEquals(str(pari.psi('x', precision=127)), '-x^-1 - 0.57721566490153286060651209008240243104 + 1' + + '.6449340668482264364724151666460251892*x - 1.2020569031595942853997381615114499908*x^2 ' + + '+ 1.0823232337111381915160036965411679028*x^3 - 1.0369277551433699263313654864570341681' + + '*x^4 + 1.0173430619844491397145179297909205279*x^5 + O(x^6)') + + with self.assertRaises(PariError) as context: + pari.psi('O(x)', precision=127) + self.assertTrue('domain error in psi: argument = 0' in str(context.exception)) + + self.assertEquals(str(pari.psi('2^400', precision=127)), '277.25887222397812376689284858327062723') + self.assertEquals(str(pari.psi('-1.5', precision=127)), '0.70315664064524318722569033366791109947') + self.assertEquals(str(pari.psi('x+O(x^2)', precision=127)), '-x^-1 + O(x^0)') + + def test_lngamma(self): + pari.set_real_precision(38) + pari.set_series_precision(6) + self.assertEquals(str(pari.lngamma('2+I+x', precision=127)), '(-0.30434960902188368417660077077485938103 ' + + '+ 0.48375784292991511172812918802297918039*I) + (0.59465032062247697727187848272191072' + + '247 + 0.57667404746858117413405079475000049045*I)*x + (0.23150004831138189314916325909' + + '209289721 - 0.14711677137965943279150680857845149795*I)*x^2 + (-0.02190784473534413804' + + '3894242836567535805 + 0.044442141724177702067115896271895013565*I)*x^3 + (-0.000953102' + + '03972899907556180572534221362410 - 0.013220274110915027434116360959758682565*I)*x^4 + ' + + '(0.0023292347420337443292606199295988510753 + 0.00349489957198359644648847440637919029' + + '41*I)*x^5 + O(x^6)') + self.assertEquals(str(pari.lngamma('1+x', precision=127)), '-0.57721566490153286060651209008240243104*x +' + + ' 0.82246703342411321823620758332301259461*x^2 - 0.400685634386531428466579387170483330' + + '25*x^3 + 0.27058080842778454787900092413529197569*x^4 - 0.2073855510286739852662730972' + + '9140683361*x^5 + O(x^6)') + with self.assertRaises(PariError) as context: + pari.lngamma('-2+x', precision=127) + self.assertTrue('domain error in intformal: residue(series, pole) != 0' in str(context.exception)) + self.assertEquals(str(pari.lngamma('2+x', precision=127)), '0.42278433509846713939348790991759756896*x + ' + + '0.32246703342411321823620758332301259461*x^2 - 0.0673523010531980951332460538371499969' + + '21*x^3 + 0.020580808427784547879000924135291975694*x^4 - 0.007385551028673985266273097' + + '2914068336108*x^5 + O(x^6)') + self.assertEquals(str(pari.lngamma(1, precision=127)), '0.E-38') + self.assertEquals(str(pari.lngamma('1.', precision=127)), '0.E-38') + self.assertEquals(str(pari.lngamma('1+a*x+O(x^2)', precision=127)), + '-0.57721566490153286060651209008240243104*a*x + O(x^2)') + with self.assertRaises(PariError) as context: + pari.lngamma('O(x)', precision=127) + self.assertTrue('domain error in lngamma: argument = 0' in str(context.exception)) + + self.assertEquals(str(pari.lngamma('-1-10^-16', precision=127)), + '36.841361487904730902009429765103126607 - 6.2831853071795864769252867665590057684*I') + self.assertEquals(str(pari.lngamma('10^-16', precision=127)), '36.841361487904730886566296784796549486') + + self.assertEquals(str(pari.lngamma('2^301', precision=127)), '8.4592930575197658134779513864578051837 E92') + self.assertEquals(str(pari.lngamma('2^301 + 2*I', precision=127)), + '8.4592930575197658134779513864578051837 E92 + 417.27460269708707626917373711782229398*I') + self.assertEquals(str(pari.lngamma('2^64 + 2*I', precision=127)), + '799877009219260410589.21059353880333769 + 88.722839111672999605351501438022325492*I') + self.assertEquals(str(pari.lngamma('-200.5', precision=127)), + '-864.73828787067971564321683481711497423 - 631.46012337154844093099132003918007972*I') + + pari.set_real_precision(115) + self.assertEquals(str(pari.lngamma('2^301 + 2*I', precision=383)), + '845929305751976581347795138645780518366096909527115472' + + '113667217165978056363716339197618169691.8420416798032146865778 + 417.2746026970870762691' + + '7373711782229398145108088487366298064936571502296042575621879472972285159859522702000524' + + '67288*I') + self.assertEquals(str(pari.lngamma('2^301 + 200*I', precision=383)), + '8459293057519765813477951386457805183660969095271154' + + '72113667217165978056363716339197618169691.8420416798032146865778 + 41727.460269708707626' + + '9173737117822293981451080884873662980649365715022960425756218794729722851598595227020005' + + '2467288*I') + + pari.set_real_precision(154) + self.assertEquals(str(pari.lngamma('2^301 + 2000*I', precision=512)), + '8459293057519765813477951386457805183660969095271154721136672171659780563637163391976181' + + '69691.8420416798032146865778407117373385742831330551204346169684432 + 417274.60269708707' + + '6269173737117822293981451080884873662980649365715022960425756218794729722851598595227020' + + '0052467287642139293693997776338197086953142287383*I') + +"""**** Original expected results **** + +(0.65296549642016672783864624794608469715 + 0.343065839816545357588735986978 +31148676*I) + (0.19044897540645184469078131473790885364 + 0.5805524673194769 +2349794265298068695525*I)*x + (0.090862784286733058570355592072096462602 + 0 +.21088392899265350361451872767550590408*I)*x^2 + (0.034253752000523576920016 +074597694397590 + 0.15168994440796279268955277197772465641*I)*x^3 + (-0.0093 +139210540785894159197859484392067432 + 0.03306465179643991397682862055127742 +8299*I)*x^4 + (0.0066762623841895560506752315759505427095 + 0.01516404667566 +6586697065188398143396917*I)*x^5 + O(x^6) +1 - 0.57721566490153286060651209008240243104*x + 0.9890559953279725553953956 +5150063470794*x^2 - 0.90747907608088628901656016735627511493*x^3 + 0.9817280 +8683440018733638029402185085036*x^4 - 0.981995068903145202104701413791374675 +51*x^5 + O(x^6) +1 + 0.42278433509846713939348790991759756896*x + 0.4118403304264396947888835 +6141823227689*x^2 + 0.081576919247086266378835484144359593009*x^3 + 0.074249 +010753513898319820126665575735431*x^4 - 0.0002669820687450147683211197695238 +2515602*x^5 + O(x^6) +0.50000000000000000000000000000000000000*x^-1 + 0.46139216754923356969674395 +495879878448 + 0.93661624898783663224281375818851553069*x + 0.72048875166669 +501900756857612523634633*x^2 + 1.1032890464233243060581361321045221793*x^3 + + O(x^4) +(-0.30434960902188368417660077077485938103 + 0.48375784292991511172812918802 +297918039*I) + (0.59465032062247697727187848272191072247 + 0.576674047468581 +17413405079475000049045*I)*x + (0.23150004831138189314916325909209289721 - 0 +.14711677137965943279150680857845149795*I)*x^2 + (-0.02190784473534413804389 +4242836567535805 + 0.044442141724177702067115896271895013565*I)*x^3 + (-0.00 +095310203972899907556180572534221362410 - 0.01322027411091502743411636095975 +8682565*I)*x^4 + (0.0023292347420337443292606199295988510753 + 0.00349489957 +19835964464884744063791902941*I)*x^5 + O(x^6) +-0.57721566490153286060651209008240243104*x + 0.8224670334241132182362075833 +2301259461*x^2 - 0.40068563438653142846657938717048333025*x^3 + 0.2705808084 +2778454787900092413529197569*x^4 - 0.20738555102867398526627309729140683361* +x^5 + O(x^6) + *** at top-level: lngamma(-2+x) + *** ^------------- + *** lngamma: domain error in intformal: residue(series, pole) != 0 +0.42278433509846713939348790991759756896*x + 0.32246703342411321823620758332 +301259461*x^2 - 0.067352301053198095133246053837149996921*x^3 + 0.0205808084 +27784547879000924135291975694*x^4 - 0.00738555102867398526627309729140683361 +08*x^5 + O(x^6) +0.E-38 +0.E-38 +(0.59465032062247697727187848272191072247 + 0.576674047468581174134050794750 +00049045*I) + (0.46300009662276378629832651818418579441 - 0.2942335427593188 +6558301361715690299591*I)*x + (-0.065723534206032414131682728509702607416 + +0.13332642517253310620134768881568504070*I)*x^2 + (-0.0038124081589159963022 +472229013688544964 - 0.052881096443660109736465443839034730260*I)*x^3 + (0.0 +11646173710168721646303099647994255377 + 0.017474497859917982232442372031895 +951470*I)*x^4 + (-0.0077757069690405743408170730434310459472 - 0.00403456423 +41327827815714280332882428196*I)*x^5 + O(x^6) +-0.57721566490153286060651209008240243104 + 1.644934066848226436472415166646 +0251892*x - 1.2020569031595942853997381615114499908*x^2 + 1.0823232337111381 +915160036965411679028*x^3 - 1.0369277551433699263313654864570341681*x^4 + 1. +0173430619844491397145179297909205279*x^5 + O(x^6) +-x^-1 + 0.92278433509846713939348790991759756896 + 2.89493406684822643647241 +51666460251892*x - 0.077056903159594285399738161511449990762*x^2 + 2.1448232 +337111381915160036965411679028*x^3 + O(x^4) +-3.5449077018110320545963349666822903656 - 0.1293535897955400553154795370758 +8123112*x - 15.838884621997332891305490359174586834*x^2 - 0.0882351409230713 +74511750322744686276244*x^3 - 63.934119924167817737375290277713885431*x^4 - +0.042848354492868684268292005312709223076*x^5 + O(x^6) +1 - 0.57721566490153286060651209008240243104*a*x + O(x^2) +-0.57721566490153286060651209008240243104*a*x + O(x^2) + *** at top-level: gamma(O(x)) + *** ^----------- + *** gamma: domain error in gamma: argument = 0 + *** at top-level: lngamma(O(x)) + *** ^------------- + *** lngamma: domain error in lngamma: argument = 0 + *** at top-level: psi(O(x)) + *** ^--------- + *** psi: domain error in psi: argument = 0 +-x^-1 - 0.57721566490153286060651209008240243104 + 1.64493406684822643647241 +51666460251892*x - 1.2020569031595942853997381615114499908*x^2 + 1.082323233 +7111381915160036965411679028*x^3 - 1.0369277551433699263313654864570341681*x +^4 + 1.0173430619844491397145179297909205279*x^5 + O(x^6) +x^-1 - 0.57721566490153286060651209008240243104 + 0.989055995327972555395395 +65150063470794*x - 0.90747907608088628901656016735627511493*x^2 + 0.98172808 +683440018733638029402185085036*x^3 - 0.9819950689031452021047014137913746755 +1*x^4 + O(x^5) +4.0238726007709377354370243392300398572 E2564 +277.25887222397812376689284858327062723 +0.70315664064524318722569033366791109947 +-x^-1 + O(x^0) +x^-1 + O(x^0) +9999999999999999.5772156649015330017905 +9999999999999999.4227843350984672382991 +36.841361487904730902009429765103126607 - 6.28318530717958647692528676655900 +57684*I +36.841361487904730886566296784796549486 +170141183460469231740910675752738881536 +1001.0000000000000000000000000000000000 +8.4592930575197658134779513864578051837 E92 +8.4592930575197658134779513864578051837 E92 + 417.27460269708707626917373711 +782229398*I +799877009219260410589.21059353880333769 + 88.7228391116729996053515014380223 +25492*I +-864.73828787067971564321683481711497423 - 631.46012337154844093099132003918 +007972*I +3.2007257594901922498857741835634344245 E867 +3.0616681090421088936612867355651954590 E867 - 9.193770672812704213454512890 +0883765323 E866*I +8459293057519765813477951386457805183660969095271154721136672171659780563637 +16339197618169691.8420416798032146865778 + 417.27460269708707626917373711782 +2293981451080884873662980649365715022960425756218794729722851598595227020005 +2467288*I +8459293057519765813477951386457805183660969095271154721136672171659780563637 +16339197618169691.8420416798032146865778 + 41727.460269708707626917373711782 +2293981451080884873662980649365715022960425756218794729722851598595227020005 +2467288*I +8459293057519765813477951386457805183660969095271154721136672171659780563637 +16339197618169691.8420416798032146865778407117373385742831330551204346169684 +432 + 417274.602697087076269173737117822293981451080884873662980649365715022 +9604257562187947297228515985952270200052467287642139293693997776338197086953 +142287383*I +0.99999999999999999999999999999942278433509846713939348790991858662495316863 +6615471796845732492343995375856774526593328777198552545340369146294559716293 +3800 +-1000000.5772166539584356686368774405975327324364299837039157908236471064277 +4207952925289528676019700485467432997942048345744111188601460149907155979685 +1143 + +""" diff --git a/tests/unittests/idealappr.py b/tests/unittests/idealappr.py new file mode 100644 index 0000000..e109615 --- /dev/null +++ b/tests/unittests/idealappr.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file idealappr : +idealaddtoone(nfinit(x),[1,[;]]); +K=nfinit(x^2+23); A=idealhnf(K,x/2); +idealtwoelt(K, 3, 6) +idealtwoelt(K, A) +idealtwoelt(K, A, x) +idealtwoelt(K, [;]) +idealtwoelt(K, [;], 1) +idealtwoelt(K, [;], 0) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestIdealappr(unittest.TestCase): + def test_idealappr(self): + pari.idealaddtoone(pari.nfinit('x'),'[1,[;]]'); + K=pari.nfinit('x^2+23'); A=pari.idealhnf(K,'x/2'); + + self.assertEquals(str(pari.idealtwoelt(K, 3, 6)), '3') + self.assertEquals(str(pari.idealtwoelt(K, A)), '[23/2, [6, 1/2]~]') + self.assertEquals(str(pari.idealtwoelt(K, A, 'x')), '-23/2') + self.assertEquals(str(pari.idealtwoelt(K, '[;]')), '[0, 0]') + with self.assertRaises(PariError) as context: + pari.idealtwoelt(K, '[;]', 1) + self.assertTrue('domain error in idealtwoelt2: element mod ideal != 0' in str(context.exception)) + self.assertEquals(str(pari.idealtwoelt(K, '[;]', 0)), '0') + +"""**** Original expected results **** + +3 +[23/2, [6, 1/2]~] +-23/2 +[0, 0] + *** at top-level: idealtwoelt(K,[;],1) + *** ^-------------------- + *** idealtwoelt: domain error in idealtwoelt2: element mod ideal != 0 +0 + +""" diff --git a/tests/unittests/idealramgroups.py b/tests/unittests/idealramgroups.py new file mode 100644 index 0000000..d077e0c --- /dev/null +++ b/tests/unittests/idealramgroups.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file idealramgroups : +{ + K=nfinit(x^30 - 240*x^28 + 24364*x^26 - 1366520*x^24 + 46492470*x^22 - 994986280*x^20 + 13527103660*x^18 - 116596891080*x^16 + 634140564945*x^14 - 2144111162280*x^12 + 4349007947424*x^10 - 4933119511040*x^8 + 2746986107136*x^6 - 564152514560*x^4 + 40138752000*x^2 - 409600000); + G=galoisinit(K); + forprime(p=2,37, + pr = idealprimedec(K,p)[1]; + print(pr.p,":", apply(galoisidentify,idealramgroups(K,G,pr)))) +} +K=nfinit(x^6 + 12*x^5 + 60*x^4 + 376*x^3 + 80268*x^2 + 4569240*x + 66227068); +G=galoisinit(K); +D=idealprimedec(K,29)[1]; +[idealfrobenius(K,G,D),idealramgroups(K,G,D)] + +K=nfinit(polcyclo(24)); +G=galoisinit(K); +P=idealprimedec(K,2)[1]; +idealramgroups(K,G,P) + +\\#1755 +P=x^8-12*x^6+36*x^4-36*x^2+9;N=nfinit(P);G=galoisinit(N); +idealramgroups(N,G,idealprimedec(N,3)[1]) +""" +import unittest +from testutils import primes +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestIdealramgroups(unittest.TestCase): + def test_idealramgroups(self): + K = pari.nfinit('x^30 - 240*x^28 + 24364*x^26 - 1366520*x^24 + 46492470*x^22 - 994986280*x^20 + 13527103660' + + '*x^18 - 116596891080*x^16 + 634140564945*x^14 - 2144111162280*x^12 + 4349007947424*x^10 ' + + '- 4933119511040*x^8 + 2746986107136*x^6 - 564152514560*x^4 + 40138752000*x^2 - 409600000') + G = pari.galoisinit(K); + + l = ['2:[[2, 1], [2, 1], [2, 1], [2, 1]]', + '3:[[15, 1]]', + '5:[[2, 1], [2, 1]]', + '7:[[2, 1]]', + '11:[[2, 1]]', + '13:[[15, 1]]', + '17:[[2, 1]]', + '19:[[10, 1], [5, 1]]', + '23:[[2, 1]]', + '29:[[2, 1]]', + '31:[[15, 1]]', + '37:[[15, 1], [3, 1]]'] + + i = 0 + for p in primes(38): + pr = pari.idealprimedec(K, p)[0]; + self.assertEquals("%d:%s" % (p, pari.apply(pari.galoisidentify, pari.idealramgroups(K, G, pr))), l[i]) + i += 1 + + K = pari.nfinit('x^6 + 12*x^5 + 60*x^4 + 376*x^3 + 80268*x^2 + 4569240*x + 66227068'); + G = pari.galoisinit(K); + D = pari.idealprimedec(K, 29)[0]; + self.assertEquals(str(pari.idealfrobenius(K, G, D)), 'Vecsmall([6, 3, 2, 5, 4, 1])') + self.assertEquals(str(pari.idealramgroups(K, G, D)), '[[[Vecsmall([6, 3, 2, 5, 4, 1])], Vecsmall([2])]]') + + K = pari.nfinit(pari.polcyclo(24)); + G = pari.galoisinit(K); + P = pari.idealprimedec(K, 2)[0]; + self.assertEquals(pari.idealramgroups(K, G, P), + '[[[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7]), Vecsmall([3, 4, 1, 2, 7, 8, 5, 6]), Vecsmall([5, ' + + '6, 7, 8, 1, 2, 3, 4])], Vecsmall([2, 2, 2])], [[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7]), Vecs' + + 'mall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2, 2])], [[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7])' + + ', Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2, 2])], [[Vecsmall([3, 4, 1, 2, 7, 8, ' + + '5, 6])], Vecsmall([2])], [[Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2])]]') + + # 1755 + P = 'x^8-12*x^6+36*x^4-36*x^2+9'; + N = pari.nfinit(P); + G = pari.galoisinit(N); + self.assertEquals(pari.idealramgroups(N, G, pari.idealprimedec(N, 3)[0]), + '[[[Vecsmall([7, 1, 5, 3, 6, 4, 8, 2]), Vecsmall([3, 5, 8, 2, 7, 1, 4, 6])],Vecsmall([4, ' + + '2])], [[Vecsmall([7, 1, 5, 3, 6, 4, 8, 2])], Vecsmall([4])]]') + +"""**** Original expected results **** + +2:[[2, 1], [2, 1], [2, 1], [2, 1]] +3:[[15, 1]] +5:[[2, 1], [2, 1]] +7:[[2, 1]] +11:[[2, 1]] +13:[[15, 1]] +17:[[2, 1]] +19:[[10, 1], [5, 1]] +23:[[2, 1]] +29:[[2, 1]] +31:[[15, 1]] +37:[[15, 1], [3, 1]] +[Vecsmall([6, 3, 2, 5, 4, 1]), [[[Vecsmall([6, 3, 2, 5, 4, 1])], Vecsmall([2 +])]]] +[[[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7]), Vecsmall([3, 4, 1, 2, 7, 8, 5, 6]), V +ecsmall([5, 6, 7, 8, 1, 2, 3, 4])], Vecsmall([2, 2, 2])], [[Vecsmall([2, 1, +4, 3, 6, 5, 8, 7]), Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2, 2])], +[[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7]), Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], V +ecsmall([2, 2])], [[Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2])], [[V +ecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2])]] +[[[Vecsmall([7, 1, 5, 3, 6, 4, 8, 2]), Vecsmall([3, 5, 8, 2, 7, 1, 4, 6])], +Vecsmall([4, 2])], [[Vecsmall([7, 1, 5, 3, 6, 4, 8, 2])], Vecsmall([4])]] + +""" diff --git a/tests/unittests/isprime.py b/tests/unittests/isprime.py new file mode 100644 index 0000000..cfb35b8 --- /dev/null +++ b/tests/unittests/isprime.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/25/2017 + +"""Original pari/GP test file isprime : +isprime(5368962301599408606279497323618896374219) +isprime(4309513411435775833571) +isprime(26959946667150639794667015087019630673557916260026308143510066298881) + +p=10^6+3; q=10^6+33; +isprime(1+24*p*q, 1) +isprime(1+232*p^2*q^3, 1) + +isprime([2,3,4]) +isprime([2,3,4],1) +isprime([2,3,4],2) +ispseudoprime([1,3,4,5],2) +\\isprime(2^3515+159, 2) 10 min +\\isprime(2^2000+841, 2) 1 min +\\isprime(2^1600+895, 2) 27s +isprime(2^1000+297, 2) + +isprime(2^256+5721) +""" +import unittest +from math import pow +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestIsprime(unittest.TestCase): + def test_isprime(self): + self.assertEquals(pari.isprime(5368962301599408606279497323618896374219), '1') + self.assertEquals(pari.isprime(4309513411435775833571), '1') + self.assertEquals(pari.isprime(26959946667150639794667015087019630673557916260026308143510066298881), '1') + + p = int(pow(10, 6) + 3); + q = int(pow(10, 6) + 33); + self.assertEquals(pari.isprime(1 + 24 * p * q, 1), '[2, 5, 1; 3, 2, 1; 1000003, 2, 1]') + x = pari.isprime(1 + 232 * int(pow(p, 2)) * int(pow(q, 3)), 1) + # self.assertEquals(x, '[2, 3, 1; 29, 2, 1; 1000003, 2, 1]') + + self.assertEquals(pari.isprime([2, 3, 4]), '[1, 1, 0]') + self.assertEquals(pari.isprime([2, 3, 4], 1), '[1, Mat([2, 2, 1]), 0]') + self.assertEquals(pari.isprime([2, 3, 4], 2), '[1, 1, 0]') + self.assertEquals(pari.ispseudoprime([1, 3, 4, 5], 2), '[0, 1, 0, 1]') + # pari.isprime(2^3515+159, 2) 10 min + # pari.isprime(2^2000+841, 2) 1 min + # pari.isprime(2^1600+895, 2) 27s + self.assertEquals(pari.isprime(int(pow(2, 1000)) + 297, 2), '1') + + self.assertEquals(pari.isprime(int(pow(2, 256)) + 5721), '1') + +"""**** Original expected results **** + +1 +1 +1 + +[ 2 5 1] + +[ 3 2 1] + +[1000003 2 1] + + +[ 2 3 1] + +[ 29 2 1] + +[1000003 2 1] + +[1, 1, 0] +[1, Mat([2, 2, 1]), 0] +[1, 1, 0] +[0, 1, 0, 1] +1 +1 + +""" diff --git a/tests/unittests/lambert.py b/tests/unittests/lambert.py new file mode 100644 index 0000000..81fb748 --- /dev/null +++ b/tests/unittests/lambert.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/25/2017 + +"""Original pari/GP test file lambert : +do(y)=my(x = lambertw(y)); exp(x)*x / y; +do(-1) +do(I) +default(realprecision,38); +do(2) +default(realprecision,211); +do(1e14) +do(y)= +{ my(x = lambertw(y), e = normlp(Vec(exp(x)*x - y))); + if (e > 5e-38, error([e, y])); +} +default(realprecision,38); +do(O(x^10)) +do(O(x^30)) +do(3+O(x^10)) +do(3+O(x^30)) +do(x) +do(x+O(x^10)) +do(x+O(x^30)) +do(3+O(x)) +do(3+x) +do(3+x+O(x^10)) +do(3+x+O(x^30)) +do(x^2-2*x^3) +do(x^2-2*x^3+O(x^10)) +do(x^2-2*x^3+O(x^30)) +do(3+x^2-2*x^3) +do(3+x^2-2*x^3+O(x^10)) +do(3+x^2-2*x^3+O(x^30)) +lambertw(1/x) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestLambert(unittest.TestCase): + def test_lambert(self): + def do(y, precision=127): + x = pari.lambertw(y, precision=precision) + return pari.exp(x)*x/y; + with self.assertRaises(PariError) as context: + do(-1) + self.assertTrue('domain error in Lw: y < 0' in str(context.exception)) + with self.assertRaises(PariError) as context: + do('I') + self.assertTrue('sorry, lambert(t_COMPLEX) is not yet implemented' in str(context.exception)) + pari.set_real_precision(38) + self.assertEquals(do(2), '1.0000000000000000000000000000000000000') + pari.set_real_precision(211) + self.assertEquals(do('1e14', precision=701), + '0.9999999999999999999999999999999999999999999999999999999999999999999' + + '999999999999999999999999999999999999999999999999999999999999999999999999999999999' + + '999999999999999999999999999999999999999999999999999999999999999') + + def do2(y, precision=127): + x = pari.lambertw(y, precision=precision) + e = pari.normlp(pari.Vec(pari.exp(x)*x - y)) + self.assertLessEqual(e, 5e-38) + + pari.set_real_precision(38) + do2('O(x^10)') + do2('O(x^30)') + do2('3+O(x^10)') + do2('3+O(x^30)') + do2('x') + do2('x+O(x^10)') + do2('x+O(x^30)') + do2('3+O(x)') + do2('3+x') + do2('3+x+O(x^10)') + do2('3+x+O(x^30)') + do2('x^2-2*x^3') + do2('x^2-2*x^3+O(x^10)') + do2('x^2-2*x^3+O(x^30)') + do2('3+x^2-2*x^3') + do2('3+x^2-2*x^3+O(x^10)') + do2('3+x^2-2*x^3+O(x^30)') + with self.assertRaises(PariError) as context: + pari.lambertw('1/x') + self.assertTrue('domain error in lambertw: valuation < 0' in str(context.exception)) + +"""**** Original expected results **** + + *** at top-level: do(-1) + *** ^------ + *** in function do: my(x=lambertw(y));exp(x)* + *** ^-------------------- + *** lambertw: domain error in Lw: y < 0 + *** at top-level: do(I) + *** ^----- + *** in function do: my(x=lambertw(y));exp(x)* + *** ^-------------------- + *** lambertw: sorry, lambert(t_COMPLEX) is not yet implemented. +1.0000000000000000000000000000000000000 +0.99999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999 + *** at top-level: lambertw(1/x) + *** ^------------- + *** lambertw: domain error in lambertw: valuation < 0 + +""" diff --git a/tests/unittests/lex.py b/tests/unittests/lex.py new file mode 100644 index 0000000..4f62408 --- /dev/null +++ b/tests/unittests/lex.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/25/2017 + +"""Original pari/GP test file lex : +v = [0, 2, [1,2], [1,2;3,4], [1,0;1,2], [1,2,3]~, [1,2,3;4,5,6]]; + +isvec(x) = type(x) == "t_VEC" || type(x) == "t_COL"; +{ + for (i = 1, #v, + for (j = i, #v, + s = lex(v[i],v[j]); + print([i,j,s]); + if (s != -lex(v[j], v[i]), error(2)); + if (isvec(v[i]) && lex(Vecsmall(v[i]), v[j]) != s, error(3)); + if (isvec(v[j]) && lex(v[i], Vecsmall(v[j])) != s, error(4)); + + ) + ); +} + +v = Vecsmall([1,2,3]); +lex(v, [1,2,3]) +lex(v, [1,2]) +lex(v, [1,2,4]) +lex(v, [4,2,3]) +lex(v, [0,2,3]) +lex(v, [[1,2,3],2,3]) +lex(v, [[0,2,3],2,3]) +lex(v, [[],2,3]) +lex(v, [Vecsmall([]),2,3]) +lex(v, [Vecsmall(1),2,3]) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestLex(unittest.TestCase): + def test_lex(self): + v = [0, 2, [1, 2], '[1,2;3,4]', '[1,0;1,2]', '[1,2,3]~', '[1,2,3;4,5,6]']; + + def isvec(x): + return pari.type(x) == "t_VEC" or pari.type(x) == "t_COL" + + l = ['[1, 1, 0]', + '[1, 2, -1]', + '[1, 3, -1]', + '[1, 4, -1]', + '[1, 5, -1]', + '[1, 6, -1]', + '[1, 7, -1]', + '[2, 2, 0]', + '[2, 3, 1]', + '[2, 4, 1]', + '[2, 5, 1]', + '[2, 6, 1]', + '[2, 7, 1]', + '[3, 3, 0]', + '[3, 4, -1]', + '[3, 5, 1]', + '[3, 6, -1]', + '[3, 7, -1]', + '[4, 4, 0]', + '[4, 5, 1]', + '[4, 6, 1]', + '[4, 7, -1]', + '[5, 5, 0]', + '[5, 6, -1]', + '[5, 7, -1]', + '[6, 6, 0]', + '[6, 7, -1]', + '[7, 7, 0]'] + k = 0 + for i in range(0, len(v)): + for j in range(i, len(v)): + s = pari.lex(v[i], v[j]); + self.assertEquals(str([i + 1, j + 1, s]), l[k]); + self.assertEquals(s, -pari.lex(v[j], v[i])) + if isvec(v[j]): + self.assertEquals(s, pari.lex(pari.Vecsmall(v[i]), v[j])) + self.assertEquals(s, pari.lex(v[i], pari.Vecsmall(v[j]))) + k += 1 + + v = pari.Vecsmall([1, 2, 3]); + pari.lex(v, [1, 2, 3]) + pari.lex(v, [1, 2]) + pari.lex(v, [1, 2, 4]) + pari.lex(v, [4, 2, 3]) + pari.lex(v, [0, 2, 3]) + pari.lex(v, [[1, 2, 3], 2, 3]) + pari.lex(v, [[0, 2, 3], 2, 3]) + pari.lex(v, [[], 2, 3]) + pari.lex(v, [pari.Vecsmall([]), 2, 3]) + pari.lex(v, [pari.Vecsmall(1), 2, 3]) + +"""**** Original expected results **** + +[1, 1, 0] +[1, 2, -1] +[1, 3, -1] +[1, 4, -1] +[1, 5, -1] +[1, 6, -1] +[1, 7, -1] +[2, 2, 0] +[2, 3, 1] +[2, 4, 1] +[2, 5, 1] +[2, 6, 1] +[2, 7, 1] +[3, 3, 0] +[3, 4, -1] +[3, 5, 1] +[3, 6, -1] +[3, 7, -1] +[4, 4, 0] +[4, 5, 1] +[4, 6, 1] +[4, 7, -1] +[5, 5, 0] +[5, 6, -1] +[5, 7, -1] +[6, 6, 0] +[6, 7, -1] +[7, 7, 0] +0 +1 +-1 +-1 +1 +-1 +1 +1 +1 +-1 + +""" diff --git a/tests/unittests/lindep.py b/tests/unittests/lindep.py new file mode 100644 index 0000000..c2968ee --- /dev/null +++ b/tests/unittests/lindep.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/25/2017 + +"""Original pari/GP test file lindep : +lindep([sqrt(2), sqrt(3), sqrt(2)+sqrt(3)]) +lindep([1, 2 + 3 + 3^2 + 3^3 + 3^4 + O(3^5)]) +lindep([1,2,3;4,5,6;7,8,9]) +lindep([x*y, x^2 + y, x^2*y + x*y^2, 1]) +z = sqrt(1+5*y+y^2+y^3); +seralgdep(z, 2,3) +seralgdep(z, 2,2) +seralgdep(1/(1-y+O(y^5)), 1,1) +seralgdep(1+5*y+O(y^3), 1,10) +lindep([]) +lindep([0]) +lindep([1]) +lindep([1,I]) +algdep(1,0) +algdep(1,-1) +z=sqrt(2+O(7^4)); algdep(z,2) +lindep(Mod([E*x, E*x + E, E^2*x^2 + E*x + 2*E], E^3)) +lindep([[1,0,0],[0,1,0],[1,1,0]]) +lindep([[1,0,0]~,[0,1,0]~,[1,1,0]~]) +lindep([[1,0,0]~,[0,1,0]~,[1,1,1]~]) +lindep([[1,0,0]~,[0,1,0],[1,1,0]]) +lindep([[1,0,0]~,[0,1,0]~,[1,1,0]~]) + +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestLindep(unittest.TestCase): + def test_lindep(self): + self.assertEquals(pari.lindep([pari.sqrt(2), pari.sqrt(3), pari.sqrt(2) + pari.sqrt(3)]), '[-1, -1, 1]~') + self.assertEquals(pari.lindep('[1, 2 + 3 + 3^2 + 3^3 + 3^4 + O(3^5)]'), '[1, -2]~') + self.assertEquals(pari.lindep('[1,2,3;4,5,6;7,8,9]'), '[1, -2, 1]~') + self.assertEquals(pari.lindep(['x*y', 'x^2 + y', 'x^2*y + x*y^2', 1]), '[y, y, -1, -y^2]~') + self.assertEquals(pari.lindep([]), '[]~') + self.assertEquals(pari.lindep([0]), '[1]~') + self.assertEquals(pari.lindep([1]), '[]~') + self.assertEquals(pari.lindep([1, 'I']), '[]~') + self.assertEquals(pari.lindep(pari.Mod(['E*x', 'E*x + E', 'E^2*x^2 + E*x + 2*E'], 'E^3')), + '[Mod(0, E^3), Mod(0, E^3), Mod(0, E^3)]~') + self.assertEquals(pari.lindep([[1, 0, 0], [0, 1, 0], [1, 1, 0]]), '[1, 1, -1]~') + self.assertEquals(pari.lindep(['[1,0,0]~', '[0,1,0]~', '[1,1,0]~']), '[1, 1, -1]~') + self.assertEquals(pari.lindep(['[1,0,0]~', '[0,1,0]~', '[1,1,1]~']), '[]~') + with self.assertRaises(PariError) as context: + pari.lindep(['[1,0,0]~', [0, 1, 0], [1, 1, 0]]) + self.assertTrue('incorrect type in lindep (t_VEC)' in str(context.exception)) + self.assertEquals(pari.lindep(['[1,0,0]~', '[0,1,0]~', '[1,1,0]~']), '[1, 1, -1]~') + + def test_seralgdep(self): + z = pari.sqrt('1+5*y+y^2+y^3'); + self.assertEquals(pari.seralgdep(z, 2, 3), 'x^2 + (-y^3 - y^2 - 5*y - 1)') + self.assertEquals(pari.seralgdep(z, 2, 2), '0') + self.assertEquals(pari.seralgdep('1/(1-y+O(y^5))', 1, 1), '(-y + 1)*x - 1') + self.assertEquals(pari.seralgdep('1+5*y+O(y^3)', 1, 10), '-x + (5*y + 1)') + + def test_algdep(self): + self.assertEquals(pari.algdep(1, 0), '1') + with self.assertRaises(PariError) as context: + pari.algdep(1, -1) + self.assertTrue('domain error in algdep: degree < 0' in str(context.exception)) + z = pari.sqrt('2+O(7^4)'); + self.assertEquals(pari.algdep(z, 2), 'x^2 - 2') + + +"""**** Original expected results **** + +[-1, -1, 1]~ +[1, -2]~ +[1, -2, 1]~ +[y, y, -1, -y^2]~ +x^2 + (-y^3 - y^2 - 5*y - 1) +0 +(-y + 1)*x - 1 +-x + (5*y + 1) +[]~ +[1]~ +[]~ +[]~ +1 + *** at top-level: algdep(1,-1) + *** ^------------ + *** algdep: domain error in algdep: degree < 0 +x^2 - 2 +[Mod(0, E^3), Mod(0, E^3), Mod(0, E^3)]~ +[1, 1, -1]~ +[1, 1, -1]~ +[]~ + *** at top-level: lindep([[1,0,0]~,[0, + *** ^-------------------- + *** lindep: incorrect type in lindep (t_VEC). +[1, 1, -1]~ + +""" diff --git a/tests/unittests/polylog.py b/tests/unittests/polylog.py new file mode 100644 index 0000000..1409b08 --- /dev/null +++ b/tests/unittests/polylog.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file polylog : +default(realprecision,38); +polylog(3,0.9) +polylog(2,3.9) +polylog(3,3.9) +polylog(2,Mod(x,x^2+1)) +polylog(2,[0.5,0.6]) +polylog(2,x+O(x^5)) +polylog(2,1/2+x+O(x^5)) +dilog(-4) +polylog(2,1+I,1) +polylog(1,2,3) +localbitprec(320);bitprecision(dilog(2.0)) + +\\errors +polylog(3,2,5) +polylog(2,Mod(1,2),0) +polylog(3,"",0) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestPolylog(unittest.TestCase): + def test_polylog(self): + pari.set_real_precision(38) + self.assertEquals(str(pari.polylog(3, '0.9')), '1.0496589501864398696458324932101000704') + self.assertEquals(str(pari.polylog(2, '3.9')), '2.0886953792151632708518141489041442185 - 4.275633941038' + + '7621770489264556951963565*I') + self.assertEquals(str(pari.polylog(3, '3.9')), '4.3226178452644705784020044544722613393 - 2.909518771772' + + '2594640746948896647103179*I') + self.assertEquals(str(pari.polylog(2, pari.Mod('x', 'x^2+1'), precision=127)), '[-0.20561675835602830455905189583075314' + + '866 - 0.91596559417721901505460351493238411074*I, -0.20561675835602830455905189583075' + + '314866 + 0.91596559417721901505460351493238411074*I]~') + self.assertEquals(str(pari.polylog(2, ['0.5', '0.6'])), '[0.58224052646501250590265632015968010874, 0.72' + + '758630771633338951353629684048110789]') + self.assertEquals(str(pari.polylog(2, 'x+O(x^5)')), 'x + 1/4*x^2 + 1/9*x^3 + 1/16*x^4 + O(x^5)') + self.assertEquals(str(pari.polylog(2, '1/2 + x + O(x^5)', precision=127)), '0.58224052646501250590265632015968010874 + ' + + '1.3862943611198906188344642429163531362*x + 0.61370563888010938116553575708364686385*' + + 'x^2 + 0.51505914815985415844595232388847084820*x^3 + 0.560744611093552095664404847500' + + '62706103*x^4 + O(x^5)') + self.assertEquals(str(pari.dilog(-4, precision=127)), '-2.3699397969983658319855374253503230488') + self.assertEquals(str(pari.polylog(2, '1+I', 1, precision=127)), '0.91596559417721901505460351493238411077') + self.assertEquals(str(pari.polylog(1, 2, 3, precision=127)), '0.34657359027997265470861606072908828404') + pari.set_real_precision_bits(320); + self.assertEquals(pari.bitprecision(pari.dilog('2.0')), '320') + def test_polylog_error_cases(self): + with self.assertRaises(PariError) as context: + pari.polylog(3, 2, 5) + self.assertTrue('invalid flag in polylog' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.polylog(2, pari.Mod(1, 2), 0) + self.assertTrue('sorry, padic polylogarithm is not yet implemented' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.polylog(3, '""', 0) + self.assertTrue('incorrect type in gpolylog (t_STR)' in str(context.exception)) + +"""**** Original expected results **** + +1.0496589501864398696458324932101000704 +2.0886953792151632708518141489041442185 - 4.27563394103876217704892645569519 +63565*I +4.3226178452644705784020044544722613393 - 2.90951877177225946407469488966471 +03179*I +[-0.20561675835602830455905189583075314866 - 0.91596559417721901505460351493 +238411074*I, -0.20561675835602830455905189583075314866 + 0.91596559417721901 +505460351493238411074*I]~ +[0.58224052646501250590265632015968010874, 0.7275863077163333895135362968404 +8110789] +x + 1/4*x^2 + 1/9*x^3 + 1/16*x^4 + O(x^5) +0.58224052646501250590265632015968010874 + 1.3862943611198906188344642429163 +531362*x + 0.61370563888010938116553575708364686385*x^2 + 0.5150591481598541 +5844595232388847084820*x^3 + 0.56074461109355209566440484750062706103*x^4 + +O(x^5) +-2.3699397969983658319855374253503230488 +0.91596559417721901505460351493238411077 +0.34657359027997265470861606072908828404 +320 + *** at top-level: polylog(3,2,5) + *** ^-------------- + *** polylog: invalid flag in polylog. + *** at top-level: polylog(2,Mod(1,2),0 + *** ^-------------------- + *** polylog: sorry, padic polylogarithm is not yet implemented. + *** at top-level: polylog(3,"",0) + *** ^--------------- + *** polylog: incorrect type in gpolylog (t_STR). + +""" diff --git a/tests/unittests/set.py b/tests/unittests/set.py new file mode 100644 index 0000000..414c4a2 --- /dev/null +++ b/tests/unittests/set.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/20/2017 + +"""Original pari/GP test file set : +Set(Vecsmall([1,2,1,3])) +Set(List([])) +L=List([1,3,1,2,3]); +Set(L) +listsort(L,1); L +Set(1) +a=Set([5,-2,7,3,5,1,x,"1"]) +b=Set([7,5,-5,7,2,"1"]) +setintersect(a,b) +setisset([-3,5,7,7]) +setisset(a) +setminus(a,b) +setsearch(a,3) +setsearch(a,"1") +setsearch(b,3) +setsearch(L,3) +setsearch(1,3) +setunion(a,b) + +X = [1,2,3]; Y = [2,3,4]; +setbinop((x,y)->x+y, X,Y) +setbinop((x,y)->x+y, X) +setbinop(x->x, X) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestSet(unittest.TestCase): + def test_set(self): + self.assertEquals(pari.Set(pari.Vecsmall([1,2,1,3])), '[1, 2, 3]') + self.assertEquals(pari.Set(pari.List([])), '[]') + L=pari.List([1, 3, 1, 2, 3]); + self.assertEquals(pari.Set(L), '[1, 2, 3]') + pari.listsort(L, 1) + self.assertEquals(L, 'List([1, 2, 3])') + self.assertEquals(pari.Set(1), '[1]') + a = pari.Set([5, -2, 7, 3, 5, 1, 'x', '"1"']) + b = pari.Set([7, 5, -5, 7, 2, '"1"']) + self.assertEquals(str(a), '[-2, 1, 3, 5, 7, x, "1"]') + self.assertEquals(str(b), '[-5, 2, 5, 7, "1"]') + self.assertEquals(pari.setintersect(a, b), '[5, 7, "1"]') + self.assertEquals(str(pari.setisset([-3, 5, 7, 7])), '0') + self.assertEquals(str(pari.setisset(a)), '1') + self.assertEquals(pari.setminus(a, b), '[-2, 1, 3, x]') + self.assertEquals(str(pari.setsearch(a, 3)), '3') + self.assertEquals(str(pari.setsearch(a, '"1"')), '7') + self.assertEquals(str(pari.setsearch(b, 3)), '0') + self.assertEquals(str(pari.setsearch(L, 3)), '3') + with self.assertRaises(PariError) as context: + pari.setsearch(1, 3) + self.assertTrue('type in setsearch (t_INT)' in str(context.exception)) + self.assertEquals(pari.setunion(a, b), '[-5, -2, 1, 2, 3, 5, 7, x, "1"]') + + X = [1, 2, 3]; + Y = [2, 3, 4]; + pari.setbinop('(x,y)->x+y', X, Y) + pari.setbinop('(x,y)->x+y', X) + with self.assertRaises(PariError) as context: + pari.setbinop('x->x', X) + self.assertTrue('incorrect type in setbinop [function needs exactly 2 arguments] (t_CLOSURE)' in + str(context.exception)) + +"""**** Original expected results **** + +[1, 2, 3] +[] +[1, 2, 3] +List([1, 2, 3]) +[1] +[-2, 1, 3, 5, 7, x, "1"] +[-5, 2, 5, 7, "1"] +[5, 7, "1"] +0 +1 +[-2, 1, 3, x] +3 +7 +0 +3 + *** at top-level: setsearch(1,3) + *** ^-------------- + *** setsearch: incorrect type in setsearch (t_INT). +[-5, -2, 1, 2, 3, 5, 7, x, "1"] +[3, 4, 5, 6, 7] +[2, 3, 4, 5, 6] + *** at top-level: setbinop(x->x,X) + *** ^---------------- + *** setbinop: incorrect type in setbinop [function needs exactly 2 arguments] (t_CLOSURE). + +""" diff --git a/tests/unittests/subcyclo.py b/tests/unittests/subcyclo.py new file mode 100644 index 0000000..a4f84e4 --- /dev/null +++ b/tests/unittests/subcyclo.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/21/2017 + +"""Original pari/GP test file subcyclo : +polsubcyclo(8,1) +polsubcyclo(1048,2) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestSubcyclo(unittest.TestCase): + def test_subcyclo(self): + self.assertEquals(pari.polsubcyclo(8,1), '[x - 1]') + self.assertEquals(pari.polsubcyclo(1048,2), '[x^2 + 2, x^2 + 262, x^2 - 262, x^2 - 2, x^2 - 131, x^2 + 1, x' + + '^2 + x + 33]') + +"""**** Original expected results **** + +x - 1 +[x^2 + 2, x^2 + 262, x^2 - 262, x^2 - 2, x^2 - 131, x^2 + 1, x^2 + x + 33] + +""" From e3f02be619ff81aafc76b4919b0634bf6b20e381 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Tue, 26 Sep 2017 10:23:15 +0200 Subject: [PATCH 02/28] functions utils for test units --- tests/unittest_template | 10 ++++++++++ tests/unittests/testutils.py | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/unittest_template create mode 100644 tests/unittests/testutils.py diff --git a/tests/unittest_template b/tests/unittest_template new file mode 100644 index 0000000..2629415 --- /dev/null +++ b/tests/unittest_template @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the $creation_date + +""" +Original pari/GP test file $file_name: +parigp_src +""" + +class Test$file_name( diff --git a/tests/unittests/testutils.py b/tests/unittests/testutils.py new file mode 100644 index 0000000..1245392 --- /dev/null +++ b/tests/unittests/testutils.py @@ -0,0 +1,7 @@ +def primes(n): + """ Returns a list of primes < n """ + sieve = [True] * int(n/2) + for i in xrange(3,int(n**0.5)+1,2): + if sieve[i/2]: + sieve[i*i/2::i] = [False] * ((n-i*i-1)/(2*i)+1) + return [2] + [2*i+1 for i in xrange(1,n/2) if sieve[i]] From 538826a103c603396be35d646d249aabcdb1af78 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Tue, 26 Sep 2017 18:14:54 +0200 Subject: [PATCH 03/28] Add test of linear group fix setUp and tearDown in gamma.py --- tests/unittests/alltest.py | 3 +- tests/unittests/gamma.py | 13 +- tests/unittests/lindep.py | 2 + tests/unittests/linear.py | 1055 ++++++++++++++++++++++++++++++++++++ 4 files changed, 1067 insertions(+), 6 deletions(-) create mode 100644 tests/unittests/linear.py diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 7916a54..c07a2e3 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -19,7 +19,8 @@ 'isprime', 'lambert', 'lex', - 'lindep' + 'lindep', + 'linear' ] suite = unittest.TestSuite() diff --git a/tests/unittests/gamma.py b/tests/unittests/gamma.py index 83e4b0d..6a0e6dd 100644 --- a/tests/unittests/gamma.py +++ b/tests/unittests/gamma.py @@ -62,9 +62,16 @@ class TestGamma(unittest.TestCase): - def test_gamma(self): + + def setUp(self): pari.set_real_precision(38) pari.set_series_precision(6) + + def tearDown(self): + pari.set_real_precision(15) + pari.set_series_precision(16) + + def test_gamma(self): self.assertEquals(str(pari.gamma('2+I+x', precision=127)), '(0.65296549642016672783864624794608469715 + 0.3430658398165453575' + '8873598697831148676*I) + (0.19044897540645184469078131473790885364 + 0.580552467319476' + @@ -122,8 +129,6 @@ def test_gamma(self): '95286760197004854674329979420483457441111886014601499071559796851143') def test_psi(self): - pari.set_real_precision(38) - pari.set_series_precision(6) self.assertEquals(str(pari.psi('2+I+x', precision=127)), '(0.59465032062247697727187848272191072247 + 0.5' + '7667404746858117413405079475000049045*I) + (0.46300009662276378629832651818418579441 -' + ' 0.29423354275931886558301361715690299591*I)*x + (-0.065723534206032414131682728509702' + @@ -153,8 +158,6 @@ def test_psi(self): self.assertEquals(str(pari.psi('x+O(x^2)', precision=127)), '-x^-1 + O(x^0)') def test_lngamma(self): - pari.set_real_precision(38) - pari.set_series_precision(6) self.assertEquals(str(pari.lngamma('2+I+x', precision=127)), '(-0.30434960902188368417660077077485938103 ' + '+ 0.48375784292991511172812918802297918039*I) + (0.59465032062247697727187848272191072' + '247 + 0.57667404746858117413405079475000049045*I)*x + (0.23150004831138189314916325909' + diff --git a/tests/unittests/lindep.py b/tests/unittests/lindep.py index c2968ee..6c5d913 100644 --- a/tests/unittests/lindep.py +++ b/tests/unittests/lindep.py @@ -34,6 +34,8 @@ class TestLindep(unittest.TestCase): + def setUp(self): + pari.set_real_precision(15) def test_lindep(self): self.assertEquals(pari.lindep([pari.sqrt(2), pari.sqrt(3), pari.sqrt(2) + pari.sqrt(3)]), '[-1, -1, 1]~') self.assertEquals(pari.lindep('[1, 2 + 3 + 3^2 + 3^3 + 3^4 + O(3^5)]'), '[1, -2]~') diff --git a/tests/unittests/linear.py b/tests/unittests/linear.py new file mode 100644 index 0000000..9a23cf0 --- /dev/null +++ b/tests/unittests/linear.py @@ -0,0 +1,1055 @@ +# -*- coding: utf-8 -*- +# This file was generated by tests_generator.py +# Generated the 09/25/2017 + +"""Original pari/GP test file linear : +HEAP=[98, if(precision(1.)==38,10174,10354)]; +default(realprecision,38); +\e +algdep(2*cos(2*Pi/13),6) +algdep(2*cos(2*Pi/13),6,15) +charpoly([1,2;3,4],z) +charpoly(Mod(x^2+x+1,x^3+5*x+1),z) +charpoly([1,2;3,4],z,1) +charpoly(Mod(1,8191)*[1,2;3,4],z,2) +lindep(Mod(1,7)*[2,-1;1,3]) +lindep([(1-3*sqrt(2))/(3-2*sqrt(3)),1,sqrt(2),sqrt(3),sqrt(6)]) +lindep([(1-3*sqrt(2))/(3-2*sqrt(3)),1,sqrt(2),sqrt(3),sqrt(6)],14) +matadjoint([1,2;3,4]) +matcompanion(x^5-12*x^3+0.0005) +matdet([1,2,3;1,5,6;9,8,7]) +matdet([1,2,3;1,5,6;9,8,7],1) +matdetint([1,2,3;4,5,6]) +matdiagonal([2,4,6]) +mateigen([1,2,3;4,5,6;7,8,9]) +mathess(mathilbert(7)) +mathilbert(5) +amat=1/mathilbert(7) +mathnf(amat) +mathnf(amat,1) +mathnf(amat,4) +mathnf(amat,5) +mathnfmod(amat,matdetint(amat)) +mathnfmodid(amat,123456789*10^100) +matid(5) +matimage([1,3,5;2,4,6;3,5,7]) +matimage([1,3,5;2,4,6;3,5,7],1) +matimage(Pi*[1,3,5;2,4,6;3,5,7]) +matimagecompl([1,3,5;2,4,6;3,5,7]) +matimagecompl(Pi*[1,3,5;2,4,6;3,5,7]) +matindexrank([1,1,1;1,1,1;1,1,2]) +matintersect([1,2;3,4;5,6],[2,3;7,8;8,9]) +matinverseimage([1,1;2,3;5,7],[2,2,6]~) +matisdiagonal([1,0,0;0,5,0;0,0,0]) +matker(matrix(4,4,x,y,x/y)) +matker(matrix(4,4,x,y,sin(x+y))) +matker(matrix(4,4,x,y,x+y),1) +matkerint(matrix(4,4,x,y,x*y)) +matkerint(matrix(4,4,x,y,x*y),1) +matkerint(matrix(4,6,x,y,2520/(x+y))) +matmuldiagonal(amat,[1,2,3,4,5,6,7]) +matmultodiagonal(amat^-1,%) +matpascal(8) +matrank(matrix(5,5,x,y,x+y)) +matrix(5,5,x,y,gcd(x,y)) +matrixqz([1,3;3,5;5,7],0) +matrixqz([1/3,1/4,1/6;1/2,1/4,-1/4;1/3,1,0],-1) +matrixqz([1,3;3,5;5,7],-2) +matsize([1,2;3,4;5,6]) +matsnf(1/mathilbert(6)) +matsnf(x*matid(5)-matrix(5,5,j,k,1),2) +matsolve(mathilbert(10),[1,2,3,4,5,6,7,8,9,0]~) +matsolvemod([2,3;5,4],[7,11]~,[1,4]~) +matsolvemod([2,3;5,4],[7,11]~,[1,4]~,1) +matsupplement([1,3;2,4;3,6]) +mattranspose(vector(2,x,x)) +%*%~ +norml2(vector(10,x,x)) +qfgaussred(mathilbert(5)) +qfjacobi(mathilbert(6)) +m=1/mathilbert(7) +mp=concat(m,matid(7)) +qflll(m) +qflllgram(m) +qflllgram(m,1) +qflllgram(mp~*mp,4) +qflll(m,1) +qflll(m,2) +qflll(mp,4) +qfminim([2,1;1,2],4,6) +qfperfection([2,0,1;0,2,1;1,1,2]) +qfsign(mathilbert(5)-0.11*matid(5)) +trace(1+I) +trace(Mod(x+5,x^3+x+1)) +Vec(sin(x)) +vecmax([-3,7,-2,11]) +vecmin([-3,7,-2,11]) +concat([1,2],[3,4]) +concat(Mat(vector(4,x,x)~),vector(4,x,10+x)~) +vecextract([1,2,3,4,5,6,7,8,9,10],1000) +vecextract(matrix(15,15,x,y,x+y),vector(5,x,3*x),vector(3,y,3*y)) +round((1.*mathilbert(7))^(-1) << 77) / 2^77 +vecsort([8,7,6,5],,1) +vecsort([[1,5],[2,4],[1,5,1],[1,4,2]]) +vecsort(vector(17,x,5*x%17)) +vecsort([[1,8,5],[2,5,8],[3,6,-6],[4,8,6]],2) +vecsort([[1,8,5],[2,5,8],[3,6,-6],[4,8,6]],[2,1]) +vector(10,x,1/x) +if (getheap()!=HEAP, getheap()) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestLinear(unittest.TestCase): + def setUp(self): + pari.set_real_precision(38) + + def test_algdep(self): + self.assertEquals(pari.algdep(2 * pari.cos('2*Pi/13'), 6), 'x^6 + x^5 - 5*x^4 - 4*x^3 + 6*x^2 + 3*x - 1') + self.assertEquals(pari.algdep(2 * pari.cos('2*Pi/13'), 6, 15), 'x^6 + x^5 - 5*x^4 - 4*x^3 + 6*x^2 + 3*x - 1') + + def test_chapoly(self): + self.assertEquals(pari.charpoly('[1,2;3,4]', 'z'), 'z^2 - 5*z - 2') + self.assertEquals(pari.charpoly(pari.Mod('x^2+x+1', 'x^3+5*x+1'), 'z'), 'z^3 + 7*z^2 + 16*z - 19') + self.assertEquals(pari.charpoly('[1,2;3,4]', 'z', 1), 'z^2 - 5*z - 2') + self.assertEquals(pari.charpoly(pari.Mod(1, 8191) * '[1,2;3,4]', 'z', 2), + 'z^2 + Mod(8186, 8191)*z + Mod(8189, 8191)') + + def test_lindep(self): + self.assertEquals(pari.lindep(pari.Mod(1, 7) * '[2,-1;1,3]'), '[-3, 1]~') + + self.assertEquals(pari.lindep([float(1 - 3 * pari.sqrt(2)) / (3 - 2 * pari.sqrt(3)), 1, pari.sqrt(2), + pari.sqrt(3), pari.sqrt(6)]), '[3, 3, -9, 2, -6]~') + + self.assertEquals(pari.lindep([float(1 - 3 * pari.sqrt(2)) / (3 - 2 * pari.sqrt(3)), 1, pari.sqrt(2), + pari.sqrt(3), pari.sqrt(6)], 14), '[-3, -3, 9, -2, 6]~') + + def test_mathnf(self): + amat = 1 / pari.mathilbert(7) + self.assertEquals(amat, + '[49, -1176, 8820, -29400, 48510, -38808, 12012; -1176, 37632, -317520, 1128960, -1940400' + + ', 1596672, -504504; 8820, -317520, 2857680, -10584000, 18711000, -15717240, 5045040; -29' + + '400, 1128960, -10584000, 40320000, -72765000, 62092800, -20180160; 48510, -1940400, 1871' + + '1000, -72765000, 133402500, -115259760, 37837800; -38808, 1596672, -15717240, 62092800, ' + + '-115259760, 100590336, -33297264; 12012, -504504, 5045040, -20180160, 37837800, -3329726' + + '4, 11099088]') + + self.assertEquals(pari.mathnf(amat), + '[420, 0, 0, 0, 210, 168, 175; 0, 840, 0, 0, 0, 0, 504; 0, 0, 2520, 0, 0, 0, 1260; ' + + '0, 0, 0, 2520, 0, 0, 840; 0, 0, 0, 0, 13860, 0, 6930; 0, 0, 0, 0, 0, 5544, 0; 0, 0' + + ', 0, 0, 0, 0, 12012]') + + self.assertEquals(pari.mathnf(amat, 1), + '[[420, 0, 0, 0, 210, 168, 175; 0, 840, 0, 0, 0, 0, 504; 0, 0, 2520, 0, 0, 0, 1260; 0, 0,' + + ' 0, 2520, 0, 0, 840; 0, 0, 0, 0, 13860, 0, 6930; 0, 0, 0, 0, 0, 5544, 0; 0, 0, 0, 0, 0, ' + + '0, 12012], [420, 420, 840, 630, 2982, 1092, 4159; 210, 280, 630, 504, 2415, 876, 3395; 1' + + '40, 210, 504, 420, 2050, 749, 2901; 105, 168, 420, 360, 1785, 658, 2542; 84, 140, 360, 3' + + '15, 1582, 588, 2266; 70, 120, 315, 280, 1421, 532, 2046; 60, 105, 280, 252, 1290, 486, 1' + + '866]]') + self.assertEquals(pari.mathnf(amat, 4), + '[[420, 0, 0, 0, 210, 168, 175; 0, 840, 0, 0, 0, 0, 504; 0, 0, 2520, 0, 0, 0, 1260; 0, 0, ' + + '0, 2520, 0, 0, 840; 0, 0, 0, 0, 13860, 0, 6930; 0, 0, 0, 0, 0, 5544, 0; 0, 0, 0, 0, 0, 0' + + ', 12012], [420, 420, 840, 630, 2982, 1092, 4159; 210, 280, 630, 504, 2415, 876, 3395; ' + + '140, 210, 504, 420, 2050, 749, 2901; 105, 168, 420, 360, 1785, 658, 2542; 84, 140, 360, ' + + '315, 1582, 588, 2266; 70, 120, 315, 280, 1421, 532, 2046; 60, 105, 280, 252, 1290, 486' + + ', 1866]]') + self.assertEquals(pari.mathnf(amat, 5), + '[[360360, 0, 0, 0, 0, 144144, 300300; 0, 27720, 0, 0, 0, 0, 22176; 0, 0, 27720, 0, 0, 0,' + + ' 6930; 0, 0, 0, 2520, 0, 0, 840; 0, 0, 0, 0, 2520, 0, 1260; 0, 0, 0, 0, 0, 168, 0; 0, 0,' + + ' 0, 0, 0, 0, 7], [51480, 4620, 5544, 630, 840, 20676, 48619; 45045, 3960, 4620, 504, 630' + + ', 18074, 42347; 40040, 3465, 3960, 420, 504, 16058, 37523; 36036, 3080, 3465, 360, 420, ' + + '14448, 33692; 32760, 2772, 3080, 315, 360, 13132, 30574; 30030, 2520, 2772, 280, 315, 12' + + '036, 27986; 27720, 2310, 2520, 252, 280, 11109, 25803], Vecsmall([7, 6, 5, 4, 3, 2, 1])]') + self.assertEquals(pari.mathnfmod(amat, pari.matdetint(amat)), + '[420, 0, 0, 0, 210, 168, 175; 0, 840, 0, 0, 0, 0, 504; 0, 0, 2520, 0, 0, 0, 1260; 0, 0, ' + + '0, 2520, 0, 0, 840; 0, 0, 0, 0, 13860, 0, 6930; 0, 0, 0, 0, 0, 5544, 0; 0, 0, 0, 0, 0, 0' + + ', 12012]') + self.assertEquals(pari.mathnfmodid(amat, '123456789*10^100'), + '[60, 0, 0, 0, 30, 24, 35; 0, 120, 0, 0, 0, 0, 24; 0, 0, 360, 0, 0, 0, 180; 0, 0, 0, 360,' + + ' 0, 0, 240; 0, 0, 0, 0, 180, 0, 90; 0, 0, 0, 0, 0, 72, 0; 0, 0, 0, 0, 0, 0, 12]') + + def test_qflll(self): + m = 1 / pari.mathilbert(7) + self.assertEquals(m, + '[49, -1176, 8820, -29400, 48510, -38808, 12012; -1176, 37632, -317520, 1128960, -1940400' + + ', 1596672, -504504; 8820, -317520, 2857680, -10584000, 18711000, -15717240, 5045040; -29' + + '400, 1128960, -10584000, 40320000, -72765000, 62092800, -20180160; 48510, -1940400, 1871' + + '1000, -72765000, 133402500, -115259760, 37837800; -38808, 1596672, -15717240, 62092800, ' + + '-115259760, 100590336, -33297264; 12012, -504504, 5045040, -20180160, 37837800, -3329726' + + '4, 11099088]') + mp = pari.concat(m, pari.matid(7)) + self.assertEquals(mp, + '[49, -1176, 8820, -29400, 48510, -38808, 12012, 1, 0, 0, 0, 0, 0, 0; -1176, 37632, -3175' + + '20, 1128960, -1940400, 1596672, -504504, 0, 1, 0, 0, 0, 0, 0; 8820, -317520, 2857680, -1' + + '0584000, 18711000, -15717240, 5045040, 0, 0, 1, 0, 0, 0, 0; -29400, 1128960, -10584000, ' + + '40320000, -72765000, 62092800, -20180160, 0, 0, 0, 1, 0, 0, 0; 48510, -1940400, 18711000' + + ', -72765000, 133402500, -115259760, 37837800, 0, 0, 0, 0, 1, 0, 0; -38808, 1596672, -157' + + '17240, 62092800, -115259760, 100590336, -33297264, 0, 0, 0, 0, 0, 1, 0; 12012, -504504, ' + + '5045040, -20180160, 37837800, -33297264, 11099088, 0, 0, 0, 0, 0, 0, 1]') + + self.assertEquals(pari.qflll(m), + '[-420, -420, 840, 630, -1092, 757, 2982; -210, -280, 630, 504, -876, 700, 2415; -140, -2' + + '10, 504, 420, -749, 641, 2050; -105, -168, 420, 360, -658, 589, 1785; -84, -140, 360, 31' + + '5, -588, 544, 1582; -70, -120, 315, 280, -532, 505, 1421; -60, -105, 280, 252, -486, 471' + + ', 1290]') + self.assertEquals(pari.qflllgram(m), + '[1, 1, 27, -27, 69, 0, 141; 0, 1, 4, -23, 34, -24, 49; 0, 1, 3, -22, 18, -24, 23; 0, 1, ' + + '3, -21, 10, -19, 13; 0, 1, 3, -20, 6, -14, 8; 0, 1, 3, -19, 4, -10, 5; 0, 1, 3, -18, 3, ' + + '-7, 3]') + self.assertEquals(pari.qflllgram(m, 1), + '[1, 1, 27, -27, 69, 0, 141; 0, 1, 4, -23, 34, -24, 49; 0, 1, 3, -22, 18, -24, 23; 0, 1, ' + + '3, -21, 10, -19, 13; 0, 1, 3, -20, 6, -14, 8; 0, 1, 3, -19, 4, -10, 5; 0, 1, 3, -18, 3, ' + + '-7, 3]') + self.assertEquals(pari.qflll(m, 1), + '[-420, -420, 840, 630, -1092, 757, 2982; -210, -280, 630, 504, -876, 700, 2415; -140, -2' + + '10, 504, 420, -749, 641, 2050; -105, -168, 420, 360, -658, 589, 1785; -84, -140, 360, 31' + + '5, -588, 544, 1582; -70, -120, 315, 280, -532, 505, 1421; -60, -105, 280, 252, -486, 471' + + ', 1290]') + self.assertEquals(pari.qflll(m, 2), + '[-420, -420, -630, 840, 1092, 2982, -83; -210, -280, -504, 630, 876, 2415, 70; -140, -21' + + '0, -420, 504, 749, 2050, 137; -105, -168, -360, 420, 658, 1785, 169; -84, -140, -315, 36' + + '0, 588, 1582, 184; -70, -120, -280, 315, 532, 1421, 190; -60, -105, -252, 280, 486, 1290' + + ', 191]') + self.assertEquals(pari.qflll(mp, 4), + '[[-420, -420, 840, 630, 2982, -1092, 757; -210, -280, 630, 504, 2415, -876, 700; -140, -' + + '210, 504, 420, 2050, -749, 641; -105, -168, 420, 360, 1785, -658, 589; -84, -140, 360, 3' + + '15, 1582, -588, 544; -70, -120, 315, 280, 1421, -532, 505; -60, -105, 280, 252, 1290, -4' + + '86, 471; 420, 0, 0, 0, -210, 168, 35; 0, 840, 0, 0, 0, 0, 336; 0, 0, -2520, 0, 0, 0, -12' + + '60; 0, 0, 0, -2520, 0, 0, -840; 0, 0, 0, 0, -13860, 0, 6930; 0, 0, 0, 0, 0, 5544, 0; 0, ' + + '0, 0, 0, 0, 0, -12012], [0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; ' + + '0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 1, 0' + + ', 0, 0, 0, 0, 0; 0, 1, 0, 0, 0, 0, 0; 0, 0, 1, 0, 0, 0, 0; 0, 0, 0, 1, 0, 0, 0; 0, 0, 0,' + + ' 0, 1, 0, 0; 0, 0, 0, 0, 0, 1, 0; 0, 0, 0, 0, 0, 0, 1]]') + + def test_linear(self): + # HEAP=[98, if(pari.precision(1.)==38,10174,10354)]; + + self.assertEquals(pari.matadjoint("[1,2;3,4]"), '[4,-2;-3,1]') + + self.assertEquals(pari.matcompanion('x^5-12*x^3+0.0005'), + '[0,0,0,0,-0.00050000000000000000000000000000000000000;1,0,0,0,0;0,1,0,0,0;0,0,1,0' + + ',12;0,0,0,1,0]') + self.assertEquals(pari.matdet('[1,2,3;1,5,6;9,8,7]'), '-30') + self.assertEquals(pari.matdet('[1,2,3;1,5,6;9,8,7]',1), '-30') + self.assertEquals(pari.matdetint('[1,2,3;4,5,6]'), '3') + self.assertEquals(pari.matdiagonal('[2,4,6]'), '[2,0,0;0,4,0;0,0,6]') + self.assertEquals(str(pari.mateigen('[1,2,3;4,5,6;7,8,9]', precision=127)), + '[1, -1.2833494518006402717978106547571267252, 0.2833494518006402717978' + + '1065475712672521; -2, -0.14167472590032013589890532737856336261, 0.6416' + + '7472590032013589890532737856336260; 1, 1, 1]') + self.assertEquals(pari.mathess(pari.mathilbert(7)), + '[1, 90281/58800, -1919947/4344340, 4858466341/1095033030, -77651417539/8196787326, 33868' + + '88964/106615355, 1/2; 1/3, 43/48, 38789/5585580, 268214641/109503303, -581330123627/1264' + + '64718744, 4365450643/274153770, 1/4; 0, 217/2880, 442223/7447440, 53953931/292008808, -3' + + '2242849453/168619624992, 1475457901/1827691800, 1/80; 0, 0, 1604444/264539275, 24208141/' + + '149362505292, 847880210129/47916076768560, -4544407141/103873817300, -29/40920; 0, 0, 0,' + + ' 9773092581/35395807550620, -24363634138919/107305824577186620, 72118203606917/604813510' + + '61158500, 55899/3088554700; 0, 0, 0, 0, 67201501179065/8543442888354179988, -99705564266' + + '29/740828619992676600, -3229/13661312210; 0, 0, 0, 0, 0, -258198800769/9279048099409000,' + + ' -13183/38381527800]') + + self.assertEquals(pari.mathilbert(5), + '[1, 1/2, 1/3, 1/4, 1/5; 1/2, 1/3, 1/4, 1/5, 1/6; 1/3, 1/4, 1/5, 1/6, 1/7; 1/4, 1/5, 1/6,' + + ' 1/7, 1/8; 1/5, 1/6, 1/7, 1/8, 1/9]') + + + self.assertEquals(pari.matid(5), '[1, 0, 0, 0, 0; 0, 1, 0, 0, 0; 0, 0, 1, 0, 0; 0, 0, 0, 1, 0; 0, 0, 0, 0, 1]') + self.assertEquals(pari.matimage('[1,3,5;2,4,6;3,5,7]'), '[1, 3; 2, 4; 3, 5]') + self.assertEquals(pari.matimage('[1,3,5;2,4,6;3,5,7]',1), '[3, 5; 4, 6; 5, 7]') + self.assertEquals(str(pari.matimage('Pi*[1,3,5;2,4,6;3,5,7]')), + '[3.1415926535897932384626433832795028842, 9.4247779607693797153879301498385086526; 6.283' + + '1853071795864769252867665590057684, 12.566370614359172953850573533118011537; 9.424777960' + + '7693797153879301498385086526, 15.707963267948966192313216916397514421]') + self.assertEquals(pari.matimagecompl('[1,3,5;2,4,6;3,5,7]'), 'Vecsmall([3])') + self.assertEquals(pari.matimagecompl('Pi*[1,3,5;2,4,6;3,5,7]'), 'Vecsmall([3])') + self.assertEquals(pari.matindexrank('[1,1,1;1,1,1;1,1,2]'), '[Vecsmall([1, 3]), Vecsmall([1, 3])]') + self.assertEquals(pari.matintersect('[1,2;3,4;5,6]', '[2,3;7,8;8,9]'), '[-1; -1; -1]') + self.assertEquals(pari.matinverseimage('[1,1;2,3;5,7]', '[2,2,6]~'), "[4, -2]~") + self.assertEquals(str(pari.matisdiagonal('[1,0,0;0,5,0;0,0,0]')), '1') + + # self.assertEquals(pari.matker(pari.matrix(4, 4, 'x', 'y', 'x/y')), + # '[-1/2, -1/3, -1/4; 1, 0, 0; 0, 1, 0; 0, 0, 1]') + # + # self.assertEquals(pari.matker(pari.matrix(4, 4, 'x', 'y', pari.sin('x+y'))), + # '[1.0000000000000000000000000000000000000, 1.0806046117362794348018732148859532075; -1.08' + + # '06046117362794348018732148859532075, -0.16770632690571522600486354099847562047; 1, 0; 0,' + + # ' 1]') + # + # self.assertEquals(pari.matker(pari.matrix(4, 4, 'x', 'y', 'x+y'), 1), '[ 1, 2; -2, -3; 1, 0; 0, 1]') + # + # self.assertEquals(pari.matkerint(pari.matrix(4, 4, 'x', 'y', 'x*y')), + # '[ 1, -1, -1; 0, -1, 1; 1, 1, 1; -1, 0, -1]') + # + # self.assertEquals(pari.matkerint(pari.matrix(4, 4, 'x', 'y', 'x*y'), 1), + # '[ 1, -1, -1; 0, -1, 1; 1, 1, 1; -1, 0, -1]') + # + # self.assertEquals(pari.matkerint(pari.matrix(4, 6, 'x', 'y', '2520/(x+y)')), + # '[ -3, -1; 30, 15; -70, -70; 0, 140; 126, -126; -84, 42]') + amat = 1 / pari.mathilbert(7) + self.assertEquals(pari.matmuldiagonal(amat, [1, 2, 3, 4, 5, 6, 7]), + '[49, -2352, 26460, -117600, 242550, -232848, 84084; -1176, 75264, -952560, 4515840, -970' + + '2000, 9580032, -3531528; 8820, -635040, 8573040, -42336000, 93555000, -94303440, 3531528' + + '0; -29400, 2257920, -31752000, 161280000, -363825000, 372556800, -141261120; 48510, -388' + + '0800, 56133000, -291060000, 667012500, -691558560, 264864600; -38808, 3193344, -47151720' + + ', 248371200, -576298800, 603542016, -233080848; 12012, -1009008, 15135120, -80720640, 18' + + '9189000, -199783584, 77693616]') + # self.assertEquals(pari.matmultodiagonal(pow(amat, -1), '%'), + # '[1, 0, 0, 0, 0, 0, 0; 0, 2, 0, 0, 0, 0, 0; 0, 0, 3, 0, 0, 0, 0; 0, 0, 0, 4, 0, 0, 0; 0, ' + + # '0, 0, 0, 5, 0, 0; 0, 0, 0, 0, 0, 6, 0; 0, 0, 0, 0, 0, 0, 7]') + self.assertEquals(pari.matpascal(8), + '[1, 0, 0, 0, 0, 0, 0, 0, 0; 1, 1, 0, 0, 0, 0, 0, 0, 0; 1, 2, 1, 0, 0, 0, 0, 0, 0; 1, 3, ' + + '3, 1, 0, 0, 0, 0, 0; 1, 4, 6, 4, 1, 0, 0, 0, 0; 1, 5, 10, 10, 5, 1, 0, 0, 0; 1, 6, 15, 2' + + '0, 15, 6, 1, 0, 0; 1, 7, 21, 35, 35, 21, 7, 1, 0; 1, 8, 28, 56, 70, 56, 28, 8, 1]') + # self.assertEquals(pari.matrank(pari.matrix(5,5,x,y,x+y)) + # self.assertEquals(pari.matrix(5,5,x,y,pari.gcd(x,y)) + # self.assertEquals(pari.matrixqz([1,3;3,5;5,7],0) + # self.assertEquals(pari.matrixqz([1/3,1/4,1/6;1/2,1/4,-1/4;1/3,1,0],-1) + # self.assertEquals(pari.matrixqz([1,3;3,5;5,7],-2) + self.assertEquals(pari.matsize('[1,2;3,4;5,6]'), '[3, 2]') + self.assertEquals(pari.matsnf(1/pari.mathilbert(6)), '[27720, 2520, 2520, 840, 210, 6]') + self.assertEquals(pari.matsnf('x*matid(5)-matrix(5,5,j,k,1)', 2), '[x^2 - 5*x, x, x, x, 1]') + self.assertEquals(pari.matsolve(pari.mathilbert(10), '[1,2,3,4,5,6,7,8,9,0]~'), + '[9236800, -831303990, 18288515520, -170691240720, 832112321040, -2329894066500, 38831' + + '23564320, -3803844432960, 2020775945760, -449057772020]~') + self.assertEquals(pari.matsolvemod('[2,3;5,4]', '[7,11]~', '[1,4]~'), '[-5, -1]~') + self.assertEquals(pari.matsolvemod('[2,3;5,4]', '[7,11]~', '[1,4]~', 1), '[[-5, -1]~, [4, 9; -5, 8]]') + self.assertEquals(pari.matsupplement('[1,3;2,4;3,6]'), '[1, 3, 0; 2, 4, 0; 3, 6, 1]') + # self.assertEquals(pari.mattranspose(pari.vector(2, 'x', 'x')), '[1, 2]~') + # + # self.assertEquals(pari.norml2(pari.vector(10,'x','x')), '385') + self.assertEquals(pari.qfgaussred(pari.mathilbert(5)), + '[1, 1/2, 1/3, 1/4, 1/5; 0, 1/12, 1, 9/10, 4/5; 0, 0, 1/180, 3/2, 12/7; 0, 0, 0, 1/2800, ' + + '2; 0, 0, 0, 0, 1/44100]') + self.assertEquals(str(pari.qfjacobi(pari.mathilbert(6), precision=127)), + '[[1.0827994845655497685388772372251778091 E-7, 1.2570757122625194922982397996498755378 E' + + '-5, 0.00061574835418265769764919938428527140434, 0.0163215213198758221243450795641915058' + + '90, 0.24236087057520955213572841585070114077, 1.6188998589243390969705881471257800713]~,' + + ' [-0.0012481940840821751169398163046387836342, 0.011144320930724710530678340374220998345' + + ', -0.062226588150197681775152126611810492941, 0.24032536934252330399154228873240534569, ' + + '-0.61454482829258676899320019644273870646, 0.74871921887909485900280109200517845109; 0.0' + + '35606642944287635266122848131812051370, -0.17973275724076003758776897803740640779, 0.490' + + '83920971092436297498316169060045043, -0.69765137527737012296208335046678265583, 0.211082' + + '48167867048675227675845247769095, 0.44071750324351206127160083580231701802; -0.240679079' + + '58842295837736719558855680218, 0.60421220675295973004426567844103061740, -0.535476921621' + + '07486593474491750949545605, -0.23138937333290388042251363554209048307, 0.365893607303026' + + '14149086554211117169623, 0.32069686982225190106359024326699463107; 0.6254603865492272445' + + '7753441039459331707, -0.44357471627623954554460416705180104473, -0.417037692218978868404' + + '94514780771076351, 0.13286315850933553530333839628101576048, 0.3947067760950175678309463' + + '6145991581709, 0.25431138634047419251788312792590944672; -0.6898071992938366841980173800' + + '6926828754, -0.44153664101228966222143649752977204448, 0.0470340189331156497056145184665' + + '41245344, 0.36271492146487147525299457604461742112, 0.3881904338738864286311144882599241' + + '8974, 0.21153084007896524664213667673977991960; 0.27160545336631286930015536176213646338' + + ', 0.45911481681642960284551392793050867151, 0.54068156310385293880022293448123781988, 0.' + + '50276286675751538489260566368647786274, 0.37069590776736280861775501084807394603, 0.1814' + + '4297664876947372217005457727093716]]') + + self.assertEquals(pari.qfminim('[2,1;1,2]', 4, 6), '[6, 2, [0, 1, 1; 1, -1, 0]]') + self.assertEquals(pari.qfperfection('[2,0,1;0,2,1;1,1,2]'), '6') + self.assertEquals(pari.qfsign(pari.mathilbert(5) - 0.11 * pari.matid(5)), '[2, 3]') + self.assertEquals(pari.trace('1+I'), '2') + self.assertEquals(pari.trace(pari.Mod('x+5','x^3+x+1')), '15') + self.assertEquals(pari.Vec(pari.sin('x')), + '[1, 0, -1/6, 0, 1/120, 0, -1/5040, 0, 1/362880, 0, -1/39916800, 0, 1/6227020800, 0, -1/1' + + '307674368000, 0]') + self.assertEquals(pari('[-3,7,-2,11]').vecmax(), '11') + self.assertEquals(pari('[-3,7,-2,11]').vecmin(), '-3') + self.assertEquals(pari.concat([1, 2], [3, 4]), '[1, 2, 3, 4]') + # self.assertEquals(pari.concat(pari.Mat(pari.vector(4,x,x)~),pari.vector(4,x,10+x)~) + self.assertEquals(pari.vecextract([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1000), '[4, 6, 7, 8, 9, 10]') + # self.assertEquals(pari.vecextract(pari.matrix(15,15,x,y,x+y),pari.vector(5,x,3*x),pari.vector(3,y,3*y)) + # round((1.*pari.mathilbert(7))^(-1) << 77) / 2^77 + self.assertEquals(pari.vecsort([8, 7, 6, 5], None, 1), 'Vecsmall([4, 3, 2, 1])') + self.assertEquals(pari.vecsort([[1, 5], [2, 4], [1, 5, 1], [1, 4, 2]]), + '[[1, 4, 2], [1, 5], [1, 5, 1], [2, 4]]') + # self.assertEquals(pari.vecsort(pari.vector(17,x,5*x%17)) + self.assertEquals(pari.vecsort([[1, 8, 5], [2, 5, 8], [3, 6, -6], [4, 8, 6]], 2), + '[[2, 5, 8], [3, 6, -6], [1, 8, 5], [4, 8, 6]]') + self.assertEquals(pari.vecsort([[1, 8, 5], [2, 5, 8], [3, 6, -6], [4, 8, 6]], [2, 1]), + '[[2, 5, 8], [3, 6, -6], [1, 8, 5], [4, 8, 6]]') + # self.assertEquals(pari.vector(10,x,1/x) + # if (pari.getheap()!=HEAP, pari.getheap()) + +"""**** Original expected results **** + + echo = 1 (on) +? algdep(2*cos(2*Pi/13),6) +x^6 + x^5 - 5*x^4 - 4*x^3 + 6*x^2 + 3*x - 1 +? algdep(2*cos(2*Pi/13),6,15) +x^6 + x^5 - 5*x^4 - 4*x^3 + 6*x^2 + 3*x - 1 +? charpoly([1,2;3,4],z) +z^2 - 5*z - 2 +? charpoly(Mod(x^2+x+1,x^3+5*x+1),z) +z^3 + 7*z^2 + 16*z - 19 +? charpoly([1,2;3,4],z,1) +z^2 - 5*z - 2 +? charpoly(Mod(1,8191)*[1,2;3,4],z,2) +z^2 + Mod(8186, 8191)*z + Mod(8189, 8191) +? lindep(Mod(1,7)*[2,-1;1,3]) +[-3, 1]~ +? lindep([(1-3*sqrt(2))/(3-2*sqrt(3)),1,sqrt(2),sqrt(3),sqrt(6)]) +[3, 3, -9, 2, -6]~ +? lindep([(1-3*sqrt(2))/(3-2*sqrt(3)),1,sqrt(2),sqrt(3),sqrt(6)],14) +[-3, -3, 9, -2, 6]~ +? matadjoint([1,2;3,4]) + +[ 4 -2] + +[-3 1] + +? matcompanion(x^5-12*x^3+0.0005) + +[0 0 0 0 -0.00050000000000000000000000000000000000000] + +[1 0 0 0 0] + +[0 1 0 0 0] + +[0 0 1 0 12] + +[0 0 0 1 0] + +? matdet([1,2,3;1,5,6;9,8,7]) +-30 +? matdet([1,2,3;1,5,6;9,8,7],1) +-30 +? matdetint([1,2,3;4,5,6]) +3 +? matdiagonal([2,4,6]) + +[2 0 0] + +[0 4 0] + +[0 0 6] + +? mateigen([1,2,3;4,5,6;7,8,9]) + +[1 -1.2833494518006402717978106547571267252 0.283349451800640271797810654757 +12672521] + +[-2 -0.14167472590032013589890532737856336261 0.6416747259003201358989053273 +7856336260] + +[1 1 1] + +? mathess(mathilbert(7)) + +[1 90281/58800 -1919947/4344340 4858466341/1095033030 -77651417539/819678732 +6 3386888964/106615355 1/2] + +[1/3 43/48 38789/5585580 268214641/109503303 -581330123627/126464718744 4365 +450643/274153770 1/4] + +[0 217/2880 442223/7447440 53953931/292008808 -32242849453/168619624992 1475 +457901/1827691800 1/80] + +[0 0 1604444/264539275 24208141/149362505292 847880210129/47916076768560 -45 +44407141/103873817300 -29/40920] + +[0 0 0 9773092581/35395807550620 -24363634138919/107305824577186620 72118203 +606917/60481351061158500 55899/3088554700] + +[0 0 0 0 67201501179065/8543442888354179988 -9970556426629/74082861999267660 +0 -3229/13661312210] + +[0 0 0 0 0 -258198800769/9279048099409000 -13183/38381527800] + +? mathilbert(5) + +[ 1 1/2 1/3 1/4 1/5] + +[1/2 1/3 1/4 1/5 1/6] + +[1/3 1/4 1/5 1/6 1/7] + +[1/4 1/5 1/6 1/7 1/8] + +[1/5 1/6 1/7 1/8 1/9] + +? amat=1/mathilbert(7) + +[ 49 -1176 8820 -29400 48510 -38808 12012] + +[ -1176 37632 -317520 1128960 -1940400 1596672 -504504] + +[ 8820 -317520 2857680 -10584000 18711000 -15717240 5045040] + +[-29400 1128960 -10584000 40320000 -72765000 62092800 -20180160] + +[ 48510 -1940400 18711000 -72765000 133402500 -115259760 37837800] + +[-38808 1596672 -15717240 62092800 -115259760 100590336 -33297264] + +[ 12012 -504504 5045040 -20180160 37837800 -33297264 11099088] + +? mathnf(amat) + +[420 0 0 0 210 168 175] + +[ 0 840 0 0 0 0 504] + +[ 0 0 2520 0 0 0 1260] + +[ 0 0 0 2520 0 0 840] + +[ 0 0 0 0 13860 0 6930] + +[ 0 0 0 0 0 5544 0] + +[ 0 0 0 0 0 0 12012] + +? mathnf(amat,1) +[[420, 0, 0, 0, 210, 168, 175; 0, 840, 0, 0, 0, 0, 504; 0, 0, 2520, 0, 0, 0, + 1260; 0, 0, 0, 2520, 0, 0, 840; 0, 0, 0, 0, 13860, 0, 6930; 0, 0, 0, 0, 0, +5544, 0; 0, 0, 0, 0, 0, 0, 12012], [420, 420, 840, 630, 2982, 1092, 4159; 21 +0, 280, 630, 504, 2415, 876, 3395; 140, 210, 504, 420, 2050, 749, 2901; 105, + 168, 420, 360, 1785, 658, 2542; 84, 140, 360, 315, 1582, 588, 2266; 70, 120 +, 315, 280, 1421, 532, 2046; 60, 105, 280, 252, 1290, 486, 1866]] +? mathnf(amat,4) +[[420, 0, 0, 0, 210, 168, 175; 0, 840, 0, 0, 0, 0, 504; 0, 0, 2520, 0, 0, 0, + 1260; 0, 0, 0, 2520, 0, 0, 840; 0, 0, 0, 0, 13860, 0, 6930; 0, 0, 0, 0, 0, +5544, 0; 0, 0, 0, 0, 0, 0, 12012], [420, 420, 840, 630, 2982, 1092, 4159; 21 +0, 280, 630, 504, 2415, 876, 3395; 140, 210, 504, 420, 2050, 749, 2901; 105, + 168, 420, 360, 1785, 658, 2542; 84, 140, 360, 315, 1582, 588, 2266; 70, 120 +, 315, 280, 1421, 532, 2046; 60, 105, 280, 252, 1290, 486, 1866]] +? mathnf(amat,5) +[[360360, 0, 0, 0, 0, 144144, 300300; 0, 27720, 0, 0, 0, 0, 22176; 0, 0, 277 +20, 0, 0, 0, 6930; 0, 0, 0, 2520, 0, 0, 840; 0, 0, 0, 0, 2520, 0, 1260; 0, 0 +, 0, 0, 0, 168, 0; 0, 0, 0, 0, 0, 0, 7], [51480, 4620, 5544, 630, 840, 20676 +, 48619; 45045, 3960, 4620, 504, 630, 18074, 42347; 40040, 3465, 3960, 420, +504, 16058, 37523; 36036, 3080, 3465, 360, 420, 14448, 33692; 32760, 2772, 3 +080, 315, 360, 13132, 30574; 30030, 2520, 2772, 280, 315, 12036, 27986; 2772 +0, 2310, 2520, 252, 280, 11109, 25803], Vecsmall([7, 6, 5, 4, 3, 2, 1])] +? mathnfmod(amat,matdetint(amat)) + +[420 0 0 0 210 168 175] + +[ 0 840 0 0 0 0 504] + +[ 0 0 2520 0 0 0 1260] + +[ 0 0 0 2520 0 0 840] + +[ 0 0 0 0 13860 0 6930] + +[ 0 0 0 0 0 5544 0] + +[ 0 0 0 0 0 0 12012] + +? mathnfmodid(amat,123456789*10^100) + +[60 0 0 0 30 24 35] + +[ 0 120 0 0 0 0 24] + +[ 0 0 360 0 0 0 180] + +[ 0 0 0 360 0 0 240] + +[ 0 0 0 0 180 0 90] + +[ 0 0 0 0 0 72 0] + +[ 0 0 0 0 0 0 12] + +? matid(5) + +[1 0 0 0 0] + +[0 1 0 0 0] + +[0 0 1 0 0] + +[0 0 0 1 0] + +[0 0 0 0 1] + +? matimage([1,3,5;2,4,6;3,5,7]) + +[1 3] + +[2 4] + +[3 5] + +? matimage([1,3,5;2,4,6;3,5,7],1) + +[3 5] + +[4 6] + +[5 7] + +? matimage(Pi*[1,3,5;2,4,6;3,5,7]) + +[3.1415926535897932384626433832795028842 9.424777960769379715387930149838508 +6526] + +[6.2831853071795864769252867665590057684 12.56637061435917295385057353311801 +1537] + +[9.4247779607693797153879301498385086526 15.70796326794896619231321691639751 +4421] + +? matimagecompl([1,3,5;2,4,6;3,5,7]) +Vecsmall([3]) +? matimagecompl(Pi*[1,3,5;2,4,6;3,5,7]) +Vecsmall([3]) +? matindexrank([1,1,1;1,1,1;1,1,2]) +[Vecsmall([1, 3]), Vecsmall([1, 3])] +? matintersect([1,2;3,4;5,6],[2,3;7,8;8,9]) + +[-1] + +[-1] + +[-1] + +? matinverseimage([1,1;2,3;5,7],[2,2,6]~) +[4, -2]~ +? matisdiagonal([1,0,0;0,5,0;0,0,0]) +1 +? matker(matrix(4,4,x,y,x/y)) + +[-1/2 -1/3 -1/4] + +[ 1 0 0] + +[ 0 1 0] + +[ 0 0 1] + +? matker(matrix(4,4,x,y,sin(x+y))) + +[1.0000000000000000000000000000000000000 1.080604611736279434801873214885953 +2075] + +[-1.0806046117362794348018732148859532075 -0.1677063269057152260048635409984 +7562047] + +[1 0] + +[0 1] + +? matker(matrix(4,4,x,y,x+y),1) + +[ 1 2] + +[-2 -3] + +[ 1 0] + +[ 0 1] + +? matkerint(matrix(4,4,x,y,x*y)) + +[ 1 -1 -1] + +[ 0 -1 1] + +[ 1 1 1] + +[-1 0 -1] + +? matkerint(matrix(4,4,x,y,x*y),1) + +[ 1 -1 -1] + +[ 0 -1 1] + +[ 1 1 1] + +[-1 0 -1] + +? matkerint(matrix(4,6,x,y,2520/(x+y))) + +[ -3 -1] + +[ 30 15] + +[-70 -70] + +[ 0 140] + +[126 -126] + +[-84 42] + +? matmuldiagonal(amat,[1,2,3,4,5,6,7]) + +[ 49 -2352 26460 -117600 242550 -232848 84084] + +[ -1176 75264 -952560 4515840 -9702000 9580032 -3531528] + +[ 8820 -635040 8573040 -42336000 93555000 -94303440 35315280] + +[-29400 2257920 -31752000 161280000 -363825000 372556800 -141261120] + +[ 48510 -3880800 56133000 -291060000 667012500 -691558560 264864600] + +[-38808 3193344 -47151720 248371200 -576298800 603542016 -233080848] + +[ 12012 -1009008 15135120 -80720640 189189000 -199783584 77693616] + +? matmultodiagonal(amat^-1,%) + +[1 0 0 0 0 0 0] + +[0 2 0 0 0 0 0] + +[0 0 3 0 0 0 0] + +[0 0 0 4 0 0 0] + +[0 0 0 0 5 0 0] + +[0 0 0 0 0 6 0] + +[0 0 0 0 0 0 7] + +? matpascal(8) + +[1 0 0 0 0 0 0 0 0] + +[1 1 0 0 0 0 0 0 0] + +[1 2 1 0 0 0 0 0 0] + +[1 3 3 1 0 0 0 0 0] + +[1 4 6 4 1 0 0 0 0] + +[1 5 10 10 5 1 0 0 0] + +[1 6 15 20 15 6 1 0 0] + +[1 7 21 35 35 21 7 1 0] + +[1 8 28 56 70 56 28 8 1] + +? matrank(matrix(5,5,x,y,x+y)) +2 +? matrix(5,5,x,y,gcd(x,y)) + +[1 1 1 1 1] + +[1 2 1 2 1] + +[1 1 3 1 1] + +[1 2 1 4 1] + +[1 1 1 1 5] + +? matrixqz([1,3;3,5;5,7],0) + +[1 1] + +[3 2] + +[5 3] + +? matrixqz([1/3,1/4,1/6;1/2,1/4,-1/4;1/3,1,0],-1) + +[19 12 2] + +[ 0 1 0] + +[ 0 0 1] + +? matrixqz([1,3;3,5;5,7],-2) + +[2 -1] + +[1 0] + +[0 1] + +? matsize([1,2;3,4;5,6]) +[3, 2] +? matsnf(1/mathilbert(6)) +[27720, 2520, 2520, 840, 210, 6] +? matsnf(x*matid(5)-matrix(5,5,j,k,1),2) +[x^2 - 5*x, x, x, x, 1] +? matsolve(mathilbert(10),[1,2,3,4,5,6,7,8,9,0]~) +[9236800, -831303990, 18288515520, -170691240720, 832112321040, -23298940665 +00, 3883123564320, -3803844432960, 2020775945760, -449057772020]~ +? matsolvemod([2,3;5,4],[7,11]~,[1,4]~) +[-5, -1]~ +? matsolvemod([2,3;5,4],[7,11]~,[1,4]~,1) +[[-5, -1]~, [4, 9; -5, 8]] +? matsupplement([1,3;2,4;3,6]) + +[1 3 0] + +[2 4 0] + +[3 6 1] + +? mattranspose(vector(2,x,x)) +[1, 2]~ +? %*%~ + +[1 2] + +[2 4] + +? norml2(vector(10,x,x)) +385 +? qfgaussred(mathilbert(5)) + +[1 1/2 1/3 1/4 1/5] + +[0 1/12 1 9/10 4/5] + +[0 0 1/180 3/2 12/7] + +[0 0 0 1/2800 2] + +[0 0 0 0 1/44100] + +? qfjacobi(mathilbert(6)) +[[1.0827994845655497685388772372251778091 E-7, 1.257075712262519492298239799 +6498755378 E-5, 0.00061574835418265769764919938428527140434, 0.0163215213198 +75822124345079564191505890, 0.24236087057520955213572841585070114077, 1.6188 +998589243390969705881471257800713]~, [-0.00124819408408217511693981630463878 +36342, 0.011144320930724710530678340374220998345, -0.06222658815019768177515 +2126611810492941, 0.24032536934252330399154228873240534569, -0.6145448282925 +8676899320019644273870646, 0.74871921887909485900280109200517845109; 0.03560 +6642944287635266122848131812051370, -0.1797327572407600375877689780374064077 +9, 0.49083920971092436297498316169060045043, -0.6976513752773701229620833504 +6678265583, 0.21108248167867048675227675845247769095, 0.44071750324351206127 +160083580231701802; -0.24067907958842295837736719558855680218, 0.60421220675 +295973004426567844103061740, -0.53547692162107486593474491750949545605, -0.2 +3138937333290388042251363554209048307, 0.36589360730302614149086554211117169 +623, 0.32069686982225190106359024326699463107; 0.625460386549227244577534410 +39459331707, -0.44357471627623954554460416705180104473, -0.41703769221897886 +840494514780771076351, 0.13286315850933553530333839628101576048, 0.394706776 +09501756783094636145991581709, 0.25431138634047419251788312792590944672; -0. +68980719929383668419801738006926828754, -0.441536641012289662221436497529772 +04448, 0.047034018933115649705614518466541245344, 0.362714921464871475252994 +57604461742112, 0.38819043387388642863111448825992418974, 0.2115308400789652 +4664213667673977991960; 0.27160545336631286930015536176213646338, 0.45911481 +681642960284551392793050867151, 0.54068156310385293880022293448123781988, 0. +50276286675751538489260566368647786274, 0.3706959077673628086177550108480739 +4603, 0.18144297664876947372217005457727093716]] +? m=1/mathilbert(7) + +[ 49 -1176 8820 -29400 48510 -38808 12012] + +[ -1176 37632 -317520 1128960 -1940400 1596672 -504504] + +[ 8820 -317520 2857680 -10584000 18711000 -15717240 5045040] + +[-29400 1128960 -10584000 40320000 -72765000 62092800 -20180160] + +[ 48510 -1940400 18711000 -72765000 133402500 -115259760 37837800] + +[-38808 1596672 -15717240 62092800 -115259760 100590336 -33297264] + +[ 12012 -504504 5045040 -20180160 37837800 -33297264 11099088] + +? mp=concat(m,matid(7)) + +[49 -1176 8820 -29400 48510 -38808 12012 1 0 0 0 0 0 0] + +[-1176 37632 -317520 1128960 -1940400 1596672 -504504 0 1 0 0 0 0 0] + +[8820 -317520 2857680 -10584000 18711000 -15717240 5045040 0 0 1 0 0 0 0] + +[-29400 1128960 -10584000 40320000 -72765000 62092800 -20180160 0 0 0 1 0 0 +0] + +[48510 -1940400 18711000 -72765000 133402500 -115259760 37837800 0 0 0 0 1 0 + 0] + +[-38808 1596672 -15717240 62092800 -115259760 100590336 -33297264 0 0 0 0 0 +1 0] + +[12012 -504504 5045040 -20180160 37837800 -33297264 11099088 0 0 0 0 0 0 1] + +? qflll(m) + +[-420 -420 840 630 -1092 757 2982] + +[-210 -280 630 504 -876 700 2415] + +[-140 -210 504 420 -749 641 2050] + +[-105 -168 420 360 -658 589 1785] + +[ -84 -140 360 315 -588 544 1582] + +[ -70 -120 315 280 -532 505 1421] + +[ -60 -105 280 252 -486 471 1290] + +? qflllgram(m) + +[1 1 27 -27 69 0 141] + +[0 1 4 -23 34 -24 49] + +[0 1 3 -22 18 -24 23] + +[0 1 3 -21 10 -19 13] + +[0 1 3 -20 6 -14 8] + +[0 1 3 -19 4 -10 5] + +[0 1 3 -18 3 -7 3] + +? qflllgram(m,1) + +[1 1 27 -27 69 0 141] + +[0 1 4 -23 34 -24 49] + +[0 1 3 -22 18 -24 23] + +[0 1 3 -21 10 -19 13] + +[0 1 3 -20 6 -14 8] + +[0 1 3 -19 4 -10 5] + +[0 1 3 -18 3 -7 3] + +? qflllgram(mp~*mp,4) +[[-420, -420, 840, 630, 2982, -1092, 757; -210, -280, 630, 504, 2415, -876, +700; -140, -210, 504, 420, 2050, -749, 641; -105, -168, 420, 360, 1785, -658 +, 589; -84, -140, 360, 315, 1582, -588, 544; -70, -120, 315, 280, 1421, -532 +, 505; -60, -105, 280, 252, 1290, -486, 471; 420, 0, 0, 0, -210, 168, 35; 0, + 840, 0, 0, 0, 0, 336; 0, 0, -2520, 0, 0, 0, -1260; 0, 0, 0, -2520, 0, 0, -8 +40; 0, 0, 0, 0, -13860, 0, 6930; 0, 0, 0, 0, 0, 5544, 0; 0, 0, 0, 0, 0, 0, - +12012], [0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0 +, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, + 0; 1, 0, 0, 0, 0, 0, 0; 0, 1, 0, 0, 0, 0, 0; 0, 0, 1, 0, 0, 0, 0; 0, 0, 0, +1, 0, 0, 0; 0, 0, 0, 0, 1, 0, 0; 0, 0, 0, 0, 0, 1, 0; 0, 0, 0, 0, 0, 0, 1]] +? qflll(m,1) + +[-420 -420 840 630 -1092 757 2982] + +[-210 -280 630 504 -876 700 2415] + +[-140 -210 504 420 -749 641 2050] + +[-105 -168 420 360 -658 589 1785] + +[ -84 -140 360 315 -588 544 1582] + +[ -70 -120 315 280 -532 505 1421] + +[ -60 -105 280 252 -486 471 1290] + +? qflll(m,2) + +[-420 -420 -630 840 1092 2982 -83] + +[-210 -280 -504 630 876 2415 70] + +[-140 -210 -420 504 749 2050 137] + +[-105 -168 -360 420 658 1785 169] + +[ -84 -140 -315 360 588 1582 184] + +[ -70 -120 -280 315 532 1421 190] + +[ -60 -105 -252 280 486 1290 191] + +? qflll(mp,4) +[[-420, -420, 840, 630, 2982, -1092, 757; -210, -280, 630, 504, 2415, -876, +700; -140, -210, 504, 420, 2050, -749, 641; -105, -168, 420, 360, 1785, -658 +, 589; -84, -140, 360, 315, 1582, -588, 544; -70, -120, 315, 280, 1421, -532 +, 505; -60, -105, 280, 252, 1290, -486, 471; 420, 0, 0, 0, -210, 168, 35; 0, + 840, 0, 0, 0, 0, 336; 0, 0, -2520, 0, 0, 0, -1260; 0, 0, 0, -2520, 0, 0, -8 +40; 0, 0, 0, 0, -13860, 0, 6930; 0, 0, 0, 0, 0, 5544, 0; 0, 0, 0, 0, 0, 0, - +12012], [0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0 +, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, 0; 0, 0, 0, 0, 0, 0, + 0; 1, 0, 0, 0, 0, 0, 0; 0, 1, 0, 0, 0, 0, 0; 0, 0, 1, 0, 0, 0, 0; 0, 0, 0, +1, 0, 0, 0; 0, 0, 0, 0, 1, 0, 0; 0, 0, 0, 0, 0, 1, 0; 0, 0, 0, 0, 0, 0, 1]] +? qfminim([2,1;1,2],4,6) +[6, 2, [0, 1, 1; 1, -1, 0]] +? qfperfection([2,0,1;0,2,1;1,1,2]) +6 +? qfsign(mathilbert(5)-0.11*matid(5)) +[2, 3] +? trace(1+I) +2 +? trace(Mod(x+5,x^3+x+1)) +15 +? Vec(sin(x)) +[1, 0, -1/6, 0, 1/120, 0, -1/5040, 0, 1/362880, 0, -1/39916800, 0, 1/6227020 +800, 0, -1/1307674368000, 0] +? vecmax([-3,7,-2,11]) +11 +? vecmin([-3,7,-2,11]) +-3 +? concat([1,2],[3,4]) +[1, 2, 3, 4] +? concat(Mat(vector(4,x,x)~),vector(4,x,10+x)~) + +[1 11] + +[2 12] + +[3 13] + +[4 14] + +? vecextract([1,2,3,4,5,6,7,8,9,10],1000) +[4, 6, 7, 8, 9, 10] +? vecextract(matrix(15,15,x,y,x+y),vector(5,x,3*x),vector(3,y,3*y)) + +[ 6 9 12] + +[ 9 12 15] + +[12 15 18] + +[15 18 21] + +[18 21 24] + +? round((1.*mathilbert(7))^(-1)<<77)/2^77 + +[49 -1176 8820 -29400 48510 -38808 12012] + +[-1176 37632 -317520 1128960 -1940400 1596672 -504504] + +[8820 -317520 2857680 -10584000 18711000 -15717240 5045040] + +[-29400 1128960 -10584000 6092986130857731040519127040001/151115727451828646 +838272 -10995935908032311487186862080001/151115727451828646838272 9383198641 +520905802399455641601/151115727451828646838272 -20180160] + +[48510 -1940400 18711000 -10995935908032311487186862080001/15111572745182864 +6838272 10079607915696285529921290240001/75557863725914323419136 -8708781239 +161590697851994767361/75557863725914323419136 37837800] + +[-38808 1596672 -15717240 9383198641520905802399455641601/151115727451828646 +838272 -8708781239161590697851994767361/75557863725914323419136 152007817992 +63867399887118139393/151115727451828646838272 -33297264] + +[12012 -504504 5045040 -20180160 37837800 -33297264 11099088] + +? vecsort([8,7,6,5],,1) +Vecsmall([4, 3, 2, 1]) +? vecsort([[1,5],[2,4],[1,5,1],[1,4,2]]) +[[1, 4, 2], [1, 5], [1, 5, 1], [2, 4]] +? vecsort(vector(17,x,5*x%17)) +[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] +? vecsort([[1,8,5],[2,5,8],[3,6,-6],[4,8,6]],2) +[[2, 5, 8], [3, 6, -6], [1, 8, 5], [4, 8, 6]] +? vecsort([[1,8,5],[2,5,8],[3,6,-6],[4,8,6]],[2,1]) +[[2, 5, 8], [3, 6, -6], [1, 8, 5], [4, 8, 6]] +? vector(10,x,1/x) +[1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10] +? if(getheap()!=HEAP,getheap()) + +""" From 090cd5ec357a54192f2bac958c0335e6084c71d7 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Fri, 29 Sep 2017 14:17:05 +0200 Subject: [PATCH 04/28] Add tests for several files 'list', 'log', 'mathnf', 'contfrac', 'minim', 'minmax','modfun','modular', 'nfrootsof1', 'nfsplitting', 'norm' --- tests/unittests/alltest.py | 13 +- tests/unittests/contfrac.py | 185 +++++++++++++++++++++ tests/unittests/list.py | 157 ++++++++++++++++++ tests/unittests/log.py | 37 +++++ tests/unittests/mathnf.py | 127 ++++++++++++++ tests/unittests/minim.py | 100 +++++++++++ tests/unittests/minmax.py | 42 +++++ tests/unittests/modfun.py | 60 +++++++ tests/unittests/modular.py | 292 +++++++++++++++++++++++++++++++++ tests/unittests/nfrootsof1.py | 54 ++++++ tests/unittests/nfsplitting.py | 136 +++++++++++++++ tests/unittests/norm.py | 139 ++++++++++++++++ 12 files changed, 1341 insertions(+), 1 deletion(-) create mode 100644 tests/unittests/contfrac.py create mode 100644 tests/unittests/list.py create mode 100644 tests/unittests/log.py create mode 100644 tests/unittests/mathnf.py create mode 100644 tests/unittests/minim.py create mode 100644 tests/unittests/minmax.py create mode 100644 tests/unittests/modfun.py create mode 100644 tests/unittests/modular.py create mode 100644 tests/unittests/nfrootsof1.py create mode 100644 tests/unittests/nfsplitting.py create mode 100644 tests/unittests/norm.py diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index c07a2e3..6cdd9c6 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -20,7 +20,18 @@ 'lambert', 'lex', 'lindep', - 'linear' + 'linear', + 'list', + 'log', + 'mathnf', + 'contfrac', + 'minim', + 'minmax', + 'modfun', + 'modular', + 'nfrootsof1', + 'nfsplitting', + 'norm' ] suite = unittest.TestSuite() diff --git a/tests/unittests/contfrac.py b/tests/unittests/contfrac.py new file mode 100644 index 0000000..7e48d8a --- /dev/null +++ b/tests/unittests/contfrac.py @@ -0,0 +1,185 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file contfrac : +contfrac(1,[],-1) +contfracpnqn(Vecsmall([])) +contfracpnqn([]) +contfracpnqn([],0) +contfracpnqn([],1) +contfracpnqn([2]) +contfracpnqn([2],0) +contfracpnqn([2],1) +v=[1,2,3]; +contfracpnqn(v) +contfracpnqn(v,0) +contfracpnqn(v,1) +contfracpnqn(v,2) +v=[1,2,3;4,5,6]; +contfracpnqn(v) +contfracpnqn(v,0) +contfracpnqn(v,1) +contfracpnqn(v,2) + +s=exp(x); +contfracinit(s,0) +contfracinit(s,1) +contfracinit(s,2) +e=contfracinit([]) +contfraceval(e,1) +e=contfracinit(s) +contfraceval(e,1,10) +contfraceval(e,1, 8) +contfraceval(e,1, 6) +contfraceval(e,1) +contfracinit([1,2,3]) +contfracinit(Pol(0)) +contfracinit(1); +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestContfrac(unittest.TestCase): + def test_contfrac(self): + with self.assertRaises(PariError) as context: + pari.contfrac(1, '[]', -1) + self.assertTrue('domain error in contfrac: nmax < 0' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.contfracpnqn(pari.Vecsmall('[]')) + self.assertTrue('incorrect type in pnqn (t_VECSMALL)' in str(context.exception)) + self.assertEqual(pari.contfracpnqn('[]'), '[1, 0; 0, 1]') + self.assertEqual(pari.contfracpnqn('[]', 0), '[;]') + self.assertEqual(pari.contfracpnqn('[]', 1), '[;]') + self.assertEqual(pari.contfracpnqn([2]), '[2, 1; 1, 0]') + self.assertEqual(pari.contfracpnqn([2], 0), '[2; 1]') + self.assertEqual(pari.contfracpnqn([2], 1), '[2; 1]') + + v = [1, 2, 3]; + self.assertEqual(pari.contfracpnqn(v), '[10, 3; 7, 2]') + self.assertEqual(pari.contfracpnqn(v, 0), '[1; 1]') + self.assertEqual(pari.contfracpnqn(v, 1), '[1, 3; 1, 2]') + self.assertEqual(pari.contfracpnqn(v, 2), '[1, 3, 10; 1, 2, 7]') + + v = '[1,2,3;4,5,6]'; + self.assertEqual(pari.contfracpnqn(v), '[144, 22; 33, 5]') + self.assertEqual(pari.contfracpnqn(v, 0), '[4; 1]') + self.assertEqual(pari.contfracpnqn(v, 1), '[4, 22; 1, 5]') + self.assertEqual(pari.contfracpnqn(v, 2), '[4, 22, 144; 1, 5, 33]') + + s = pari.exp('x'); + self.assertEqual(pari.contfracinit(s, 0), '[[], []]') + self.assertEqual(pari.contfracinit(s, 1), '[[-1], []]') + self.assertEqual(pari.contfracinit(s, 2), '[[-1], [1/2]]') + + e = pari.contfracinit('[]') + self.assertEqual(pari.contfraceval(e, 1), '[[], []]') + + e = pari.contfracinit(s) + self.assertEquals(e, '[[-1, 1/3, 1/15, 1/35, 1/63, 1/99, 1/143, 1/195], [1/2, 1/36, 1/100, 1/196, ' + + '1/324, 1/484, 1/676, 1/900]]') + + with self.assertRaises(PariError) as context: + pari.contfraceval(e, 1, 10) + self.assertTrue('non-existent component in contfraceval: index > 8' in str(context.exception)) + self.assertEqual(pari.contfraceval(e, 1, 8), '410105312/150869313') + self.assertEqual(pari.contfraceval(e, 1, 6), '517656/190435') + self.assertEqual(pari.contfraceval(e, 1), '410105312/150869313') + self.assertEquals(pari.contfracinit([1, 2, 3]), '[[-2], [1]]') + self.assertEqual(pari.contfracinit(pari.Pol(0)), '[[], []]') + with self.assertRaises(PariError) as context: + pari.contfracinit(1); + self.assertTrue('incorrect type in contfracinit (t_INT)' in str(context.exception)) + +"""**** Original expected results **** + + *** at top-level: contfrac(1,[],-1) + *** ^----------------- + *** contfrac: domain error in contfrac: nmax < 0 + *** at top-level: contfracpnqn(Vecsmal + *** ^-------------------- + *** contfracpnqn: incorrect type in pnqn (t_VECSMALL). + +[1 0] + +[0 1] + +[;] +[;] + +[2 1] + +[1 0] + + +[2] + +[1] + + +[2] + +[1] + + +[10 3] + +[ 7 2] + + +[1] + +[1] + + +[1 3] + +[1 2] + + +[1 3 10] + +[1 2 7] + + +[144 22] + +[ 33 5] + + +[4] + +[1] + + +[4 22] + +[1 5] + + +[4 22 144] + +[1 5 33] + +[[], []] +[[-1], []] +[[-1], [1/2]] +[[], []] +0 +[[-1, 1/3, 1/15, 1/35, 1/63, 1/99, 1/143, 1/195], [1/2, 1/36, 1/100, 1/196, +1/324, 1/484, 1/676, 1/900]] + *** at top-level: contfraceval(e,1,10) + *** ^-------------------- + *** contfraceval: non-existent component in contfraceval: index > 8 +410105312/150869313 +517656/190435 +410105312/150869313 +[[-2], [1]] +[[], []] + *** at top-level: contfracinit(1) + *** ^--------------- + *** contfracinit: incorrect type in contfracinit (t_INT). + +""" diff --git a/tests/unittests/list.py b/tests/unittests/list.py new file mode 100644 index 0000000..57ea6d1 --- /dev/null +++ b/tests/unittests/list.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file list : +L = List(); +for (i=1,10^5,listput(L,i)) +L = List([1,2,3]); +for (i=1,5000,listinsert(L,i,3)) +L = List([1,2,3,3]); +concat(L,5) +concat(1,L) +L = concat(L,L) +listsort(L); L +listsort(L,1); L +listpop(L); L +listpop(L,1); L +\\ +L = List([[1,2,3], 2]) +L[1][1] = 3 +L +L = List([Vecsmall([1,2,3]), 2]) +L[1][1] = 3 + +L = List(); listput(L,1); listpop(L); listpop(L); + +matdiagonal(List([0])) +g(L)=for(i=1,5,listput(L,5-i));L; +l=List([10,9,8,7,6,5]); g(l) +l +listkill(l) +listcreate() + +subst(List([x,x^2+y]),x,1) +substvec(List([x,y]), [x,y], [y,x]) +substpol(List([x^2,x^3]), x^2, y) + +getheap()[1] + +chinese(List()) +chinese(List([Mod(1,3)])) +chinese(List([Mod(0,2),Mod(1,3),Mod(2,5)])) +liftint(List([0,1])) + +L = List([1,2,3]); +L[1] +L[1]*=2 +L +L[1]=3 +L +""" +import unittest +from cypari2 import Pari, PariError +from math import pow + +pari = Pari() + + +class TestList(unittest.TestCase): + def test_list(self): + L = pari.List(); + + for i in range(1, int(pow(10, 5) + 1)): + pari.listput(L, i) + + L = pari.List([1, 2, 3]); + for i in range(1, 5000): + pari.listinsert(L, i, 3) + + L = pari.List([1, 2, 3, 3]); + self.assertEquals(pari.concat(L, 5), 'List([1, 2, 3, 3, 5])') + self.assertEquals(pari.concat(1, L), 'List([1, 1, 2, 3, 3])') + L = pari.concat(L, L) + self.assertEquals(L, 'List([1, 2, 3, 3, 1, 2, 3, 3])') + pari.listsort(L); + self.assertEquals(L, 'List([1, 1, 2, 2, 3, 3, 3, 3])') + pari.listsort(L, 1); + self.assertEquals(L,'List([1, 2, 3])') + pari.listpop(L); + self.assertEquals(L, 'List([1, 2])') + pari.listpop(L, 1); + self.assertEquals(L, 'List([2])') + + L = pari.List([[1,2,3], 2]) + # L[0][0] = 3 + # self.assertEquals(L, 'List([[3, 2, 3], 2])') + L = pari.List([pari.Vecsmall([1,2,3]), 2]) + self.assertEquals(L, 'List([Vecsmall([1, 2, 3]), 2])') + + L = pari.List(); + pari.listput(L, 1); + pari.listpop(L); + pari.listpop(L); + + # self.assertEquals(pari.matdiagonal(pari.List([0])), '[List([0])]') + def g(L): + res = pari.List(L) + for i in range(1, 6): + pari.listput(res, 5-i) + return res + + l = pari.List([10, 9, 8, 7, 6, 5]); + self.assertEquals(g(l), 'List([10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0])') + self.assertEquals(l, 'List([10, 9, 8, 7, 6, 5])') + pari.listkill(l) + self.assertEquals(pari.List(), 'List([])') + + self.assertEquals(pari.subst(pari.List(['x', 'x^2+y']), 'x', 1), 'List([1, y + 1])') + self.assertEquals(pari.substvec(pari.List(['x', 'y']), ['x', 'y'], ['y', 'x']), 'List([y, x])') + self.assertEquals(pari.substpol(pari.List(['x^2', 'x^3']), 'x^2', 'y'), 'List([y, y*x])') + + self.assertEquals(pari.chinese(pari.List()), 'Mod(0, 1)') + self.assertEquals(pari.chinese(pari.List([pari.Mod(1, 3)])), 'Mod(1, 3)') + self.assertEquals(pari.chinese(pari.List([pari.Mod(0, 2), pari.Mod(1, 3), pari.Mod(2, 5)])), 'Mod(22, 30)') + self.assertEquals(pari.liftint(pari.List([0, 1])), 'List([0, 1])') + + L = pari.List([1, 2, 3]); + self.assertEquals(L[0], '1') + # L[1]*=2 + # L + # L[1]=3 + # L + +"""**** Original expected results **** + +List([1, 2, 3, 3, 5]) +List([1, 1, 2, 3, 3]) +List([1, 2, 3, 3, 1, 2, 3, 3]) +List([1, 1, 2, 2, 3, 3, 3, 3]) +List([1, 2, 3]) +List([1, 2]) +List([2]) +List([[1, 2, 3], 2]) +3 +List([[3, 2, 3], 2]) +List([Vecsmall([1, 2, 3]), 2]) +3 + +[List([0])] + +List([10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) +List([10, 9, 8, 7, 6, 5]) +List([]) +List([1, y + 1]) +List([y, x]) +List([y, y*x]) +127 +Mod(0, 1) +Mod(1, 3) +Mod(22, 30) +List([0, 1]) +1 +2 +List([2, 2, 3]) +3 +List([3, 2, 3]) + +""" diff --git a/tests/unittests/log.py b/tests/unittests/log.py new file mode 100644 index 0000000..31f64e4 --- /dev/null +++ b/tests/unittests/log.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file log : +default(realprecision,38); +log(1+10^-30) +lngamma(1+10^-30) +lngamma(10^-30) +iferr(log(2+O(33)),E,E) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestLog(unittest.TestCase): + def test_log(self): + oldprec = pari.set_real_precision(38) + + self.assertEquals(str(pari.log('1+10^-30', precision=127)), '9.9999999999999999999999999999950000000 E-31') + self.assertEquals(str(pari.lngamma('1+10^-30', precision=127)), '-5.7721566490153286060651209008157996401 E-31') + self.assertEquals(str(pari.lngamma('10^-30', precision=127)), '69.077552789821370520539743640530349012') + with self.assertRaises(PariError) as context: + pari.log('2+O(33)', precision=127) + self.assertTrue('not a prime number in p-adic log: 33' in str(context.exception)) + + pari.set_real_precision(oldprec) + +"""**** Original expected results **** + +9.9999999999999999999999999999950000000 E-31 +-5.7721566490153286060651209008157996401 E-31 +69.077552789821370520539743640530349012 +error("not a prime number in p-adic log: 33.") + +""" diff --git a/tests/unittests/mathnf.py b/tests/unittests/mathnf.py new file mode 100644 index 0000000..a19ceb9 --- /dev/null +++ b/tests/unittests/mathnf.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file mathnf : +\e +mathnf([0,2]) +mathnf([0,2], 1) +mathnf([0,x]) +mathnf([0,x], 1) +mathnf([x,x^2+1; x^3+x+1, x+2]*Mod(1,5)) +v=[116085838, 181081878, 314252913,10346840]; +[H,U]=mathnf(v, 1); [v*U, norml2(U)] +[H,U]=mathnf(v, 5); [v*U, norml2(U)] +mathnf([]) +mathnf([],1) +mathnf([;]) +mathnf([;],1) +mathnfmodid(matrix(0,2), []) +mathnfmodid([0,7;-1,0;-1,-1], [6,2,2]) + +matsolvemod([;],[]~,[]~,1) +matsolvemod([;],[],[]~,1) +matsolvemod([;],[]~,[],1) +matsolvemod([;],1,1,1) +matsolvemod([1,2;3,4],1,2,1) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestMathnf(unittest.TestCase): + def test_mathnf(self): + self.assertEqual(pari.mathnf([0, 2]), 'Mat(2)') + self.assertEqual(pari.mathnf([0, 2], 1), '[Mat(2), [1, 0; 0, 1]]') + self.assertEqual(pari.mathnf([0, 'x']), 'Mat(x)') + self.assertEqual(pari.mathnf([0, 'x'], 1), '[Mat(x), [1, 0; 0, 1]]') + self.assertEqual(str(pari.mathnf('[x,x^2+1; x^3+x+1, x+2]*Mod(1,5)')), + '[Mod(1, 5)*x^5 + Mod(2, 5)*x^3 + Mod(4,' + + ' 5)*x + Mod(1, 5), Mod(4, 5)*x^4 + Mod(2, 5)*x^3 + Mod(4, 5)*x^2 + Mod(3, 5)*x; 0, 1]') + v = [116085838, 181081878, 314252913, 10346840]; + U = pari.mathnf(v, 1)[1]; + self.assertEqual(pari.norml2(U), '2833319') + U = pari.mathnf(v, 5)[1]; + self.assertEqual(pari.norml2(U), '765585180708864230567243002686057927228240493') + self.assertEqual(pari.mathnf('[]'), '[;]') + self.assertEqual(pari.mathnf('[]', 1), '[[;], [;]]') + self.assertEqual(pari.mathnf('[;]'), '[;]') + self.assertEqual(pari.mathnf('[;]', 1), '[[;], [;]]') + + def test_mathnfmodid(self): + self.assertEqual(pari.mathnfmodid('[;]', '[]'), '[;]') + self.assertEqual(pari.mathnfmodid('[0,7;-1,0;-1,-1]', [6, 2, 2]), '[2, 1, 1; 0, 1, 0; 0, 0, 1]') + + def test_matsolvemod(self): + self.assertEqual(pari.matsolvemod('[;]', '[]~', '[]~', 1), '0') + with self.assertRaises(PariError) as context: + pari.matsolvemod('[;]', '[]', '[]~', 1) + self.assertTrue('incorrect type in gaussmodulo (t_VEC)' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.matsolvemod('[;]', '[]~', '[]', 1) + self.assertTrue('incorrect type in gaussmodulo (t_VEC)' in str(context.exception)) + self.assertEqual(pari.matsolvemod('[;]', 1, 1, 1), '0') + self.assertEqual(pari.matsolvemod('[1,2;3,4]', 1, 2, 1), '[[0, 0]~, [-1, 0; 0, 1]]') + +"""**** Original expected results **** + + echo = 1 (on) +? mathnf([0,2]) + +[2] + +? mathnf([0,2],1) +[Mat(2), [1, 0; 0, 1]] +? mathnf([0,x]) + +[x] + +? mathnf([0,x],1) +[Mat(x), [1, 0; 0, 1]] +? mathnf([x,x^2+1;x^3+x+1,x+2]*Mod(1,5)) + +[Mod(1, 5)*x^5 + Mod(2, 5)*x^3 + Mod(4, 5)*x + Mod(1, 5) Mod(4, 5)*x^4 + Mod +(2, 5)*x^3 + Mod(4, 5)*x^2 + Mod(3, 5)*x] + +[0 1] + +? v=[116085838,181081878,314252913,10346840]; +? [H,U]=mathnf(v,1);[v*U,norml2(U)] +[[0, 0, 0, 1], 2833319] +? [H,U]=mathnf(v,5);[v*U,norml2(U)] +[[0, 0, 0, 1], 765585180708864230567243002686057927228240493] +? mathnf([]) +[;] +? mathnf([],1) +[[;], [;]] +? mathnf([;]) +[;] +? mathnf([;],1) +[[;], [;]] +? mathnfmodid(matrix(0,2),[]) +[;] +? mathnfmodid([0,7;-1,0;-1,-1],[6,2,2]) + +[2 1 1] + +[0 1 0] + +[0 0 1] + +? matsolvemod([;],[]~,[]~,1) +0 +? matsolvemod([;],[],[]~,1) + *** at top-level: matsolvemod([;],[],[ + *** ^-------------------- + *** matsolvemod: incorrect type in gaussmodulo (t_VEC). +? matsolvemod([;],[]~,[],1) + *** at top-level: matsolvemod([;],[]~, + *** ^-------------------- + *** matsolvemod: incorrect type in gaussmodulo (t_VEC). +? matsolvemod([;],1,1,1) +0 +? matsolvemod([1,2;3,4],1,2,1) +[[0, 0]~, [-1, 0; 0, 1]] + +""" diff --git a/tests/unittests/minim.py b/tests/unittests/minim.py new file mode 100644 index 0000000..77d0517 --- /dev/null +++ b/tests/unittests/minim.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file minim : +{d=[4,2,-2,-2,2,1,-2,2,2; 2,4,-2,0,0,0,-1,0,2; -2,-2,4,2,-2,1,1,-1,-2; +-2,0,2,4,-3,1,0,-2,0; 2,0,-2,-3,4,-1,0,2,0; 1,0,1,1,-1,4,0,-1,1; +-2,-1,1,0,0,0,4,-2,-2; 2,0,-1,-2,2,-1,-2,4,0; 2,2,-2,0,0,1,-2,0,4];} +qfperfection(d) +{d=[4,2,-2,2,2,-2,-1,0;2,4,-2,0,2,-2,1,-1; -2,-2,4,-2,0,2,1,-1; +2,0,-2,4,1,0,-2,0; 2,2,0,1,4,-1,1,-2;-2,-2,2,0,-1,4,-1,-1; +-1,1,1,-2,1,-1,4,0;0,-1,-1,0,-2,-1,0,4];} +qfperfection(d) + +d=[2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1;-1,2,1,0,1,1,1,1,1,1,1,1;-1,1,2,1,1,1,1,1, 1,1,1,1;-1,0,1,2,1,1,1,1,1,1,1,1;-1,1,1,1,2,1,1,1,1,1,1,1;-1,1,1,1,1,2,1,1,1,1,1 ,1;-1,1,1,1,1,1,2,1,1,1,1,1;-1,1,1,1,1,1,1,2,1,1,1,1;-1,1,1,1,1,1,1,1,2,1,1,1;-1 ,1,1,1,1,1,1,1,1,2,1,1;-1,1,1,1,1,1,1,1,1,1,2,1;-1,1,1,1,1,1,1,1,1,1,1,2]; +qfperfection(d) + +d=[84,-42,42,-34,49,42,44,-5,42,-42,42,34;-42,84,-42,-8,-44,-42,-47,-20,-22,0,-17,8;42,-42,84,-34,49,42,47,-22,22,-42,22,20;-34,-8,-34,84,3,-34,-31,0,8,34,-5,-42;49,-44,49,3,98,49,49,-27,49,-27,49,-8;42,-42,42,-34,49,84,42,-8,22,-20,24,-8;44,-47,47,-31,49,42,94,20,2,-22,2,25;-5,-20,-22,0,-27,-8,20,84,-42,42,-5,-8;42,-22,22,8,49,22,2,-42,84,-42,42,9;-42,0,-42,34,-27,-20,-22,42,-42,84,-5,-28;42,-17,22,-5,49,24,2,-5,42,-5,84,1;34,8,20,-42,-8,-8,25,-8,9,-28,1,84]; +qfperfection(d) + +d = [11870535336,4926369655,32404766,5833735188,-260286973,1176994945,-938673930,1133212506,-1074526606,-70224083,-516302409,2824815072,-4372545965,-3541960809,-934179491,1051267712;4926369655,11870535336,-1490432686,-875900356,3641011352,-133471097,5248732172,5339909303,1977366972,2112029217,1618397291,1453763043,-5074494971,3402204872,-6089917,-2536340118;32404766,-1490432686,11870535336,123881942,1472835948,538053943,-2072520281,-2111014772,-243328180,66329388,-1668343637,5366171257,-1644082716,1999937160,1862466413,-2684624269;5833735188,-875900356,123881942,11870535336,-4482992193,724356870,-2581885607,-1123344860,-5909559285,-374057682,-1737269060,1373350629,-685882364,-2860185796,1915679243,-2582189975;-260286973,3641011352,1472835948,-4482992193,11870535336,-3382162923,-2727082036,-172926336,3957014148,4123782659,-869026456,-712184755,1975235830,598346444,-803583682,764543726;1176994945,-133471097,538053943,724356870,-3382162923,11870535336,4149099372,-1345152733,3238996158,-1859449765,788927568,627981303,-1997619722,-5100674624,1082079081,-4600113518;-938673930,5248732172,-2072520281,-2581885607,-2727082036,4149099372,11870535336,2778219046,565855490,-4509773947,2630869581,161812815,-2518706476,2620761340,1350174537,-1070307221;1133212506,5339909303,-2111014772,-1123344860,-172926336,-1345152733,2778219046,11870535336,1405373352,-94842121,5935267668,1644886404,-4169157373,1191448802,400673054,-137185759;-1074526606,1977366972,-243328180,-5909559285,3957014148,3238996158,565855490,1405373352,11870535336,-1017421319,-2747041871,-2019274686,1090295757,2591545854,433617674,63706423;-70224083,2112029217,66329388,-374057682,4123782659,-1859449765,-4509773947,-94842121,-1017421319,11870535336,-570490848,1731611845,-2658074571,-1297231573,-350469672,-40728837;-516302409,1618397291,-1668343637,-1737269060,-869026456,788927568,2630869581,5935267668,-2747041871,-570490848,11870535336,2791532769,26571128,-1302311714,1214830887,1283425367;2824815072,1453763043,5366171257,1373350629,-712184755,627981303,161812815,1644886404,-2019274686,1731611845,2791532769,11870535336,-3163139204,110178163,-49759695,-1512817003;-4372545965,-5074494971,-1644082716,-685882364,1975235830,-1997619722,-2518706476,-4169157373,1090295757,-2658074571,26571128,-3163139204,11870535336,-55032693,-2820423865,4651789746;-3541960809,3402204872,1999937160,-2860185796,598346444,-5100674624,2620761340,1191448802,2591545854,-1297231573,-1302311714,110178163,-55032693,11870535336,5683626972,-2169747194;-934179491,-6089917,1862466413,1915679243,-803583682,1082079081,1350174537,400673054,433617674,-350469672,1214830887,-49759695,-2820423865,5683626972,11870535336,-5697137302;1051267712,-2536340118,-2684624269,-2582189975,764543726,-4600113518,-1070307221,-137185759,63706423,-40728837,1283425367,-1512817003,4651789746,-2169747194,-5697137302,11870535336]; +qfperfection(d) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestMinim(unittest.TestCase): + def test_minim(self): + d = ('[4,2,-2,-2,2,1,-2,2,2; 2,4,-2,0,0,0,-1,0,2; -2,-2,4,2,-2,1,1,-1,-2;-2,0,2,4,-3,1,0,-2,0; 2,0,-2,-3' + ',4,-1,0,2,0; 1,0,1,1,-1,4,0,-1,1;-2,-1,1,0,0,0,4,-2,-2; 2,0,-1,-2,2,-1,-2,4,0; 2,2,-2,0,0,1,-2,0,4]'); + self.assertEquals(pari.qfperfection(d), '1') + + d = ('[4,2,-2,2,2,-2,-1,0;2,4,-2,0,2,-2,1,-1; -2,-2,4,-2,0,2,1,-1;' + '2,0,-2,4,1,0,-2,0; 2,2,0,1,4,-1,1,-2;-2,-2,2,0,-1,4,-1,-1;' + '-1,1,1,-2,1,-1,4,0;0,-1,-1,0,-2,-1,0,4]') + self.assertEquals(pari.qfperfection(d), '1') + + d = ('[2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1;-1,2,1,0,1,1,1,1,1,1,1,1;-1,1,2,1,1,1,1,1, 1,1,1,1;' + '-1,0,1,2,1,1,1,1,1,1,1,1;-1,1,1,1,2,1,1,1,1,1,1,1;-1,1,1,1,1,2,1,1,1,1,1 ,1;-1,1,1,1,1,' + '1,2,1,1,1,1,1;-1,1,1,1,1,1,1,2,1,1,1,1;-1,1,1,1,1,1,1,1,2,1,1,1;-1 ,1,1,1,1,1,1,1,1,2,1' + ',1;-1,1,1,1,1,1,1,1,1,1,2,1;-1,1,1,1,1,1,1,1,1,1,1,2];') + self.assertEquals(pari.qfperfection(d), '78') + + d = ('[84,-42,42,-34,49,42,44,-5,42,-42,42,34;-42,84,-42,-8,-44,-42,-47,-20,-22,0,-17,8;' + '42,-42,84,-34,49,42,47,-22,22,-42,22,20;-34,-8,-34,84,3,-34,-31,0,8,34,-5,-42;49,-44,' + '49,3,98,49,49,-27,49,-27,49,-8;42,-42,42,-34,49,84,42,-8,22,-20,24,-8;44,-47,47,-31,4' + '9,42,94,20,2,-22,2,25;-5,-20,-22,0,-27,-8,20,84,-42,42,-5,-8;42,-22,22,8,49,22,2,-42,' + '84,-42,42,9;-42,0,-42,34,-27,-20,-22,42,-42,84,-5,-28;42,-17,22,-5,49,24,2,-5,42,-5,8' + '4,1;34,8,20,-42,-8,-8,25,-8,9,-28,1,84];') + self.assertEquals(pari.qfperfection(d), '77') + + d = ('[11870535336,4926369655,32404766,5833735188,-260286973,1176994945,-938673930,113' + '3212506,-1074526606,-70224083,-516302409,2824815072,-4372545965,-3541960809,-934' + '179491,1051267712;4926369655,11870535336,-1490432686,-875900356,3641011352,-1334' + '71097,5248732172,5339909303,1977366972,2112029217,1618397291,1453763043,-5074494' + '971,3402204872,-6089917,-2536340118;32404766,-1490432686,11870535336,123881942,1' + '472835948,538053943,-2072520281,-2111014772,-243328180,66329388,-1668343637,5366' + '171257,-1644082716,1999937160,1862466413,-2684624269;5833735188,-875900356,12388' + '1942,11870535336,-4482992193,724356870,-2581885607,-1123344860,-5909559285,-3740' + '57682,-1737269060,1373350629,-685882364,-2860185796,1915679243,-2582189975;-2602' + '86973,3641011352,1472835948,-4482992193,11870535336,-3382162923,-2727082036,-172' + '926336,3957014148,4123782659,-869026456,-712184755,1975235830,598346444,-8035836' + '82,764543726;1176994945,-133471097,538053943,724356870,-3382162923,11870535336,4' + '149099372,-1345152733,3238996158,-1859449765,788927568,627981303,-1997619722,-51' + '00674624,1082079081,-4600113518;-938673930,5248732172,-2072520281,-2581885607,-2' + '727082036,4149099372,11870535336,2778219046,565855490,-4509773947,2630869581,161' + '812815,-2518706476,2620761340,1350174537,-1070307221;1133212506,5339909303,-2111' + '014772,-1123344860,-172926336,-1345152733,2778219046,11870535336,1405373352,-948' + '42121,5935267668,1644886404,-4169157373,1191448802,400673054,-137185759;-1074526' + '606,1977366972,-243328180,-5909559285,3957014148,3238996158,565855490,1405373352' + ',11870535336,-1017421319,-2747041871,-2019274686,1090295757,2591545854,433617674' + ',63706423;-70224083,2112029217,66329388,-374057682,4123782659,-1859449765,-45097' + '73947,-94842121,-1017421319,11870535336,-570490848,1731611845,-2658074571,-12972' + '31573,-350469672,-40728837;-516302409,1618397291,-1668343637,-1737269060,-869026' + '456,788927568,2630869581,5935267668,-2747041871,-570490848,11870535336,279153276' + '9,26571128,-1302311714,1214830887,1283425367;2824815072,1453763043,5366171257,13' + '73350629,-712184755,627981303,161812815,1644886404,-2019274686,1731611845,279153' + '2769,11870535336,-3163139204,110178163,-49759695,-1512817003;-4372545965,-507449' + '4971,-1644082716,-685882364,1975235830,-1997619722,-2518706476,-4169157373,10902' + '95757,-2658074571,26571128,-3163139204,11870535336,-55032693,-2820423865,4651789' + '746;-3541960809,3402204872,1999937160,-2860185796,598346444,-5100674624,26207613' + '40,1191448802,2591545854,-1297231573,-1302311714,110178163,-55032693,11870535336' + ',5683626972,-2169747194;-934179491,-6089917,1862466413,1915679243,-803583682,108' + '2079081,1350174537,400673054,433617674,-350469672,1214830887,-49759695,-28204238' + '65,5683626972,11870535336,-5697137302;1051267712,-2536340118,-2684624269,-258218' + '9975,764543726,-4600113518,-1070307221,-137185759,63706423,-40728837,1283425367,' + '-1512817003,4651789746,-2169747194,-5697137302,11870535336];') + self.assertEquals(pari.qfperfection(d), '136') + +"""**** Original expected results **** + +1 +1 +78 +77 +136 + +""" diff --git a/tests/unittests/minmax.py b/tests/unittests/minmax.py new file mode 100644 index 0000000..fb1aae4 --- /dev/null +++ b/tests/unittests/minmax.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file minmax : +v = [-3,7,-2,11]; +obj = [1, v, Vecsmall(v), [-3,7;-2,11]]; + +{ +for (i = 1, #obj, + my (o = obj[i], u,v); + vecmin(o, &u); + vecmax(o, &v); + print(i, ": ", [vecmax(o), vecmin(o), u, v]); +) +} + +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestMinmax(unittest.TestCase): + def test_minmax(self): + v = [-3,7,-2,11]; + obj = [1, v, pari.Vecsmall(v), '[-3,7;-2,11]']; + + res = (('1', '1'), ('11', '-3'), ('11', '-3'), ('11', '-3')) + for i in range(0, len(obj)): + o = pari(obj[i]) + self.assertEquals((str(o.vecmax()), str(o.vecmin())), res[i]) + + +"""**** Original expected results **** + +1: [1, 1, 0, 0] +2: [11, -3, 1, 4] +3: [11, -3, 1, 4] +4: [11, -3, [1, 1], [2, 2]] + +""" diff --git a/tests/unittests/modfun.py b/tests/unittests/modfun.py new file mode 100644 index 0000000..bb9c8e8 --- /dev/null +++ b/tests/unittests/modfun.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file modfun : +default(realprecision,38) +eta(2+O(2^20)) +eta(x+x^2+x^3+x^4+O(x^5)) +eta(I) +ellj(2+O(2^20)) +ellj(x+x^2+x^3+x^4+O(x^5)) +theta(1/2,I) +weber(1.0*I,1) +weber(1+I) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestModfun(unittest.TestCase): + def setUp(self): + pari.set_real_precision(38) + + def tearDown(self): + pari.set_real_precision(15) + + def test_eta(self): + self.assertEqual(pari.eta('2+O(2^20)'), + '1 + 2 + 2^3 + 2^4 + 2^7 + 2^12 + 2^13 + 2^14 + 2^16 + 2^17 + 2^18 + 2^19 + O(2^20)') + self.assertEqual(pari.eta('x+x^2+x^3+x^4+O(x^5)'), '1 - x - 2*x^2 - 3*x^3 - 4*x^4 + O(x^5)') + self.assertEqual(str(pari.eta('I', precision=127)), '0.99812906992595851327996232224527387813') + + def test_ellj(self): + self.assertEqual(pari.ellj('2+O(2^20)'), '2^-1 + 2^5 + 2^7 + 2^8 + 2^10 + 2^12 + 2^16 + O(2^18)') + self.assertEqual(pari.ellj('x+x^2+x^3+x^4+O(x^5)'), 'x^-1 + 743 + 196884*x + 21690644*x^2 + O(x^3)') + + def test_theta(self): + self.assertEqual(str(pari.theta('1/2', 'I', precision=127)), + '0.E-38 - 0.50432357748832834893222560519660217759*I') + + def test_weber(self): + self.assertEqual(str(pari.weber('1.0*I', 1, precision=127)), '1.0905077326652576592070106557607079790') + self.assertEqual(str(pari.weber('1+I', precision=127)), + '1.0811782878393746833655992417658285836 - 0.14233982193131805512395869109512286588*I') + +"""**** Original expected results **** + +1 + 2 + 2^3 + 2^4 + 2^7 + 2^12 + 2^13 + 2^14 + 2^16 + 2^17 + 2^18 + 2^19 + O +(2^20) +1 - x - 2*x^2 - 3*x^3 - 4*x^4 + O(x^5) +0.99812906992595851327996232224527387813 +2^-1 + 2^5 + 2^7 + 2^8 + 2^10 + 2^12 + 2^16 + O(2^18) +x^-1 + 743 + 196884*x + 21690644*x^2 + O(x^3) +0.E-38 - 0.50432357748832834893222560519660217759*I +1.0905077326652576592070106557607079790 +1.0811782878393746833655992417658285836 - 0.14233982193131805512395869109512 +286588*I + +""" diff --git a/tests/unittests/modular.py b/tests/unittests/modular.py new file mode 100644 index 0000000..d8495f4 --- /dev/null +++ b/tests/unittests/modular.py @@ -0,0 +1,292 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file modular : +v = [2,3,2^32-1,2^64-1,10^20]; +f(a,b,p)=(a*Mod(1,p)) * (b*Mod(1,p)); +g(a,p)=sqr(a*Mod(1,p)); +test(a,b)= +{ + for (i=1,#v,print(i, ": ", f(a,b,v[i]))); + for (i=1,#v,print(i, ": ", g(a,v[i]))); +} +test(polcyclo(10),polcyclo(5)); +test([1,2;3,4], [-1,2;-4,2]); +Mod(Mod(1,y),x) +Mod(Mod(1,x),y) +iferr(Mod(1,"a"),E,E) +iferr(Mod(0,0),E,E) +iferr(Mod(0,Pol(0)),E,E) +iferr(Mod(x+O(x^2), x^3), E,E) +Mod(x+O(x^2), x^2) +Mod(x+O(x^3), x^2) +Mod(Mod(x,x^3), x^2) +Mod(Mod(1,12), 9) +Mod(1/x,x^2+1) +Mod([5,6],2) +Mod(3*x,2) +Mod(x,y) +Mod(Pol(0),2) +Pol(0)*Mod(1,2) +k=100000000000000000000; +Mod(3,7)^-k +Mod(3,7)^k + +\g1 +a=Mod(1,2);b=Mod(1,3); +a+b +a-b +a*b +a/b +a+a +a-a +a*a +a/a +a=Mod(1,x);b=Mod(1,x+1); +a+b +a-b +a*b +a/b +a+a +a-a +a*a +a/a + +\\#1652 +p=436^56-35;lift(Mod(271,p)^((p-1)/2)) +\\#1717 +Mod(0,1)==0 +Mod(0,1)==1 +Mod(0,1)==-1 +Mod(0,x^0)==0 +Mod(0,x^0)==1 +Mod(0,x^0)==-1 +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestModular(unittest.TestCase): + def test_modular(self): + v = [2, 3, '2^32-1', '2^64-1', '10^20']; + + def f(a, b, p): + return (a * pari.Mod(1, p)) * (b * pari.Mod(1, p)) + + def g(a, p): + return pari.sqr(a * pari.Mod(1, p)); + + def test(a, b, l): + for i in range(0, len(v)): + self.assertEquals(str(f(a, b, v[i])), l[i]) + + for i in range(0, len(v)): + self.assertEquals(str(g(a, v[i])), l[i+len(v)]) + + l = ['Mod(1, 2)*x^8 + Mod(1, 2)*x^6 + Mod(1, 2)*x^4 + Mod(1, 2)*x^2 + Mod(1, 2)', + 'Mod(1, 3)*x^8 + Mod(1, 3)*x^6 + Mod(1, 3)*x^4 + Mod(1, 3)*x^2 + Mod(1, 3)', + 'Mod(1, 4294967295)*x^8 + Mod(1, 4294967295)*x^6 + Mod(1, 4294967295)*x^4 + Mod(1, 429496' + + '7295)*x^2 + Mod(1, 4294967295)', + 'Mod(1, 18446744073709551615)*x^8 + Mod(1, 18446744073709551615)*x^6 + Mod(1, 18446744073' + + '709551615)*x^4 + Mod(1, 18446744073709551615)*x^2 + Mod(1, 18446744073709551615)', + 'Mod(1, 100000000000000000000)*x^8 + Mod(1, 100000000000000000000)*x^6 + Mod(1, 100000000' + + '000000000000)*x^4 + Mod(1, 100000000000000000000)*x^2 + Mod(1, 100000000000000000000)', + 'Mod(1, 2)*x^8 + Mod(1, 2)*x^6 + Mod(1, 2)*x^4 + Mod(1, 2)*x^2 + Mod(1, 2)', + 'Mod(1, 3)*x^8 + Mod(1, 3)*x^7 + Mod(2, 3)*x^5 + Mod(2, 3)*x^4 + Mod(2, 3)*x^3 + Mod(1, 3)*x + Mod(1, 3)', + 'Mod(1, 4294967295)*x^8 + Mod(4294967293, 4294967295)*x^7 + Mod(3, 4294967295)*x^6 + Mod(' + + '4294967291, 4294967295)*x^5 + Mod(5, 4294967295)*x^4 + Mod(4294967291, 4294967295)*x^3 +' + + ' Mod(3, 4294967295)*x^2 + Mod(4294967293, 4294967295)*x + Mod(1, 4294967295)', + 'Mod(1, 18446744073709551615)*x^8 + Mod(18446744073709551613, 18446744073709551615)*x^7 +' + + ' Mod(3, 18446744073709551615)*x^6 + Mod(18446744073709551611, 18446744073709551615)*x^5 ' + + '+ Mod(5, 18446744073709551615)*x^4 + Mod(18446744073709551611, 18446744073709551615)*x^3' + + ' + Mod(3, 18446744073709551615)*x^2 + Mod(18446744073709551613, 18446744073709551615)*x ' + + '+ Mod(1, 18446744073709551615)', + 'Mod(1, 100000000000000000000)*x^8 + Mod(99999999999999999998, 100000000000000000000)*x^7' + + ' + Mod(3, 100000000000000000000)*x^6 + Mod(99999999999999999996, 100000000000000000000)*' + + 'x^5 + Mod(5, 100000000000000000000)*x^4 + Mod(99999999999999999996, 10000000000000000000' + + '0)*x^3 + Mod(3, 100000000000000000000)*x^2 + Mod(99999999999999999998, 10000000000000000' + + '0000)*x + Mod(1, 100000000000000000000)'] + + test(pari.polcyclo(10), pari.polcyclo(5), l); + + l = ['[Mod(1, 2), Mod(0, 2); Mod(1, 2), Mod(0, 2)]', + '[Mod(0, 3), Mod(0, 3); Mod(2, 3), Mod(2, 3)]', + '[Mod(4294967286, 4294967295), Mod(6, 4294967295); Mod(4294967276, 4294967295), Mod(14, 4294967295)]', + '[Mod(18446744073709551606, 18446744073709551615), Mod(6, 18446744073709551615); Mod(1844674407370955' + + '1596, 18446744073709551615), Mod(14, 18446744073709551615)]', + '[Mod(99999999999999999991, 100000000000000000000), Mod(6, 100000000000000000000); Mod(99999999999999' + + '999981, 100000000000000000000), Mod(14, 100000000000000000000)]', + '[Mod(1, 2), Mod(0, 2); Mod(1, 2), Mod(0, 2)]', + '[Mod(1, 3), Mod(1, 3); Mod(0, 3), Mod(1, 3)]', + '[Mod(7, 4294967295), Mod(10, 4294967295); Mod(15, 4294967295), Mod(22, 4294967295)]', + '[Mod(7, 18446744073709551615), Mod(10, 18446744073709551615); Mod(15, 18446744073709551615), Mod(22,' + + ' 18446744073709551615)]', + '[Mod(7, 100000000000000000000), Mod(10, 100000000000000000000); Mod(15, 100000000000000000000), Mod(' + + '22, 100000000000000000000)]'] + + test('[1,2;3,4]', '[-1,2;-4,2]', l); + self.assertEquals(pari.Mod(pari.Mod(1, 'y'), 'x'), 'Mod(Mod(1, y), x)') + self.assertEquals(pari.Mod(pari.Mod(1, 'x'), 'y'), 'Mod(Mod(1, y), x)') + with self.assertRaises(PariError) as context: + pari.Mod(1, '"a"') + self.assertTrue('forbidden division t_INT % t_STR' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.Mod(0, 0) + self.assertTrue('impossible inverse in %: 0' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.Mod(0, pari.Pol(0)) + self.assertTrue('impossible inverse in %: 0' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.Mod('x+O(x^2)', 'x^3') + self.assertTrue('inconsistent division t_SER % t_POL' in str(context.exception)) + self.assertEqual(pari.Mod('x+O(x^2)', 'x^2'), 'Mod(x, x^2)') + self.assertEqual(pari.Mod('x+O(x^3)', 'x^2'), 'Mod(x, x^2)') + self.assertEqual(pari.Mod(pari.Mod('x', 'x^3'), 'x^2'), 'Mod(x, x^2)') + self.assertEqual(pari.Mod(pari.Mod(1, 12), 9), 'Mod(1, 3)') + self.assertEqual(pari.Mod('1/x', 'x^2+1'), 'Mod(-x, x^2 + 1)') + self.assertEqual(pari.Mod([5, 6], 2), '[Mod(1, 2), Mod(0, 2)]') + self.assertEqual(pari.Mod('3*x', 2), 'Mod(1, 2)*x') + self.assertEqual(pari.Mod('x', 'y'), 'Mod(1, y)*x') + self.assertEqual(pari.Mod(pari.Pol(0), 2), 'Mod(0, 2)') + self.assertEqual(pari.Pol(0) * pari.Mod(1, 2), 'Mod(0, 2)') + # k = 100000000000000000000; + # self.assertEqual(int(pow(pari.Mod(3, 7), -k)), 'Mod(2, 7)') + # self.assertEqual(int(pow(pari.Mod(3,7)^k)) + # + # \g1 + # a = pari.Mod(1, 2); + # b = pari.Mod(1, 3); + # a+b + # a-b + # a*b + # a/b + # a+a + # a-a + # a*a + # a/a + a = pari.Mod(1, 'x'); + b = pari.Mod(1, 'x+1'); + # a+b + # a-b + # a*b + # a/b + self.assertEquals(a+a, 'Mod(2, x)') + self.assertEquals(a-a, 'Mod(0, x)') + self.assertEquals(a*a, 'Mod(1, x)') + self.assertEquals(a/a, 'Mod(1, x)') + # + #1652 + # self.assertEquals(pari.lift('Mod(271,436^56-35)^((436^56-35-1)/2)'), 'Mod(1, x)') + #1717 + # self.assertEqual(pari.Mod(0,1), '0') + # self.assertEqual(pari.Mod(0,1), '1') + # self.assertEqual(pari.Mod(0,1), '-1') + # self.assertEqual(pari.Mod(0,'x^0'), '0') + # self.assertEqual(pari.Mod(0,'x^0'), '1') + # self.assertEqual(pari.Mod(0,'x^0'), '-1') + +"""**** Original expected results **** + +1: Mod(1, 2)*x^8 + Mod(1, 2)*x^6 + Mod(1, 2)*x^4 + Mod(1, 2)*x^2 + Mod(1, 2) +2: Mod(1, 3)*x^8 + Mod(1, 3)*x^6 + Mod(1, 3)*x^4 + Mod(1, 3)*x^2 + Mod(1, 3) +3: Mod(1, 4294967295)*x^8 + Mod(1, 4294967295)*x^6 + Mod(1, 4294967295)*x^4 ++ Mod(1, 4294967295)*x^2 + Mod(1, 4294967295) +4: Mod(1, 18446744073709551615)*x^8 + Mod(1, 18446744073709551615)*x^6 + Mod +(1, 18446744073709551615)*x^4 + Mod(1, 18446744073709551615)*x^2 + Mod(1, 18 +446744073709551615) +5: Mod(1, 100000000000000000000)*x^8 + Mod(1, 100000000000000000000)*x^6 + M +od(1, 100000000000000000000)*x^4 + Mod(1, 100000000000000000000)*x^2 + Mod(1 +, 100000000000000000000) +1: Mod(1, 2)*x^8 + Mod(1, 2)*x^6 + Mod(1, 2)*x^4 + Mod(1, 2)*x^2 + Mod(1, 2) +2: Mod(1, 3)*x^8 + Mod(1, 3)*x^7 + Mod(2, 3)*x^5 + Mod(2, 3)*x^4 + Mod(2, 3) +*x^3 + Mod(1, 3)*x + Mod(1, 3) +3: Mod(1, 4294967295)*x^8 + Mod(4294967293, 4294967295)*x^7 + Mod(3, 4294967 +295)*x^6 + Mod(4294967291, 4294967295)*x^5 + Mod(5, 4294967295)*x^4 + Mod(42 +94967291, 4294967295)*x^3 + Mod(3, 4294967295)*x^2 + Mod(4294967293, 4294967 +295)*x + Mod(1, 4294967295) +4: Mod(1, 18446744073709551615)*x^8 + Mod(18446744073709551613, 184467440737 +09551615)*x^7 + Mod(3, 18446744073709551615)*x^6 + Mod(18446744073709551611, + 18446744073709551615)*x^5 + Mod(5, 18446744073709551615)*x^4 + Mod(18446744 +073709551611, 18446744073709551615)*x^3 + Mod(3, 18446744073709551615)*x^2 + + Mod(18446744073709551613, 18446744073709551615)*x + Mod(1, 1844674407370955 +1615) +5: Mod(1, 100000000000000000000)*x^8 + Mod(99999999999999999998, 10000000000 +0000000000)*x^7 + Mod(3, 100000000000000000000)*x^6 + Mod(999999999999999999 +96, 100000000000000000000)*x^5 + Mod(5, 100000000000000000000)*x^4 + Mod(999 +99999999999999996, 100000000000000000000)*x^3 + Mod(3, 100000000000000000000 +)*x^2 + Mod(99999999999999999998, 100000000000000000000)*x + Mod(1, 10000000 +0000000000000) +1: [Mod(1, 2), Mod(0, 2); Mod(1, 2), Mod(0, 2)] +2: [Mod(0, 3), Mod(0, 3); Mod(2, 3), Mod(2, 3)] +3: [Mod(4294967286, 4294967295), Mod(6, 4294967295); Mod(4294967276, 4294967 +295), Mod(14, 4294967295)] +4: [Mod(18446744073709551606, 18446744073709551615), Mod(6, 1844674407370955 +1615); Mod(18446744073709551596, 18446744073709551615), Mod(14, 184467440737 +09551615)] +5: [Mod(99999999999999999991, 100000000000000000000), Mod(6, 100000000000000 +000000); Mod(99999999999999999981, 100000000000000000000), Mod(14, 100000000 +000000000000)] +1: [Mod(1, 2), Mod(0, 2); Mod(1, 2), Mod(0, 2)] +2: [Mod(1, 3), Mod(1, 3); Mod(0, 3), Mod(1, 3)] +3: [Mod(7, 4294967295), Mod(10, 4294967295); Mod(15, 4294967295), Mod(22, 42 +94967295)] +4: [Mod(7, 18446744073709551615), Mod(10, 18446744073709551615); Mod(15, 184 +46744073709551615), Mod(22, 18446744073709551615)] +5: [Mod(7, 100000000000000000000), Mod(10, 100000000000000000000); Mod(15, 1 +00000000000000000000), Mod(22, 100000000000000000000)] +Mod(Mod(1, y), x) +Mod(Mod(1, y), x) +error("forbidden division t_INT % t_STR.") +error("impossible inverse in %: 0.") +error("impossible inverse in %: 0.") +error("inconsistent division t_SER % t_POL.") +Mod(x, x^2) +Mod(x, x^2) +Mod(x, x^2) +Mod(1, 3) +Mod(-x, x^2 + 1) +[Mod(1, 2), Mod(0, 2)] +Mod(1, 2)*x +Mod(1, y)*x +Mod(0, 2) +Mod(0, 2) + *** _^_: Warning: Mod(a,b)^n with n >> b : wasteful. +Mod(2, 7) + *** _^_: Warning: Mod(a,b)^n with n >> b : wasteful. +Mod(4, 7) + debug = 1 + *** _+_: Warning: coercing quotient rings; moduli 2 and 3 -> 1. +Mod(0, 1) + *** _-_: Warning: coercing quotient rings; moduli 2 and 3 -> 1. +Mod(0, 1) + *** _*_: Warning: coercing quotient rings; moduli 2 and 3 -> 1. +Mod(0, 1) + *** _/_: Warning: coercing quotient rings; moduli 2 and 3 -> 1. +Mod(0, 1) +Mod(0, 2) +Mod(0, 2) +Mod(1, 2) +Mod(1, 2) + *** _+_: Warning: coercing quotient rings; moduli x and x + 1 -> 1. +Mod(0, 1) + *** _-_: Warning: coercing quotient rings; moduli x and x + 1 -> 1. +Mod(0, 1) + *** _*_: Warning: coercing quotient rings; moduli x and x + 1 -> 1. +Mod(0, 1) + *** _/_: Warning: coercing quotient rings; moduli x and x + 1 -> 1. +Mod(0, 1) +Mod(2, x) +Mod(0, x) +Mod(1, x) +Mod(1, x) +1 +1 +1 +1 +1 +1 +1 + +""" diff --git a/tests/unittests/nfrootsof1.py b/tests/unittests/nfrootsof1.py new file mode 100644 index 0000000..b943ec4 --- /dev/null +++ b/tests/unittests/nfrootsof1.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file nfrootsof1 : +allocatemem(20*10^6); +do(P)=nfrootsof1(nfinit(P))[1]; + +do(polcyclo(23)) +do(polresultant(y^3*x^3-y^2*x^2+1, polcyclo(23))) +do(x^54+9*x^51+18*x^48-81*x^45+387*x^42-729*x^39+1953*x^36-7560*x^33+14229*x^30-12393*x^27-270*x^24+6156*x^21+26136*x^18-77679*x^15+88452*x^12-49572*x^9+10287*x^6+972*x^3+27) +do(x^2+396735) +do(x^2+4372152) +do(x^2+x+99184) +do(x^16+2*x^15-x^14-4*x^13+x^12+4*x^11-2*x^9-3*x^8+7*x^6-9*x^4+4*x^3+4*x^2-4*x+1) +do(polcyclo(68)) +do(polcyclo(85)) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestNfrootsof1(unittest.TestCase): + def test_nfrootsof1(self): + pari.allocatemem(20*1e6); + def do(P): + return pari.nfrootsof1(pari.nfinit(P))[0]; + + self.assertEqual(do(pari.polcyclo(23)), '46') + self.assertEqual(do(pari.polresultant('y^3*x^3-y^2*x^2+1', pari.polcyclo(23))), '46') + self.assertEqual(do('x^54+9*x^51+18*x^48-81*x^45+387*x^42-729*x^39+1953*x^36-7560*x^33+14229*x^30-12393*x^27-270*x^24+6156*' + + 'x^21+26136*x^18-77679*x^15+88452*x^12-49572*x^9+10287*x^6+972*x^3+27'), '18') + self.assertEqual(do('x^2+396735'), '2') + self.assertEqual(do('x^2+4372152'), '2') + self.assertEqual(do('x^2+x+99184'), '2') + self.assertEqual(do('x^16+2*x^15-x^14-4*x^13+x^12+4*x^11-2*x^9-3*x^8+7*x^6-9*x^4+4*x^3+4*x^2-4*x+1'), '4') + self.assertEqual(do(pari.polcyclo(68)), '68') + self.assertEqual(do(pari.polcyclo(85)), '170') + +"""**** Original expected results **** + + *** Warning: new stack size = 20000000 (19.073 Mbytes). +46 +46 +18 +2 +2 +2 +4 +68 +170 + +""" diff --git a/tests/unittests/nfsplitting.py b/tests/unittests/nfsplitting.py new file mode 100644 index 0000000..51fd635 --- /dev/null +++ b/tests/unittests/nfsplitting.py @@ -0,0 +1,136 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file nfsplitting : +nfsplitting(1) +nfsplitting(Pol(0)) +nfsplitting(Pol(1)) +nfsplitting(x) +nfsplitting(y) +nfsplitting(x^5-x-1) +nfsplitting(x^8+3) +nfsplitting(x^8+3,32) +nfsplitting(nfinit(x^8+3)) +nfsplitting(x^5+5/4*x+1) +nfsplitting(polcyclo(23)) +nfsplitting(x^7-2) +nfsplitting(x^7-2,42) +nfsplitting(x^7-2,43) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestNfsplitting(unittest.TestCase): + def test_nfsplitting(self): + with self.assertRaises(PariError) as context: + pari.nfsplitting(1) + self.assertTrue('incorrect type in checknf [please apply nfinit()] (t_INT)' in str(context.exception)) + self.assertEqual(pari.nfsplitting(pari.Pol(0)), 'x') + self.assertEqual(pari.nfsplitting(pari.Pol(1)), 'x') + self.assertEqual(pari.nfsplitting('x'), 'x') + self.assertEqual(pari.nfsplitting('y'), 'y') + self.assertEqual(pari.nfsplitting('x^5-x-1'), + 'x^120 + 900*x^116 + 508450*x^112 + 3093750*x^110 + 233445700*x^108 + 6244625000*x^106 + ' + + '86356219375*x^104 + 6147962343750*x^102 - 9942720082555*x^100 + 3349338126562500*x^98 - ' + + '1654757011326100*x^96 + 1309871930885937500*x^94 + 12436255994792015950*x^92 + 627622053' + + '389650906250*x^90 + 10990443401191124447575*x^88 + 376988045414723757750000*x^86 + 57533' + + '30797521192519076250*x^84 + 177095246957480012540937500*x^82 + 2532236050928665494862464' + + '460*x^80 + 66602887475268525125564843750*x^78 + 900151039266122540911840715400*x^76 + 17' + + '601162771342375630639534375000*x^74 + 297430062665456220256577151477075*x^72 + 293030921' + + '7240262538594060043562500*x^70 + 72799466070683508609604970583641825*x^68 + 544024340743' + + '931708706461811877750000*x^66 + 8151927872797030504655109860308253125*x^64 + 10981574462' + + '8769444357250042241632031250*x^62 + 145871391991398970515017378630342573815*x^60 + 86498' + + '58988205592244458199943754150781250*x^58 - 28260531870665143418958164521279483618600*x^5' + + '6 - 402839653919367580525292500109637748437500*x^54 + 1069538514354660399137689789326703' + + '298795450*x^52 - 117799258418763740543911272144086881778781250*x^50 + 212256674680781774' + + '826232152789145244306484575*x^48 - 1157371878847856250227888707333507692960375000*x^46 -' + + ' 60605754850991956455326492294916133973935406250*x^44 - 29318354970878696157506850322206' + + '226355212812500*x^42 + 2969007992022620344286139006599749400952695117330*x^40 + 18940874' + + '61828917373658554525792922017788446875000*x^38 - 462258652890221831497176176774279926624' + + '850728121600*x^36 - 738786176377220399331352006274159764367952001562500*x^34 - 271554668' + + '9354064625536181765731364171583296080250050*x^32 + 9040698598507624900324513465462196895' + + '3701672354656250*x^30 + 667100278192945707891486584866308021389261753860839700*x^28 + 86' + + '74210771396452568056517384098059387025568935299000000*x^26 + 398107278298882940527387841' + + '21978440350534098819581529375*x^24 + 165091395418543016833097401882144226762030772580167' + + '343750*x^22 + 274553838350348659604342993914027364500470431599325551949*x^20 + 572738904' + + '807194096228688123388737103710592833161132812500*x^18 + 68036394459331662676411724212937' + + '09690269331493886975000*x^16 + 120736725475481968058717470226213838090682189655374375000' + + '0*x^14 + 1324631954910684324357431850891744535485699735726160156250*x^12 - 2445813956434' + + '295007552447734476548803933624572506738281250*x^10 + 30971974220732698120495121990252189' + + '92726116649855468750000*x^8 + 3438517208778831606624842861577883803163997230102539062500' + + '*x^6 - 3386560639084519090735630415918618954238015795898437500000*x^4 + 1053956302799738' + + '203903123844035395633732807800292968750000*x^2 + 186560038440801791453221568534690943522' + + '3786258697509765625') + self.assertEqual(pari.nfsplitting('x^8+3'), + 'x^32 - 10356*x^24 + 127847862*x^16 - 11069073684*x^8 + 565036352721') + self.assertEqual(pari.nfsplitting('x^8+3', 32), + 'x^32 - 10356*x^24 + 127847862*x^16 - 11069073684*x^8 + 565036352721') + self.assertEqual(pari.nfsplitting(pari.nfinit('x^8+3')), + 'x^32 - 10356*x^24 + 127847862*x^16 - 11069073684*x^8 + 565036352721') + self.assertEqual(pari.nfsplitting('x^5+5/4*x+1'), 'x^10 - 30*x^8 + 325*x^6 - 1500*x^4 + 2500*x^2 + 2000') + self.assertEqual(pari.nfsplitting(pari.polcyclo(23)), 'x^22 + x^21 + x^20 + x^19 + x^18 + x^17 + x^16 + ' + + 'x^15 + x^14 + x^13 + x^12 + x^11 + x^10 + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^' + + '2 + x + 1') + self.assertEqual(pari.nfsplitting('x^7-2'), 'x^42 + 48020*x^28 + 96001584*x^14 + 52706752') + self.assertEqual(pari.nfsplitting('x^7-2', 42), 'x^42 + 48020*x^28 + 96001584*x^14 + 52706752') + self.assertEqual(pari.nfsplitting('x^7-2', 43), 'x^42 + 48020*x^28 + 96001584*x^14 + 52706752') + +"""**** Original expected results **** + + *** at top-level: nfsplitting(1) + *** ^-------------- + *** nfsplitting: incorrect type in checknf [please apply nfinit()] (t_INT). +x +x +x +y +x^120 + 900*x^116 + 508450*x^112 + 3093750*x^110 + 233445700*x^108 + 6244625 +000*x^106 + 86356219375*x^104 + 6147962343750*x^102 - 9942720082555*x^100 + +3349338126562500*x^98 - 1654757011326100*x^96 + 1309871930885937500*x^94 + 1 +2436255994792015950*x^92 + 627622053389650906250*x^90 + 10990443401191124447 +575*x^88 + 376988045414723757750000*x^86 + 5753330797521192519076250*x^84 + +177095246957480012540937500*x^82 + 2532236050928665494862464460*x^80 + 66602 +887475268525125564843750*x^78 + 900151039266122540911840715400*x^76 + 176011 +62771342375630639534375000*x^74 + 297430062665456220256577151477075*x^72 + 2 +930309217240262538594060043562500*x^70 + 72799466070683508609604970583641825 +*x^68 + 544024340743931708706461811877750000*x^66 + 815192787279703050465510 +9860308253125*x^64 + 109815744628769444357250042241632031250*x^62 + 14587139 +1991398970515017378630342573815*x^60 + 8649858988205592244458199943754150781 +250*x^58 - 28260531870665143418958164521279483618600*x^56 - 4028396539193675 +80525292500109637748437500*x^54 + 106953851435466039913768978932670329879545 +0*x^52 - 117799258418763740543911272144086881778781250*x^50 + 21225667468078 +1774826232152789145244306484575*x^48 - 1157371878847856250227888707333507692 +960375000*x^46 - 60605754850991956455326492294916133973935406250*x^44 - 2931 +8354970878696157506850322206226355212812500*x^42 + 2969007992022620344286139 +006599749400952695117330*x^40 + 18940874618289173736585545257929220177884468 +75000*x^38 - 462258652890221831497176176774279926624850728121600*x^36 - 7387 +86176377220399331352006274159764367952001562500*x^34 - 271554668935406462553 +6181765731364171583296080250050*x^32 + 9040698598507624900324513465462196895 +3701672354656250*x^30 + 6671002781929457078914865848663080213892617538608397 +00*x^28 + 8674210771396452568056517384098059387025568935299000000*x^26 + 398 +10727829888294052738784121978440350534098819581529375*x^24 + 165091395418543 +016833097401882144226762030772580167343750*x^22 + 27455383835034865960434299 +3914027364500470431599325551949*x^20 + 5727389048071940962286881233887371037 +10592833161132812500*x^18 + 680363944593316626764117242129370969026933149388 +6975000*x^16 + 1207367254754819680587174702262138380906821896553743750000*x^ +14 + 1324631954910684324357431850891744535485699735726160156250*x^12 - 24458 +13956434295007552447734476548803933624572506738281250*x^10 + 309719742207326 +9812049512199025218992726116649855468750000*x^8 + 34385172087788316066248428 +61577883803163997230102539062500*x^6 - 3386560639084519090735630415918618954 +238015795898437500000*x^4 + 105395630279973820390312384403539563373280780029 +2968750000*x^2 + 1865600384408017914532215685346909435223786258697509765625 +x^32 - 10356*x^24 + 127847862*x^16 - 11069073684*x^8 + 565036352721 +x^32 - 10356*x^24 + 127847862*x^16 - 11069073684*x^8 + 565036352721 +x^32 - 10356*x^24 + 127847862*x^16 - 11069073684*x^8 + 565036352721 +x^10 - 30*x^8 + 325*x^6 - 1500*x^4 + 2500*x^2 + 2000 +x^22 + x^21 + x^20 + x^19 + x^18 + x^17 + x^16 + x^15 + x^14 + x^13 + x^12 + + x^11 + x^10 + x^9 + x^8 + x^7 + x^6 + x^5 + x^4 + x^3 + x^2 + x + 1 +x^42 + 48020*x^28 + 96001584*x^14 + 52706752 +x^42 + 48020*x^28 + 96001584*x^14 + 52706752 + *** nfsplitting: Warning: ignoring incorrect degree bound 43. +x^42 + 48020*x^28 + 96001584*x^14 + 52706752 + +""" diff --git a/tests/unittests/norm.py b/tests/unittests/norm.py new file mode 100644 index 0000000..626c950 --- /dev/null +++ b/tests/unittests/norm.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file norm : +norml2(-1/2) +norml2(quadgen(5)) +norml2(quadgen(-3)) +normlp(-1, 1) +normlp(-1/2, 1) +normlp(I, 1) + +default(realprecision,38); +F = [x->normlp(x,1), x->normlp(x,2), x->normlp(x,2.5), normlp]; +{ + for(i=1, #F, + my(f = F[i]); + print(f); + print(f([1,-2,3])); + print(f([1,-2;-3,4])); + print(f([[1,2],[3,4],5,6])); + print(f((1+I) + I*x^2)); + print(f(-quadgen(5))); + print(f(3+4*I)); + ) +} +normlp([95800,217519,414560], 4) +normlp(-1,oo) +normlp(-1,-oo) + +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestNorm(unittest.TestCase): + def test_norm(self): + self.assertEqual(pari.norml2('-1/2'), '1/4') + with self.assertRaises(PariError) as context: + pari.norml2(pari.quadgen(5)) + self.assertTrue('incorrect type in gnorml2 (t_QUAD)' in str(context.exception)) + self.assertEqual(pari.norml2(pari.quadgen(-3)), '1') + self.assertEqual(pari.normlp(-1, 1), '1') + self.assertEqual(pari.normlp('-1/2', 1), '1/2') + self.assertEqual(pari.normlp('I', 1), '1') + + pari.set_real_precision(38) + F = [lambda x: pari.normlp(x, 1, precision=127), lambda x: pari.normlp(x, 2, precision=127), + lambda x: pari.normlp(x, '2.5', precision=127), lambda x: pari.normlp(x, precision=127)]; + + res = [['6', + '10', + '21', + '2.4142135623730950488016887242096980786', + '1.6180339887498948482045868343656381177', + '5'], + ['3.7416573867739413855837487323165493018', + '5.4772255750516611345696978280080213395', + '9.5393920141694564915262158602322654026', + '1.7320508075688772935274463415058723670', + '1.6180339887498948482045868343656381177', + '5'], + ['3.4585606563304871862271371438840799750', + '4.9402040006184485884345102892270748966', + '8.2976320964215261445777796306034959974', + '1.6273657035458510939647914767411763647', + '1.6180339887498948482045868343656381177', + '5'], + ['3', + '4', + '6', + '1.4142135623730950488016887242096980786', + '1.6180339887498948482045868343656381177', + '5.0000000000000000000000000000000000000']] + + for i in range(0, len(F)): + f = F[i] + self.assertEqual(str(f([1, -2, 3])), res[i][0]) + self.assertEqual(str(f('[1,-2;-3,4]')), res[i][1]) + self.assertEqual(str(f([[1, 2], [3, 4], 5, 6])), res[i][2]) + self.assertEqual(str(f('(1+I) + I*x^2')), res[i][3]) + self.assertEqual(str(f(-pari.quadgen(5))), res[i][4]) + self.assertEqual(str(f('3+4*I')), res[i][5]) + + self.assertEqual(str(pari.normlp([95800, 217519, 414560], 4)), '422481') + self.assertEqual(str(pari.normlp(-1, 'oo')), '1') + with self.assertRaises(PariError) as context: + pari.normlp(-1, '-oo') + self.assertTrue('domain error in normlp: p <= 0' in str(context.exception)) + + pari.set_real_precision(15) + + +"""**** Original expected results **** + +1/4 + *** at top-level: norml2(quadgen(5)) + *** ^------------------ + *** norml2: incorrect type in gnorml2 (t_QUAD). +1 +1 +1/2 +1 +(x)->normlp(x,1) +6 +10 +21 +2.4142135623730950488016887242096980786 +1.6180339887498948482045868343656381177 +5 +(x)->normlp(x,2) +3.7416573867739413855837487323165493018 +5.4772255750516611345696978280080213395 +9.5393920141694564915262158602322654026 +1.7320508075688772935274463415058723670 +1.6180339887498948482045868343656381177 +5 +(x)->normlp(x,2.5) +3.4585606563304871862271371438840799750 +4.9402040006184485884345102892270748966 +8.2976320964215261445777796306034959974 +1.6273657035458510939647914767411763647 +1.6180339887498948482045868343656381177 +5 +normlp +3 +4 +6 +1.4142135623730950488016887242096980786 +1.6180339887498948482045868343656381177 +5.0000000000000000000000000000000000000 +422481 +1 + *** at top-level: normlp(-1,-oo) + *** ^-------------- + *** normlp: domain error in normlp: p <= 0 + +""" From cfe2c5b3819075d7701b8b93a55bee85795549bd Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Mon, 2 Oct 2017 11:16:33 +0200 Subject: [PATCH 05/28] add number and pol testunits --- tests/unittests/alltest.py | 4 +- tests/unittests/number.py | 541 +++++++++++++++++++++++++++++++++++++ tests/unittests/pol.py | 155 +++++++++++ 3 files changed, 699 insertions(+), 1 deletion(-) create mode 100644 tests/unittests/number.py create mode 100644 tests/unittests/pol.py diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 6cdd9c6..7dc2d19 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -31,7 +31,9 @@ 'modular', 'nfrootsof1', 'nfsplitting', - 'norm' + 'norm', + 'number', + 'pol' ] suite = unittest.TestSuite() diff --git a/tests/unittests/number.py b/tests/unittests/number.py new file mode 100644 index 0000000..077610e --- /dev/null +++ b/tests/unittests/number.py @@ -0,0 +1,541 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file number : +HEAP=[92, if(precision(1.)==38,2736,2776)]; +default(realprecision,154); Pi; default(realprecision,38); +\e +addprimes([nextprime(10^9),nextprime(10^10)]) +bestappr(Pi,10000) +gcdext(123456789,987654321) +bigomega(12345678987654321) +binomial(1.1,5) +chinese(Mod(7,15),Mod(13,21)) +content([123,456,789,234]) +contfrac(Pi) +contfrac(Pi,5) +contfrac((exp(1)-1)/(exp(1)+1),[1,3,5,7,9]) +contfracpnqn([2,6,10,14,18,22,26]) +contfracpnqn([1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1]) +core(54713282649239) +core(54713282649239,1) +coredisc(54713282649239) +coredisc(54713282649239,1) +divisors(8!) +eulerphi(257^2) +factor(17!+1) +factor(100!+1,0) +factor(40!+1,100000) +factorback(factor(12354545545)) +factor(230873846780665851254064061325864374115500032^6) +factorcantor(x^11+1,7) +centerlift(lift(factorff(x^3+x^2+x-1,3,t^3+t^2+t-1))) +10! +factorial(10) +factormod(x^11+1,7) +factormod(x^11+1,7,1) +setrand(1);ffinit(2,11) +setrand(1);ffinit(7,4) +fibonacci(100) +gcd(12345678,87654321) +gcd(x^10-1,x^15-1) +hilbert(2/3,3/4,5) +hilbert(Mod(5,7),Mod(6,7)) +isfundamental(12345) +isprime(12345678901234567) +ispseudoprime(73!+1) +issquare(12345678987654321) +issquarefree(123456789876543219) +kronecker(5,7) +kronecker(3,18) +lcm(15,-21) +lift(chinese(Mod(7,15),Mod(4,21))) +modreverse(Mod(x^2+1,x^3-x-1)) +moebius(3*5*7*11*13) +nextprime(100000000000000000000000) +numdiv(2^99*3^49) +omega(100!) +precprime(100000000000000000000000) +prime(100) +primes(100) +qfbclassno(-12391) +qfbclassno(1345) +qfbclassno(-12391,1) +qfbclassno(1345,1) +Qfb(2,1,3)*Qfb(2,1,3) +qfbcompraw(Qfb(5,3,-1,0.),Qfb(7,1,-1,0.)) +qfbhclassno(2000003) +qfbnucomp(Qfb(2,1,9),Qfb(4,3,5),3) +form=Qfb(2,1,9);qfbnucomp(form,form,3) +qfbnupow(form,111) +qfbpowraw(Qfb(5,3,-1,0.),3) +qfbprimeform(-44,3) +qfbred(Qfb(3,10,12),,-1) +qfbred(Qfb(3,10,-20,1.5)) +qfbred(Qfb(3,10,-20,1.5),2,,18) +qfbred(Qfb(3,10,-20,1.5),1) +qfbred(Qfb(3,10,-20,1.5),3,,18) +quaddisc(-252) +quadgen(-11) +quadpoly(-11) +quadregulator(17) +quadunit(17) +sigma(100) +sigma(100,2) +sigma(100,-3) +sqrtint(10!^2+1) +znorder(Mod(33,2^16+1)) +forprime(p=2,100,print(p," ",lift(znprimroot(p)))) +znstar(3120) +if (getheap()!=HEAP, getheap()) +""" +import unittest +from cypari2 import Pari, PariError +from math import pow, factorial +from testutils import primes + +pari = Pari() + + +class TestNumber(unittest.TestCase): + def setUp(self): + pari.set_real_precision(38) + + def tearDown(self): + pari.set_real_precision(15) + + def test_number(self): + self.assertEqual(str(pari.addprimes([pari.nextprime(1e9), pari.nextprime(1e10)])), '[1000000007, 10000000019]') + self.assertEqual(str(pari.bestappr('Pi', 10000)), '355/113') + self.assertEqual(str(pari.gcdext(123456789, 987654321)), '[-8, 1, 9]') + self.assertEqual(str(pari.bigomega(12345678987654321)), '8') + self.assertEqual(str(pari.binomial('1.1', 5)), '-0.0045457500000000000000000000000000000001') + self.assertEqual(str(pari.chinese(pari.Mod(7, 15), pari.Mod(13, 21))), 'Mod(97, 105)') + self.assertEqual(str(pari.content([123, 456, 789, 234])), '3') + self.assertEqual(str(pari.divisors(factorial(8))), + '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 28, 30, 32, 35, 36, 40, ' + + '42, 45, 48, 56, 60, 63, 64, 70, 72, 80, 84, 90, 96, 105, 112, 120, 126, 128, 140, 144, 1' + + '60, 168, 180, 192, 210, 224, 240, 252, 280, 288, 315, 320, 336, 360, 384, 420, 448, 480,' + + ' 504, 560, 576, 630, 640, 672, 720, 840, 896, 960, 1008, 1120, 1152, 1260, 1344, 1440, 1' + + '680, 1920, 2016, 2240, 2520, 2688, 2880, 3360, 4032, 4480, 5040, 5760, 6720, 8064, 10080' + + ', 13440, 20160, 40320]') + self.assertEqual(str(pari.eulerphi(int(pow(257, 2)))), '65792') + self.assertEqual(str(pari.fibonacci(100)), '354224848179261915075') + self.assertEqual(str(pari.lcm(15, -21)), '105') + self.assertEqual(str(pari.lift(pari.chinese(pari.Mod(7, 15), pari.Mod(4, 21)))), '67') + self.assertEqual(str(pari.modreverse(pari.Mod('x^2+1', 'x^3-x-1'))), + 'Mod(x^2 - 3*x + 2, x^3 - 5*x^2 + 8*x - 5)') + self.assertEqual(str(pari.moebius(3 * 5 * 7 * 11 * 13)), '-1') + self.assertEqual(str(pari.numdiv('2^99*3^49')), '5000') + self.assertEqual(str(pari.omega(factorial(100))), '25') + self.assertEqual(str(pari.sqrtint('10!^2+1')), '3628800') + self.assertEqual(str(pari.znorder(pari.Mod(33, '2^16+1'))), '2048') + res = ['1', '2', '2', '3', '2', '2', '3', '2', '5', '2', '3', '2', '6', '3', '5', '2', + '2', '2', '2', '7', '5', '3', '2', '3', '5'] + i = 0 + for p in primes(100): + self.assertEquals(pari.lift(pari.znprimroot(p)), res[i]) + i += 1 + self.assertEqual(str(pari.znstar(3120)), '[768, [12, 4, 4, 2, 2], [Mod(2641, 3120), Mod(2497,' + + ' 3120), Mod(2341, 3120), Mod(1951, 3120), Mod(2081, 3120)]]') + + def test_primes(self): + self.assertEqual(str(pari.nextprime(100000000000000000000000)), '100000000000000000000117') + self.assertEqual(str(pari.precprime(100000000000000000000000)), '99999999999999999999977') + self.assertEqual(str(pari.prime(100)), '541') + self.assertEqual(str(pari.primes(100)), + '[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83,' + + ' 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179,' + + ' 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 27' + + '7, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, ' + + '389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491' + + ', 499, 503, 509, 521, 523, 541]') + + def test_contfrac(self): + self.assertEqual(str(pari.contfrac('Pi')), '[3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2' + + ', 2, 2, 1, 84, 2, 1, 1, 15, 3, 13, 1, 4, 2, 6, 6]') + self.assertEqual(str(pari.contfrac('Pi', 5)), '[3, 7, 15, 1, 292]') + self.assertEqual(str(pari.contfrac((pari.exp(1) - 1) / (pari.exp(1) + 1), [1, 3, 5, 7, 9])), + '[0, 6, 10, 42, 30]') + + def test_contfracpnqn(self): + self.assertEqual(str(pari.contfracpnqn([2, 6, 10, 14, 18, 22, 26])), '[19318376, 741721; 8927353, 342762]') + self.assertEqual(str(pari.contfracpnqn('[1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1]')), '[34, 21; 21, 13]') + + def test_core(self): + self.assertEqual(str(pari.core(54713282649239)), '5471') + self.assertEqual(str(pari.core(54713282649239, 1)), '[5471, 100003]') + + def test_coredisc(self): + self.assertEqual(str(pari.coredisc(54713282649239)), '21884') + self.assertEqual(str(pari.coredisc(54713282649239, 1)), '[21884, 100003/2]') + + def test_factor(self): + self.assertEqual(str(pari.factor(factorial(17) + 1)), '[661, 1; 537913, 1; 1000357, 1]') + self.assertEqual(str(pari.factor(factorial(100) + 1, 0)), + '[101, 1; 14303, 1; 149239, 1; 4328852738498929626130718009186589490596793086850244817957' + + '4076552756849301072702375746139749880098152144087781328865783919562249722562149942762845' + + '3, 1]') + self.assertEqual(str(pari.factor(factorial(40) + 1, 100000)), + '[41, 1; 59, 1; 277, 1; 1217669507565553887239873369513188900554127, 1]') + self.assertEqual(str(pari.factorback(pari.factor(12354545545))), '12354545545') + self.assertEqual(str(pari.factor('230873846780665851254064061325864374115500032^6')), + '[2, 120; 3, 6; 7, 6; 23, 6; 29, 6; 500501, 36]') + self.assertEqual(str(pari.factorcantor('x^11+1', 7)), '[Mod(1, 7)*x + Mod(1, 7), 1; Mod(1, 7)*x^10 + ' + + 'Mod(6, 7)*x^9 + Mod(1, 7)*x^8 + Mod(6, 7)*x^7 + Mod(1, 7)*x^6 + Mod(6, 7)*x^5 + Mo' + + 'd(1, 7)*x^4 + Mod(6, 7)*x^3 + Mod(1, 7)*x^2 + Mod(6, 7)*x + Mod(1, 7), 1]') + self.assertEqual(str(pari.centerlift(pari.lift(pari.factorff('x^3+x^2+x-1', 3, 't^3+t^2+t-1')))), + '[x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]') + self.assertEqual(str(pari('10!')), '3628800') + self.assertEqual(str(pari.factorial(10)), '3628800.0000000000000000000000000000000') + + def test_factormod(self): + self.assertEqual(str(pari.factormod('x^11+1', 7)), + '[Mod(1, 7)*x + Mod(1, 7), 1; Mod(1, 7)*x^10 + Mod(6, 7)*x^9 + Mod(1, 7)*x^8 + Mod(6, 7)*' + + 'x^7 + Mod(1, 7)*x^6 + Mod(6, 7)*x^5 + Mod(1, 7)*x^4 + Mod(6, 7)*x^3 + Mod(1, 7)*x^2 + Mo' + + 'd(6, 7)*x + Mod(1, 7), 1]') + self.assertEqual(str(pari.factormod('x^11+1', 7, 1)), '[1, 1; 10, 1]') + + def test_ffinit(self): + pari.setrand(1); + self.assertEqual(str(pari.ffinit(2, 11)), + 'Mod(1, 2)*x^11 + Mod(1, 2)*x^10 + Mod(1, 2)*x^8 + Mod(1, 2)*x^4 + Mod(1, 2)*x^3' + + ' + Mod(1, 2)*x^2 + Mod(1, 2)') + pari.setrand(1); + self.assertEqual(str(pari.ffinit(7, 4)), + 'Mod(1, 7)*x^4 + Mod(1, 7)*x^3 + Mod(1, 7)*x^2 + Mod(1, 7)*x + Mod(1, 7)') + + def test_gcd(self): + self.assertEqual(str(pari.gcd(12345678, 87654321)), '9') + self.assertEqual(str(pari.gcd('x^10-1', 'x^15-1')), 'x^5 - 1') + + def test_hilbert(self): + self.assertEqual(str(pari.hilbert('2/3', '3/4', 5)), '1') + self.assertEqual(str(pari.hilbert(pari.Mod(5, 7), pari.Mod(6, 7))), '1') + + def test_booleanfct(self): + self.assertTrue(pari.isfundamental(12345)) + self.assertFalse(pari.isprime(12345678901234567)) + self.assertTrue(pari.ispseudoprime(factorial(73) + 1)) + self.assertTrue(pari(12345678987654321).issquare()) + self.assertFalse(pari.issquarefree(123456789876543219)) + + def test_kronecker(self): + self.assertEqual(str(pari.kronecker(5, 7)), '-1') + self.assertEqual(str(pari.kronecker(3, 18)), '0') + + def test_qfbclassno(self): + self.assertEqual(str(pari.qfbclassno(-12391)), '63') + self.assertEqual(str(pari.qfbclassno(1345)), '6') + self.assertEqual(str(pari.qfbclassno(-12391, 1)), '63') + self.assertEqual(str(pari.qfbclassno(1345, 1)), '6') + + def test_qfb(self): + self.assertEqual(str(pari.Qfb(2, 1, 3) * pari.Qfb(2, 1, 3)), 'Qfb(2, -1, 3)') + self.assertEqual(str(pari.qfbcompraw(pari.Qfb(5, 3, -1, '0.'), pari.Qfb(7, 1, -1, '0.'))), + 'Qfb(35, 43, 13, 0.E-38)') + self.assertEqual(str(pari.qfbhclassno(2000003)), '357') + self.assertEqual(str(pari.qfbnucomp(pari.Qfb(2, 1, 9), pari.Qfb(4, 3, 5), 3)), 'Qfb(2, -1, 9)') + form = pari.Qfb(2, 1, 9); + self.assertEqual(str(pari.qfbnucomp(form, form, 3)), 'Qfb(4, -3, 5)') + self.assertEqual(str(pari.qfbnupow(form, 111)), 'Qfb(2, -1, 9)') + self.assertEqual(str(pari.qfbpowraw(pari.Qfb(5, 3, -1, '0.'), 3)), 'Qfb(125, 23, 1, 0.E-38)') + self.assertEqual(str(pari.qfbprimeform(-44, 3)), 'Qfb(3, 2, 4)') + + def test_qfbred(self): + self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, 12), 0, -1)), 'Qfb(3, -2, 4)') + self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=127))), + 'Qfb(3, 16, -7, 1.5000000000000000000000000000000000000)') + self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=127), 2, None, 18)), + 'Qfb(3, 16, -7, 1.5000000000000000000000000000000000000)') + self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=127), 1)), + 'Qfb(-20, -10, 3, 2.1074451073987839947135880252731470616)') + self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=127), 3, None, 18)), + 'Qfb(-20, -10, 3, 1.5000000000000000000000000000000000000)') + + def test_quadfct(self): + self.assertEqual(str(pari.quaddisc(-252)), '-7') + self.assertEqual(str(pari.quadgen(-11)), 'w') + self.assertEqual(str(pari.quadpoly(-11)), 'x^2 - x + 3') + self.assertEqual(str(pari.quadregulator(17, precision=127)), '2.0947125472611012942448228460655286535') + self.assertEqual(str(pari.quadunit(17)), '3 + 2*w') + + def test_sigma(self): + self.assertEqual(str(pari.sigma(100)), '217') + self.assertEqual(str(pari.sigma(100, 2)), '13671') + self.assertEqual(str(pari.sigma(100, -3)), '1149823/1000000') + +"""**** Original expected results **** + + echo = 1 (on) +? addprimes([nextprime(10^9),nextprime(10^10)]) +[1000000007, 10000000019] +? bestappr(Pi,10000) +355/113 +? gcdext(123456789,987654321) +[-8, 1, 9] +? bigomega(12345678987654321) +8 +? binomial(1.1,5) +-0.0045457500000000000000000000000000000001 +? chinese(Mod(7,15),Mod(13,21)) +Mod(97, 105) +? content([123,456,789,234]) +3 +? contfrac(Pi) +[3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2, 2, 2, 1, 84, 2, 1 +, 1, 15, 3, 13, 1, 4, 2, 6, 6] +? contfrac(Pi,5) +[3, 7, 15, 1, 292] +? contfrac((exp(1)-1)/(exp(1)+1),[1,3,5,7,9]) +[0, 6, 10, 42, 30] +? contfracpnqn([2,6,10,14,18,22,26]) + +[19318376 741721] + +[ 8927353 342762] + +? contfracpnqn([1,1,1,1,1,1,1,1;1,1,1,1,1,1,1,1]) + +[34 21] + +[21 13] + +? core(54713282649239) +5471 +? core(54713282649239,1) +[5471, 100003] +? coredisc(54713282649239) +21884 +? coredisc(54713282649239,1) +[21884, 100003/2] +? divisors(8!) +[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 28, 30, 32, +35, 36, 40, 42, 45, 48, 56, 60, 63, 64, 70, 72, 80, 84, 90, 96, 105, 112, 12 +0, 126, 128, 140, 144, 160, 168, 180, 192, 210, 224, 240, 252, 280, 288, 315 +, 320, 336, 360, 384, 420, 448, 480, 504, 560, 576, 630, 640, 672, 720, 840, + 896, 960, 1008, 1120, 1152, 1260, 1344, 1440, 1680, 1920, 2016, 2240, 2520, + 2688, 2880, 3360, 4032, 4480, 5040, 5760, 6720, 8064, 10080, 13440, 20160, +40320] +? eulerphi(257^2) +65792 +? factor(17!+1) + +[ 661 1] + +[ 537913 1] + +[1000357 1] + +? factor(100!+1,0) + +[101 1] + +[14303 1] + +[149239 1] + +[432885273849892962613071800918658949059679308685024481795740765527568493010 +727023757461397498800981521440877813288657839195622497225621499427628453 1] + +? factor(40!+1,100000) + +[ 41 1] + +[ 59 1] + +[ 277 1] + +[1217669507565553887239873369513188900554127 1] + +? factorback(factor(12354545545)) +12354545545 +? factor(230873846780665851254064061325864374115500032^6) + +[ 2 120] + +[ 3 6] + +[ 7 6] + +[ 23 6] + +[ 29 6] + +[500501 36] + +? factorcantor(x^11+1,7) + +[Mod(1, 7)*x + Mod(1, 7) 1] + +[Mod(1, 7)*x^10 + Mod(6, 7)*x^9 + Mod(1, 7)*x^8 + Mod(6, 7)*x^7 + Mod(1, 7)* +x^6 + Mod(6, 7)*x^5 + Mod(1, 7)*x^4 + Mod(6, 7)*x^3 + Mod(1, 7)*x^2 + Mod(6, + 7)*x + Mod(1, 7) 1] + +? centerlift(lift(factorff(x^3+x^2+x-1,3,t^3+t^2+t-1))) + +[ x - t 1] + +[x + (t^2 + t - 1) 1] + +[ x + (-t^2 - 1) 1] + +? 10! +3628800 +? factorial(10) +3628800.0000000000000000000000000000000 +? factormod(x^11+1,7) + +[Mod(1, 7)*x + Mod(1, 7) 1] + +[Mod(1, 7)*x^10 + Mod(6, 7)*x^9 + Mod(1, 7)*x^8 + Mod(6, 7)*x^7 + Mod(1, 7)* +x^6 + Mod(6, 7)*x^5 + Mod(1, 7)*x^4 + Mod(6, 7)*x^3 + Mod(1, 7)*x^2 + Mod(6, + 7)*x + Mod(1, 7) 1] + +? factormod(x^11+1,7,1) + +[ 1 1] + +[10 1] + +? setrand(1);ffinit(2,11) +Mod(1, 2)*x^11 + Mod(1, 2)*x^10 + Mod(1, 2)*x^8 + Mod(1, 2)*x^4 + Mod(1, 2)* +x^3 + Mod(1, 2)*x^2 + Mod(1, 2) +? setrand(1);ffinit(7,4) +Mod(1, 7)*x^4 + Mod(1, 7)*x^3 + Mod(1, 7)*x^2 + Mod(1, 7)*x + Mod(1, 7) +? fibonacci(100) +354224848179261915075 +? gcd(12345678,87654321) +9 +? gcd(x^10-1,x^15-1) +x^5 - 1 +? hilbert(2/3,3/4,5) +1 +? hilbert(Mod(5,7),Mod(6,7)) +1 +? isfundamental(12345) +1 +? isprime(12345678901234567) +0 +? ispseudoprime(73!+1) +1 +? issquare(12345678987654321) +1 +? issquarefree(123456789876543219) +0 +? kronecker(5,7) +-1 +? kronecker(3,18) +0 +? lcm(15,-21) +105 +? lift(chinese(Mod(7,15),Mod(4,21))) +67 +? modreverse(Mod(x^2+1,x^3-x-1)) +Mod(x^2 - 3*x + 2, x^3 - 5*x^2 + 8*x - 5) +? moebius(3*5*7*11*13) +-1 +? nextprime(100000000000000000000000) +100000000000000000000117 +? numdiv(2^99*3^49) +5000 +? omega(100!) +25 +? precprime(100000000000000000000000) +99999999999999999999977 +? prime(100) +541 +? primes(100) +[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, + 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, +157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 2 +39, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 33 +1, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421 +, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, + 521, 523, 541] +? qfbclassno(-12391) +63 +? qfbclassno(1345) +6 +? qfbclassno(-12391,1) +63 +? qfbclassno(1345,1) +6 +? Qfb(2,1,3)*Qfb(2,1,3) +Qfb(2, -1, 3) +? qfbcompraw(Qfb(5,3,-1,0.),Qfb(7,1,-1,0.)) +Qfb(35, 43, 13, 0.E-38) +? qfbhclassno(2000003) +357 +? qfbnucomp(Qfb(2,1,9),Qfb(4,3,5),3) +Qfb(2, -1, 9) +? form=Qfb(2,1,9);qfbnucomp(form,form,3) +Qfb(4, -3, 5) +? qfbnupow(form,111) +Qfb(2, -1, 9) +? qfbpowraw(Qfb(5,3,-1,0.),3) +Qfb(125, 23, 1, 0.E-38) +? qfbprimeform(-44,3) +Qfb(3, 2, 4) +? qfbred(Qfb(3,10,12),,-1) +Qfb(3, -2, 4) +? qfbred(Qfb(3,10,-20,1.5)) +Qfb(3, 16, -7, 1.5000000000000000000000000000000000000) +? qfbred(Qfb(3,10,-20,1.5),2,,18) +Qfb(3, 16, -7, 1.5000000000000000000000000000000000000) +? qfbred(Qfb(3,10,-20,1.5),1) +Qfb(-20, -10, 3, 2.1074451073987839947135880252731470616) +? qfbred(Qfb(3,10,-20,1.5),3,,18) +Qfb(-20, -10, 3, 1.5000000000000000000000000000000000000) +? quaddisc(-252) +-7 +? quadgen(-11) +w +? quadpoly(-11) +x^2 - x + 3 +? quadregulator(17) +2.0947125472611012942448228460655286535 +? quadunit(17) +3 + 2*w +? sigma(100) +217 +? sigma(100,2) +13671 +? sigma(100,-3) +1149823/1000000 +? sqrtint(10!^2+1) +3628800 +? znorder(Mod(33,2^16+1)) +2048 +? forprime(p=2,100,print(p," ",lift(znprimroot(p)))) +2 1 +3 2 +5 2 +7 3 +11 2 +13 2 +17 3 +19 2 +23 5 +29 2 +31 3 +37 2 +41 6 +43 3 +47 5 +53 2 +59 2 +61 2 +67 2 +71 7 +73 5 +79 3 +83 2 +89 3 +97 5 +? znstar(3120) +[768, [12, 4, 4, 2, 2], [Mod(2641, 3120), Mod(2497, 3120), Mod(2341, 3120), +Mod(1951, 3120), Mod(2081, 3120)]] +? if(getheap()!=HEAP,getheap()) + +""" diff --git a/tests/unittests/pol.py b/tests/unittests/pol.py new file mode 100644 index 0000000..5fa9d49 --- /dev/null +++ b/tests/unittests/pol.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file pol : +o = [Mod(0,3),y,1/y, (y^2+1)/y, [1,2,3], Vecsmall([1,2,0]), Qfb(1,2,4), Qfb(1,2,-4), y+2*y^2+O(y^4)]; +{ + for (i=1,#o, + my (v = o[i]); + printsep(" ", Pol(v,y), Pol(v,x), Polrev(v)); + printsep(" ", Ser(v,y), Ser(v,x), Ser(v,,5)); + ) +} +o = [2*x+3*y, 2+x+y+O(x^2), 2+x+y+O(y^2)]; +{ + for (i=1,#o, + my (v = o[i]); + printsep(" ",pollead(v), pollead(v,x), pollead(v,y)) + ) +} +pollead(z,y) +pollead(y,z) +polgraeffe(x^2+x+1) +polgraeffe(x^3+x+1) +polsym(2*x^4+1,4) +norm(I*x+1) +trace(I*x+1) +matcompanion(2*x^2+1) +Pol("") +serlaplace(1+x+x^2) +serlaplace(x^2+x^3) + +\\#1651 +f1=(x-1)/(x*x-x); +type(subst(1/f1,x,1)) + +\\#1690 +default(realprecision,38); +P(x,y)=(x+1)*y^2+(x^2-x+1)*y+(x^2+x); +polroots(P(exp(I*Pi),y)) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestPol(unittest.TestCase): + def test_pol(self): + o = [pari.Mod(0,3), 'y', '1/y', '(y^2+1)/y', [1,2,3], pari.Vecsmall([1,2,0]), + pari.Qfb(1,2,4), pari.Qfb(1,2,-4), 'y+2*y^2+O(y^4)']; + res_pol =['Mod(0, 3) Mod(0, 3) Mod(0, 3)', + 'y x x', + '0 0 0', + 'y x x', + 'y^2 + 2*y + 3 x^2 + 2*x + 3 3*x^2 + 2*x + 1', + 'y^2 + 2*y x^2 + 2*x 2*x + 1', + 'y^2 + 2*y + 4 x^2 + 2*x + 4 4*x^2 + 2*x + 1', + 'y^2 + 2*y - 4 x^2 + 2*x - 4 -4*x^2 + 2*x + 1', + '2*y^2 + y 2*x^2 + x 2*x^2 + x'] + + res_ser = ['Mod(0, 3)*y^15 + O(y^16) Mod(0, 3)*x^15 + O(x^16) Mod(0, 3)*x^4 + O(x^5)', + 'y + O(y^17) y + O(x^16) y + O(x^5)', + 'y^-1 + O(y^15) 1/y + O(x^16) 1/y + O(x^5)', + 'y^-1 + y + O(y^15) ((y^2 + 1)/y) + O(x^16) ((y^2 + 1)/y) + O(x^5)', + '1 + 2*y + 3*y^2 + O(y^3) 1 + 2*x + 3*x^2 + O(x^3) 1 + 2*x + 3*x^2 + O(x^3)', + '1 + 2*y + O(y^3) 1 + 2*x + O(x^3) 1 + 2*x + O(x^3)', + '1 + 2*y + 4*y^2 + O(y^3) 1 + 2*x + 4*x^2 + O(x^3) 1 + 2*x + 4*x^2 + O(x^3)', + '1 + 2*y - 4*y^2 + O(y^3) 1 + 2*x - 4*x^2 + O(x^3) 1 + 2*x - 4*x^2 + O(x^3)', + 'y + 2*y^2 + O(y^4) (y + 2*y^2 + O(y^4)) + O(x^16) (y + 2*y^2 + O(y^4)) + O(x^5)'] + + for i in range(0, len(o)): + v = o[i] + self.assertEquals('%s %s %s' % (pari.Pol(v, 'y'), pari.Pol(v, 'x'), pari.Polrev(v)), res_pol[i]) + self.assertEquals('%s %s %s' % (pari.Ser(v, 'y'), pari.Ser(v, 'x'), pari.Ser(v, None, 5)), res_ser[i]) + + self.assertEquals(pari.polsym('2*x^4+1', 4), '[4, 0, 0, 0, -2]~') + self.assertEquals(pari.norm('I*x+1'), 'x^2 + 1') + self.assertEquals(pari.trace('I*x+1'), '2') + self.assertEquals(pari.matcompanion('2*x^2+1'), '[0, -1/2; 1, 0]') + with self.assertRaises(PariError) as context: + pari.Pol('""') + self.assertTrue('incorrect type in gtopoly (t_STR)' in str(context.exception)) + # #1651 + self.assertEquals(pari.type(pari.subst('1/((x-1)/(x*x-x))', 'x', 1)), '"t_INT"') + + # #1690 + # pari.set_real_precision(38) + # P(x,y)=(x+1)*y^2+(x^2-x+1)*y+(x^2+x); + # pari.polroots(P(pari.exp(I*Pi),y)) + # pari.set_real_precision(15) + + def test_pollead(self): + o = ['2*x+3*y', '2+x+y+O(x^2)', '2+x+y+O(y^2)']; + res_pollead = ['2 2 3', 'y + 2 y + 2 x + 2', '1 1 x + 2'] + for i in range(0, len(o)): + v = o[i] + self.assertEquals('%s %s %s' % (pari.pollead(v), pari.pollead(v,'x'), pari.pollead(v,'y')), res_pollead[i]) + + self.assertEquals(pari.pollead('z', 'y'), 'z') + self.assertEquals(pari.pollead('y', 'z'), 'y') + + def test_polgraeffe(self): + self.assertEquals(pari.polgraeffe('x^2+x+1'), 'x^2 + x + 1') + self.assertEquals(pari.polgraeffe('x^3+x+1'), '-x^3 - 2*x^2 - x + 1') + + def test_serplace(self): + self.assertEquals(pari.serlaplace('1+x+x^2'), '2*x^2 + x + 1') + self.assertEquals(pari.serlaplace('x^2+x^3'), '6*x^3 + 2*x^2') + +"""**** Original expected results **** + +Mod(0, 3) Mod(0, 3) Mod(0, 3) +Mod(0, 3)*y^15 + O(y^16) Mod(0, 3)*x^15 + O(x^16) Mod(0, 3)*x^4 + O(x^5) +y x x +y + O(y^17) y + O(x^16) y + O(x^5) +0 0 0 +y^-1 + O(y^15) 1/y + O(x^16) 1/y + O(x^5) +y x x +y^-1 + y + O(y^15) ((y^2 + 1)/y) + O(x^16) ((y^2 + 1)/y) + O(x^5) +y^2 + 2*y + 3 x^2 + 2*x + 3 3*x^2 + 2*x + 1 +1 + 2*y + 3*y^2 + O(y^3) 1 + 2*x + 3*x^2 + O(x^3) 1 + 2*x + 3*x^2 + O(x^3) +y^2 + 2*y x^2 + 2*x 2*x + 1 +1 + 2*y + O(y^3) 1 + 2*x + O(x^3) 1 + 2*x + O(x^3) +y^2 + 2*y + 4 x^2 + 2*x + 4 4*x^2 + 2*x + 1 +1 + 2*y + 4*y^2 + O(y^3) 1 + 2*x + 4*x^2 + O(x^3) 1 + 2*x + 4*x^2 + O(x^3) +y^2 + 2*y - 4 x^2 + 2*x - 4 -4*x^2 + 2*x + 1 +1 + 2*y - 4*y^2 + O(y^3) 1 + 2*x - 4*x^2 + O(x^3) 1 + 2*x - 4*x^2 + O(x^3) +2*y^2 + y 2*x^2 + x 2*x^2 + x +y + 2*y^2 + O(y^4) (y + 2*y^2 + O(y^4)) + O(x^16) (y + 2*y^2 + O(y^4)) + O(x +^5) +2 2 3 +y + 2 y + 2 x + 2 +1 1 x + 2 +z +y +x^2 + x + 1 +-x^3 - 2*x^2 - x + 1 +[4, 0, 0, 0, -2]~ +x^2 + 1 +2 + +[0 -1/2] + +[1 0] + + *** at top-level: Pol("") + *** ^------- + *** Pol: incorrect type in gtopoly (t_STR). +2*x^2 + x + 1 +6*x^3 + 2*x^2 +"t_INT" + *** polroots: Warning: normalizing a polynomial with 0 leading term. +[0.E-38 + 0.E-38*I]~ + +""" From 6d9c0702eb1c604ce428824ad45b3d825fa1c08e Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Tue, 3 Oct 2017 17:27:36 +0200 Subject: [PATCH 06/28] Add tests for several files: prec, prime, primes, qfb, qfbclassno, qfsolve, quadray --- tests/unittests/alltest.py | 9 +- tests/unittests/prec.py | 117 ++ tests/unittests/prime.py | 58 + tests/unittests/primes.py | 64 + tests/unittests/qfb.py | 134 ++ tests/unittests/qfbclassno.py | 67 + tests/unittests/qfsolve.py | 1394 +++++++++++++++++++++ tests/unittests/quadray.py | 2219 +++++++++++++++++++++++++++++++++ 8 files changed, 4061 insertions(+), 1 deletion(-) create mode 100644 tests/unittests/prec.py create mode 100644 tests/unittests/prime.py create mode 100644 tests/unittests/primes.py create mode 100644 tests/unittests/qfb.py create mode 100644 tests/unittests/qfbclassno.py create mode 100644 tests/unittests/qfsolve.py create mode 100644 tests/unittests/quadray.py diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 7dc2d19..383f77a 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -33,7 +33,14 @@ 'nfsplitting', 'norm', 'number', - 'pol' + 'pol', + 'prec', + 'prime', + 'primes', + 'qfb', + 'qfbclassno', + 'qfsolve', + 'quadray' ] suite = unittest.TestSuite() diff --git a/tests/unittests/prec.py b/tests/unittests/prec.py new file mode 100644 index 0000000..a3c541d --- /dev/null +++ b/tests/unittests/prec.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file prec : +precision(0) +bitprecision(0) +precision(I,3) +default(realprecision,38); +t=(precision(1.,77)*x+1); +precision(t) +localprec(57);precision(1.) +localbitprec(128);bitprecision(1.) +bitprecision(1 + O(x), 10) +bitprecision(1 + O(3^5), 10) +bitprecision(1, 10) +precision(1./t) +precision(Qfb(1,0,-2)); + +serprec(1,x) +serprec(x+O(x^3),x) +serprec(x+O(x^3),y) +serprec((1+O(y^2))*x+y + O(y^3), y) + +padicprec(0,2) +padicprec(0,"") +padicprec(1,2) == padicprec(0,2) +padicprec(1/2,2)== padicprec(0,2) +padicprec(Mod(1,9),3) +padicprec(O(2^2),3) +padicprec(O(2^2),2) +t=1+O(2^3); +padicprec(t,2) +padicprec((x+2)*t, 2) +padicprec((1+2*x+O(x^2))*t, 2) +padicprec([2,4]*t, 2) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestPrec(unittest.TestCase): + def test_prec(self): + self.assertEquals(pari.precision(0), '+oo') + self.assertEquals(pari.bitprecision(0), '+oo') + self.assertEquals(pari.precision('I', 3), 'I') + pari.set_real_precision(38) + t = pari('precision(1.,77)*x+1'); + self.assertEquals(pari.precision(t), '77') + pari.localprec(57); + self.assertEquals(pari.precision('1.'), '57') + pari.localbitprec(128); + self.assertEquals(pari.bitprecision('1.'), '128') + self.assertEquals(pari.bitprecision('1 + O(x)', 10), '1 + O(x)') + self.assertEquals(pari.bitprecision('1 + O(3^5)', 10), '1 + O(3^5)') + self.assertEquals(pari.bitprecision(1, 10), '1') + self.assertEquals(pari.precision('1./t'), '38') + pari.precision(pari.Qfb(1, 0, -2)); + + def test_serprec(self): + self.assertEquals(pari.serprec(1, 'x'), '+oo') + self.assertEquals(pari.serprec('x+O(x^3)', 'x'), '3') + self.assertEquals(pari.serprec('x+O(x^3)', 'y'), '+oo') + self.assertEquals(pari.serprec('(1+O(y^2))*x+y + O(y^3)', 'y'), '2') + + def test_padicprec(self): + self.assertEquals(pari.padicprec(0, 2), '+oo') + with self.assertRaises(PariError) as context: + pari.padicprec(0, '""') + self.assertTrue('incorrect type in padicprec (t_STR)' in str(context.exception)) + self.assertEquals(pari.padicprec(1, 2), pari.padicprec(0, 2)) + self.assertEquals(pari.padicprec('1/2', 2), pari.padicprec(0, 2)) + self.assertEquals(pari.padicprec(pari.Mod(1, 9), 3), '2') + with self.assertRaises(PariError) as context: + pari.padicprec('O(2^2)', 3) + self.assertTrue('inconsistent moduli in padicprec: 2 != 3' in str(context.exception)) + self.assertEquals(pari.padicprec('O(2^2)', 2), '2') + t = '1+O(2^3)'; + self.assertEquals(pari.padicprec(t, 2), '3') + self.assertEquals(pari.padicprec('(x+2)*(1+O(2^3))', 2), '3') + self.assertEquals(pari.padicprec('(1+2*x+O(x^2))*(1+O(2^3))', 2), '3') + self.assertEquals(pari.padicprec('[2,4]*(1+O(2^3))', 2), '4') + pari.set_real_precision(15) +"""**** Original expected results **** + ++oo ++oo +I +77 +57 +128 +1 + O(x) +1 + O(3^5) +1 +38 ++oo +3 ++oo +2 ++oo + *** at top-level: padicprec(0,"") + *** ^--------------- + *** padicprec: incorrect type in padicprec (t_STR). +1 +1 +2 + *** at top-level: padicprec(O(2^2),3) + *** ^------------------- + *** padicprec: inconsistent moduli in padicprec: 2 != 3 +2 +3 +3 +3 +4 + +""" diff --git a/tests/unittests/prime.py b/tests/unittests/prime.py new file mode 100644 index 0000000..b04d7f1 --- /dev/null +++ b/tests/unittests/prime.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file prime : +test(N)= +{ + default(primelimit, N); + for (b=10, 20, print1(prime(2^b), " ")); + for (b=10, 26, print1(primepi(2^b), " ")); +} + +test(10^6); +test(10^8); +primepi(2^32) +precprime(1) +primepi(2750160) \\ #1855 +""" +import unittest +from cypari2 import Pari, PariError +from math import pow + +pari = Pari() + + +class TestPrime(unittest.TestCase): + def test_prime(self): + def test(N, res_prime, res_primepi): + pari.default('primelimit', N); + for b in range(10, 21): + self.assertEquals(pari.prime(pow(2, b)), res_prime[b - 10]) + for b in range(10, 27): + self.assertEquals(pari.primepi(pow(2, b)), res_primepi[b - 10]) + + res = ['8161', '17863', '38873', '84017', '180503', '386093', + '821641', '1742537', '3681131', '7754077', '16290047'] + res_pi=['172', '309', '564', '1028', '1900', '3512', '6542', + '12251', '23000', '43390', '82025', '155611', '295947', + '564163', '1077871', '2063689', '3957809'] + + test(int(pow(10, 6)), res, res_pi); + test(int(pow(10, 8)), res, res_pi); + self.assertEquals(pari.primepi(pow(2, 32)), '203280221') + self.assertEquals(pari.precprime(1), '0') + self.assertEquals(pari.primepi(2750160), '200000') # #1855 + +"""**** Original expected results **** + +8161 17863 38873 84017 180503 386093 821641 1742537 3681131 7754077 16290047 + 172 309 564 1028 1900 3512 6542 12251 23000 43390 82025 155611 295947 56416 +3 1077871 2063689 3957809 +8161 17863 38873 84017 180503 386093 821641 1742537 3681131 7754077 16290047 + 172 309 564 1028 1900 3512 6542 12251 23000 43390 82025 155611 295947 56416 +3 1077871 2063689 3957809 +203280221 +0 +200000 + +""" diff --git a/tests/unittests/primes.py b/tests/unittests/primes.py new file mode 100644 index 0000000..e72a840 --- /dev/null +++ b/tests/unittests/primes.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file primes : +primes(50) +primes([-5,5]) +primes([10,20]) +primes([2^32-100,2^32+100]) +primes([2^64-100,2^64+100]) +#primes([2^50,2^50+200000]) +#primes([10^7, 10^7+10^6]) +#primes([2^1023+5000, 2^1023+7000]) +\\#1668 +primes([1,Pol(2)]); +""" +import unittest +from cypari2 import Pari, PariError +from math import pow + +pari = Pari() + + +class TestPrimes(unittest.TestCase): + def test_primes(self): + self.assertEquals(pari.primes(50), + '[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83,' + + ' 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179,' + + ' 181, 191, 193, 197, 199, 211, 223, 227, 229]') + self.assertEquals(pari.primes([-5, 5]), '[2, 3, 5]') + self.assertEquals(pari.primes([10, 20]), '[11, 13, 17, 19]') + self.assertEquals(pari.primes([pow(2, 32) - 100, pow(2, 32) + 100]), + '[4294967197, 4294967231, 4294967279, 4294967291, 4294967311, 4294967357, 4294967371, 429' + + '4967377, 4294967387, 4294967389]') + self.assertEquals(pari.primes(['2^64-100', '2^64+100']), + '[18446744073709551521, 18446744073709551533, 18446744073709551557, 18446744073709551629,' + + ' 18446744073709551653, 18446744073709551667, 18446744073709551697, 18446744073709551709]') + self.assertEquals(len(pari.primes([pow(2, 50), pow(2, 50) + 200000])), 5758) + self.assertEquals(len(pari.primes([pow(10, 7), pow(10, 7) + pow(10, 6)])), 61938) + self.assertEquals(len(pari.primes(['2^1023+5000', '2^1023+7000'])), 2) + with self.assertRaises(PariError) as context: + pari.primes([1, pari.Pol(2)]) + self.assertTrue('incorrect type in primes_interval (t_POL)' in str(context.exception)) + + +"""**** Original expected results **** + +[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, + 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, +157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229] +[2, 3, 5] +[11, 13, 17, 19] +[4294967197, 4294967231, 4294967279, 4294967291, 4294967311, 4294967357, 429 +4967371, 4294967377, 4294967387, 4294967389] +[18446744073709551521, 18446744073709551533, 18446744073709551557, 184467440 +73709551629, 18446744073709551653, 18446744073709551667, 1844674407370955169 +7, 18446744073709551709] +5758 +61938 +2 + *** at top-level: primes([1,Pol(2)]) + *** ^------------------ + *** primes: incorrect type in primes_interval (t_POL). + +""" diff --git a/tests/unittests/qfb.py b/tests/unittests/qfb.py new file mode 100644 index 0000000..7ec42ac --- /dev/null +++ b/tests/unittests/qfb.py @@ -0,0 +1,134 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file qfb : +vec(x) = [component(x,1), component(x,2), component(x,3)]; +vec( qfbred(Qfb(6,6,-1),1) ) +default(realprecision,38) +q=Qfb(7, 30, -14)^2; +qfbpowraw(q,-1) +q*q^2 +q^0 +q^1 +q^-1 +q^-(2^64+1) +q=Qfb(2, 1, 3); q2=q*q; +q3=qfbcompraw(q,q2) +qfbpowraw(q,3) +qfbred(q3,1) +q=Qfb(1009, 60, 99108027750247771) +qfbnupow(q, 8839368315) +L = sqrtnint(abs(poldisc(q)), 4); +qfbnupow(q, 8839368315,L) +q=Qfb(22000957029,25035917443,7122385192); +qfbred(q) +qfbredsl2(q) +q=Qfb(1099511627776,1879224363605,802966544317); +[qr,U]=qfbredsl2(q) +qfeval(q,U) +qfeval(q,U[,1]) +qfeval(q,U[,2]) +qfeval(q,U[,1],U[,2]) +D=poldisc(q); +qfbredsl2(q,[D,sqrtint(D)]) +qfbredsl2(q,[D]); +qfbredsl2(q,[D,1.]); +p=2^64+13; +qfbprimeform(-4,p) +qfbprimeform(5,p) + +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestQfb(unittest.TestCase): + def test_qfb(self): + def vec(x): + return [pari.component(x, 1), pari.component(x, 2), pari.component(x, 3)]; + + self.assertEquals(str(vec(pari.qfbred(pari.Qfb(6, 6, -1), 1))), '[-1, 6, 6]') + pari.set_real_precision(38) + q=pari('Qfb(7, 30, -14)^2'); + self.assertEquals(pari.qfbpowraw(q,-1), 'Qfb(-2, -34, 17, -1.2031810657666797073140254201751247272)') + # q*q^2 + # q^0 + # q^1 + # q^-1 + # q^-(2^64+1) + q = pari.Qfb(2, 1, 3); + q2 = pari('Qfb(2, 1, 3)*Qfb(2, 1, 3)'); + q3 = pari.qfbcompraw(q, q2) + self.assertEquals(q3, 'Qfb(1, -1, 6)') + self.assertEquals(pari.qfbpowraw(q, 3), 'Qfb(8, 13, 6)') + self.assertEquals(pari.qfbred(q3, 1), 'Qfb(1, 1, 6)') + q = pari.Qfb(1009, 60, 99108027750247771) + self.assertEquals(q, 'Qfb(1009, 60, 99108027750247771)') + self.assertEquals(pari.qfbnupow(q, 8839368315), 'Qfb(1, 0, 100000000000000000039)') + L = pari.sqrtnint(pari.abs(pari.poldisc(q)), 4); + self.assertEquals(pari.qfbnupow(q, 8839368315, L), 'Qfb(1, 0, 100000000000000000039)') + q = pari.Qfb(22000957029, 25035917443, 7122385192); + self.assertEquals(pari.qfbred(q), 'Qfb(1, 1, 6)') + self.assertEquals(pari.qfbredsl2(q), '[Qfb(1, 1, 6), [22479, 76177; -39508, -133885]]') + + q = pari.Qfb('1099511627776', '1879224363605', '802966544317', precision=127); + U = pari.qfbredsl2(q)[1] + self.assertEquals(U, '[127327, -416128; -148995, 486943]') + self.assertEquals(pari.qfeval(q, U), 'Qfb(4, 3, -3, 0.E-38)') + self.assertEquals(pari.qfeval(q, 'qfbredsl2(Qfb(1099511627776,1879224363605,802966544317))[2][,1]'), '4') + self.assertEquals(pari.qfeval(q, 'qfbredsl2(Qfb(1099511627776,1879224363605,802966544317))[2][,2]'), '-3') + self.assertEquals(pari.qfeval(q, 'qfbredsl2(Qfb(1099511627776,1879224363605,802966544317))[2][,1]', + 'qfbredsl2(Qfb(1099511627776,1879224363605,802966544317))[2][,2]'), '3/2') + D = pari.poldisc(q); + self.assertEquals(pari.qfbredsl2(q, [D, pari.sqrtint(D)]), + '[Qfb(4, 3, -3, 0.E-38), [127327, -416128; -148995, 486943]]') + with self.assertRaises(PariError) as context: + pari.qfbredsl2(q, [D]); + self.assertTrue('incorrect type in qfbredsl2 (t_VEC)' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.qfbredsl2(q, [D, 1.]); + self.assertTrue('incorrect type in qfbredsl2 (t_VEC)' in str(context.exception)) + + p = pow(2, 64) + 13; + self.assertEquals(pari.qfbprimeform(-4, p), + 'Qfb(18446744073709551629, 4741036151112220792, 304625896260305173)') + self.assertEquals(pari.qfbprimeform(5, p), + 'Qfb(18446744073709551629, 7562574061564804959, 775103267656920011, 0.E-38)') + pari.set_real_precision(15) + + +"""**** Original expected results **** + +[-1, 6, 6] +Qfb(-2, -34, 17, -1.2031810657666797073140254201751247272) +Qfb(-2, 34, 17, 3.6095431973000391219420762605253741816) +Qfb(1, 34, -34, 0.E-38) +Qfb(-2, 34, 17, 1.2031810657666797073140254201751247272) +Qfb(17, 34, -2, -2.9945542852277529726974917240067615601) +Qfb(17, 34, -2, -22194773194531041164.334277319893643413) +Qfb(1, -1, 6) +Qfb(8, 13, 6) +Qfb(1, 1, 6) +Qfb(1009, 60, 99108027750247771) +Qfb(1, 0, 100000000000000000039) +Qfb(1, 0, 100000000000000000039) +Qfb(1, 1, 6) +[Qfb(1, 1, 6), [22479, 76177; -39508, -133885]] +[Qfb(4, 3, -3, 0.E-38), [127327, -416128; -148995, 486943]] +Qfb(4, 3, -3, 0.E-38) +4 +-3 +3/2 +[Qfb(4, 3, -3, 0.E-38), [127327, -416128; -148995, 486943]] + *** at top-level: qfbredsl2(q,[D]) + *** ^---------------- + *** qfbredsl2: incorrect type in qfbredsl2 (t_VEC). + *** at top-level: qfbredsl2(q,[D,1.]) + *** ^------------------- + *** qfbredsl2: incorrect type in qfbredsl2 (t_VEC). +Qfb(18446744073709551629, 4741036151112220792, 304625896260305173) +Qfb(18446744073709551629, 7562574061564804959, 775103267656920011, 0.E-38) + +""" diff --git a/tests/unittests/qfbclassno.py b/tests/unittests/qfbclassno.py new file mode 100644 index 0000000..8981fdf --- /dev/null +++ b/tests/unittests/qfbclassno.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file qfbclassno : +qfbclassno(-44507759) +qfbclassno(-57403799) +qfbclassno(-94361767) +qfbclassno(-111385627) +qfbclassno(-136801204) +qfbclassno(-185415288) +qfbclassno(-198154147) +qfbclassno(-223045972) +qfbclassno(-1253840791) +qfbclassno(-1382998299) +qfbclassno(-1567139127) +qfbclassno(-1788799151) +qfbclassno(-1850979435) +qfbclassno(-4386842803) +qfbclassno(-5082406399) +qfbclassno(1-2^100) +""" +import unittest +from cypari2 import Pari, PariError +from math import pow + +pari = Pari() + + +class TestQfbclassno(unittest.TestCase): + def test_qfbclassno(self): + self.assertEquals(pari.qfbclassno(-44507759), '10125') + self.assertEquals(pari.qfbclassno(-57403799), '11045') + self.assertEquals(pari.qfbclassno(-94361767), '4802') + self.assertEquals(pari.qfbclassno(-111385627), '1660') + self.assertEquals(pari.qfbclassno(-136801204), '2136') + self.assertEquals(pari.qfbclassno(-185415288), '2144') + self.assertEquals(pari.qfbclassno(-198154147), '1508') + self.assertEquals(pari.qfbclassno(-223045972), '2728') + self.assertEquals(pari.qfbclassno(-1253840791), '15376') + self.assertEquals(pari.qfbclassno(-1382998299), '7688') + self.assertEquals(pari.qfbclassno(-1567139127), '15376') + self.assertEquals(pari.qfbclassno(-1788799151), '76800') + self.assertEquals(pari.qfbclassno(-1850979435), '7688') + self.assertEquals(pari.qfbclassno(-4386842803), '8112') + self.assertEquals(pari.qfbclassno(-5082406399), '32448') + self.assertEquals(pari.qfbclassno(1-int(pow(2, 100))), '641278838681600') + +"""**** Original expected results **** + +10125 +11045 +4802 +1660 +2136 +2144 +1508 +2728 +15376 +7688 +15376 +76800 +7688 +8112 +32448 +641278838681600 + +""" diff --git a/tests/unittests/qfsolve.py b/tests/unittests/qfsolve.py new file mode 100644 index 0000000..611d959 --- /dev/null +++ b/tests/unittests/qfsolve.py @@ -0,0 +1,1394 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file qfsolve : +{M=[[-634,-706,-200;-706,527,-110;-200,-110,-997],[-670,164,205;164,-391,-509;205,-509,-117],[586,-448,120;-448,-342,-233;120,-233,-851],[-387,-147,450;-147,-808,-22;450,-22,-119],[739,-44,-48;-44,-739,-134;-48,-134,459],[-519,-45,-514;-45,324,178;-514,178,-83],[-482,-683,18;-683,705,852;18,852,315],[808,-16,555;-16,-723,-538;555,-538,-66],[243,205,-14;205,-119,853;-14,853,891],[-220,10,-564;10,-440,-9;-564,-9,413],[383,66,53;66,-962,-104;53,-104,300],[-845,257,264;257,-7,-866;264,-866,259],[-76,676,371;676,-541,-332;371,-332,-417],[111,-203,-57;-203,-634,-30;-57,-30,275],[-926,-548,-178;-548,483,141;-178,141,-953],[-810,-164,648;-164,-802,-612;648,-612,-274],[818,88,630;88,369,524;630,524,-565],[-165,99,-70;99,83,-716;-70,-716,-493],[-183,56,320;56,509,-931;320,-931,-543],[19,799,-94;799,-866,-658;-94,-658,-604],[-859,-569,525;-569,476,217;525,217,-852],[-527,708,47;708,22,-79;47,-79,902],[360,-425,126;-425,-578,-411;126,-411,581],[2,821,59;821,-893,524;59,524,-788],[470,155,-752;155,-679,-683;-752,-683,-584],[398,107,-644;107,-840,374;-644,374,-274],[-839,8,-410;8,-451,-774;-410,-774,801],[-556,-134,-368;-134,183,566;-368,566,686],[-62,354,-396;354,313,350;-396,350,-891],[518,163,17;163,821,332;17,332,-593],[574,-155,19;-155,424,305;19,305,-978],[-720,873,341;873,-131,-116;341,-116,-414],[417,-39,201;-39,910,-9;201,-9,-538],[-34,-193,-22;-193,-632,362;-22,362,-778],[36,-748,-131;-748,-21,147;-131,147,-143],[-236,-560,-211;-560,803,-632;-211,-632,620],[708,-76,-360;-76,814,248;-360,248,263],[790,-271,-338;-271,-114,-400;-338,-400,-12],[-744,-737,-70;-737,-270,-754;-70,-754,816],[-845,520,141;520,-559,73;141,73,132],[-276,406,-305;406,153,-349;-305,-349,41],[632,62,653;62,-125,439;653,439,-256],[-598,-39,-488;-39,-36,461;-488,461,-506],[406,99,-178;99,747,-99;-178,-99,781],[686,-38,-491;-38,-330,-564;-491,-564,253],[427,69,-615;69,933,215;-615,215,-558],[290,-326,-365;-326,928,208;-365,208,754],[-149,-113,197;-113,877,292;197,292,233],[-701,-265,776;-265,911,-259;776,-259,-531],[81,-169,-170;-169,445,-107;-170,-107,632],[-433,153,215;153,15,-362;215,-362,-77],[-108,10,-734;10,-133,-88;-734,-88,-154],[-48,-365,-68;-365,413,-217;-68,-217,-436],[162,-63,184;-63,-728,-240;184,-240,-845],[-96,-233,-747;-233,951,833;-747,833,-30],[-314,-311,-656;-311,322,-663;-656,-663,-639],[-106,-465,-662;-465,-111,53;-662,53,-97],[-410,166,-445;166,-565,104;-445,104,823],[180,-312,19;-312,984,-10;19,-10,701],[-165,936,-247;936,103,743;-247,743,-414],[-571,451,-527;451,419,-499;-527,-499,-473],[-680,182,651;182,-194,-89;651,-89,-889],[670,75,246;75,72,609;246,609,-58],[-929,-764,508;-764,-984,-405;508,-405,-915],[102,736,116;736,634,722;116,722,-656],[33,214,-533;214,-205,-453;-533,-453,844],[235,270,-692;270,68,-323;-692,-323,729],[945,236,5;236,-506,329;5,329,866],[885,-737,539;-737,908,146;539,146,314],[-179,-252,-29;-252,-966,442;-29,442,-116],[-496,-25,-581;-25,-90,-136;-581,-136,492],[513,432,-290;432,-708,47;-290,47,-933],[364,-386,-310;-386,-460,224;-310,224,-363],[-124,214,795;214,-930,-213;795,-213,818],[69,-552,-189;-552,807,-300;-189,-300,249],[-977,-141,-158;-141,169,199;-158,199,-355],[929,268,383;268,945,618;383,618,943],[177,-329,-78;-329,-953,216;-78,216,644],[-335,-314,-76;-314,-572,-229;-76,-229,-214],[609,-226,65;-226,578,271;65,271,-938],[962,-213,483;-213,-159,383;483,383,473],[-821,-501,368;-501,-602,489;368,489,461],[-636,-385,597;-385,-913,903;597,903,849],[967,350,-825;350,352,475;-825,475,974],[-982,7,98;7,-563,-840;98,-840,-726],[-504,81,-124;81,-470,191;-124,191,-846],[756,273,253;273,932,348;253,348,331],[52,-645,783;-645,-606,-565;783,-565,918],[22,-781,-238;-781,-382,-637;-238,-637,-618],[-405,497,-397;497,-489,-593;-397,-593,-916],[-856,5,85;5,-866,-24;85,-24,-540],[764,-153,9;-153,362,-127;9,-127,-1000],[-551,-637,624;-637,-864,361;624,361,12],[-522,203,-199;203,-239,-581;-199,-581,-228],[724,644,245;644,71,456;245,456,983],[-369,-142,164;-142,-644,302;164,302,580],[-485,-786,-362;-786,-207,-326;-362,-326,-257],[373,-271,514;-271,734,390;514,390,-410],[-223,-301,32;-301,-480,-549;32,-549,358],[-501,82,-557;82,609,-296;-557,-296,962];[394,-209,-606,-399;-209,-552,157,-626;-606,157,144,-188;-399,-626,-188,293],[-870,-559,-338,-156;-559,931,293,-7;-338,293,-920,46;-156,-7,46,-563],[703,435,-32,-310;435,-313,103,-144;-32,103,-262,64;-310,-144,64,-769],[523,481,141,-252;481,-291,-403,7;141,-403,-625,-556;-252,7,-556,847],[473,331,-38,-36;331,-346,-409,58;-38,-409,-864,-20;-36,58,-20,-299],[847,138,609,-195;138,-215,232,-257;609,232,953,220;-195,-257,220,63],[544,-494,56,-441;-494,-73,154,-847;56,154,-427,565;-441,-847,565,-503],[-548,200,253,353;200,-582,142,278;253,142,-514,-577;353,278,-577,-555],[-954,-835,-720,-541;-835,-642,116,74;-720,116,-939,168;-541,74,168,32],[-921,16,-253,-807;16,559,-16,-401;-253,-16,604,591;-807,-401,591,848],[-184,326,-437,151;326,-560,373,-103;-437,373,-913,-731;151,-103,-731,735],[637,57,-209,785;57,708,463,-909;-209,463,197,-275;785,-909,-275,751],[901,175,-364,245;175,14,141,811;-364,141,-104,-499;245,811,-499,-705],[-184,942,-258,171;942,-149,-629,366;-258,-629,-935,216;171,366,216,986],[661,647,-235,-432;647,-176,177,192;-235,177,-123,379;-432,192,379,-760],[-957,440,-161,-888;440,2,-148,-48;-161,-148,-598,-743;-888,-48,-743,550],[959,720,-158,225;720,-588,-46,258;-158,-46,530,-753;225,258,-753,367],[291,-64,-481,-53;-64,829,386,305;-481,386,638,213;-53,305,213,22],[949,-74,304,129;-74,-143,-673,-167;304,-673,545,-43;129,-167,-43,-485],[217,861,-669,-333;861,884,-12,675;-669,-12,110,-540;-333,675,-540,67],[957,-415,416,493;-415,862,148,-308;416,148,453,-253;493,-308,-253,-822],[-838,-392,-57,-288;-392,-83,130,323;-57,130,87,199;-288,323,199,-464],[-43,256,-625,-195;256,-320,362,1;-625,362,-611,-142;-195,1,-142,-538],[-524,-608,-260,-17;-608,-211,-123,-438;-260,-123,633,-264;-17,-438,-264,659],[139,-93,776,-239;-93,384,67,-639;776,67,-561,-645;-239,-639,-645,895],[704,-399,-485,-425;-399,-519,748,163;-485,748,-182,-274;-425,163,-274,834],[67,-693,-88,664;-693,987,39,-62;-88,39,-915,-327;664,-62,-327,-434],[-901,102,-239,-270;102,-311,-212,591;-239,-212,771,-105;-270,591,-105,502],[-58,-876,422,-195;-876,-105,-761,-819;422,-761,-760,379;-195,-819,379,117],[995,22,48,-495;22,519,368,-411;48,368,-925,720;-495,-411,720,632],[445,-738,-222,299;-738,-786,-232,-352;-222,-232,-619,-341;299,-352,-341,81],[-490,495,1,-342;495,-222,192,608;1,192,6,-412;-342,608,-412,-723],[684,-101,124,-102;-101,395,-184,413;124,-184,-731,14;-102,413,14,-945],[102,-118,-635,-737;-118,-652,37,575;-635,37,-879,-84;-737,575,-84,748],[732,-244,-50,270;-244,-277,53,574;-50,53,-224,683;270,574,683,223],[466,-48,-330,-472;-48,-834,699,-489;-330,699,-318,745;-472,-489,745,859],[252,72,115,248;72,-846,11,-645;115,11,289,281;248,-645,281,-276],[270,537,-17,345;537,289,-338,489;-17,-338,429,-701;345,489,-701,-214],[731,812,-291,-457;812,-9,-77,294;-291,-77,217,156;-457,294,156,-646],[246,160,-739,53;160,560,-7,437;-739,-7,-803,13;53,437,13,4],[789,-415,-730,436;-415,905,-467,34;-730,-467,97,-35;436,34,-35,128],[111,120,-205,-83;120,358,-58,284;-205,-58,-131,-463;-83,284,-463,825],[96,-218,-174,-75;-218,-200,378,201;-174,378,-221,-29;-75,201,-29,169],[841,-443,244,834;-443,-46,774,-48;244,774,188,194;834,-48,194,-966],[-622,430,-699,-145;430,-977,30,-116;-699,30,-781,-447;-145,-116,-447,452],[787,-20,-232,-250;-20,-50,310,-314;-232,310,-106,422;-250,-314,422,-894],[17,275,-251,-497;275,-581,-179,196;-251,-179,-643,-558;-497,196,-558,-114],[-867,-236,-249,300;-236,318,-308,237;-249,-308,721,-321;300,237,-321,531],[738,575,-59,145;575,721,-480,442;-59,-480,592,170;145,442,170,-757],[201,121,-379,162;121,-469,-132,378;-379,-132,-272,309;162,378,309,-280],[908,109,-209,-921;109,-203,495,371;-209,495,350,240;-921,371,240,-571],[93,29,-738,-360;29,-715,287,-725;-738,287,-523,-109;-360,-725,-109,16],[-97,-86,131,-369;-86,231,-168,30;131,-168,-751,-484;-369,30,-484,-399],[-815,-360,-481,-48;-360,320,326,191;-481,326,555,548;-48,191,548,-707],[96,235,-680,612;235,748,-74,-298;-680,-74,-648,-670;612,-298,-670,622],[-39,-344,297,-252;-344,834,-77,41;297,-77,-60,-279;-252,41,-279,645],[914,196,209,-238;196,-7,44,447;209,44,16,-194;-238,447,-194,-632],[-314,163,756,341;163,982,-61,288;756,-61,706,-76;341,288,-76,-321],[-492,-316,-59,-350;-316,-861,-647,-270;-59,-647,837,-90;-350,-270,-90,-629],[-565,450,97,156;450,984,-271,-315;97,-271,583,-40;156,-315,-40,-110],[-496,-37,98,-453;-37,-152,-81,-349;98,-81,-811,-292;-453,-349,-292,-688],[953,281,-556,904;281,311,-557,-644;-556,-557,845,100;904,-644,100,-359],[-643,497,-310,-229;497,-925,172,255;-310,172,-151,350;-229,255,350,854],[863,150,318,-30;150,-522,-464,-274;318,-464,-942,-256;-30,-274,-256,228],[-211,493,-509,-6;493,215,344,-548;-509,344,227,-727;-6,-548,-727,-682],[-276,-9,204,515;-9,-80,-2,-211;204,-2,-842,43;515,-211,43,543],[-169,669,215,22;669,92,370,18;215,370,684,123;22,18,123,707],[-577,-130,-286,-189;-130,-529,-189,-770;-286,-189,381,-12;-189,-770,-12,-169],[952,-268,40,545;-268,-710,-236,196;40,-236,-559,-115;545,196,-115,571],[418,132,-154,278;132,928,116,-122;-154,116,538,-528;278,-122,-528,37],[782,83,-31,351;83,-662,-39,-609;-31,-39,-414,-249;351,-609,-249,215],[318,532,-172,-248;532,-783,-399,10;-172,-399,-877,823;-248,10,823,-748],[-68,233,-456,-484;233,225,-375,455;-456,-375,-324,188;-484,455,188,-250],[-684,-179,65,466;-179,647,-392,-1;65,-392,-222,292;466,-1,292,-251],[-592,447,-605,51;447,-233,430,67;-605,430,-573,-263;51,67,-263,-506],[-43,308,-326,-746;308,-241,-537,-197;-326,-537,-407,34;-746,-197,34,112],[112,95,137,533;95,317,807,711;137,807,4,26;533,711,26,-792],[755,-108,121,-537;-108,-730,-485,-202;121,-485,753,29;-537,-202,29,965],[-54,235,113,192;235,320,-837,-258;113,-837,398,-498;192,-258,-498,683],[-852,55,-567,102;55,612,-594,460;-567,-594,29,-501;102,460,-501,-213],[4,-100,473,-28;-100,202,64,48;473,64,-593,-616;-28,48,-616,-834],[-692,-666,531,-306;-666,559,49,-619;531,49,-390,-730;-306,-619,-730,324],[-641,-381,108,62;-381,118,-110,-194;108,-110,697,329;62,-194,329,-869],[281,752,-869,350;752,-545,-169,138;-869,-169,782,-376;350,138,-376,97],[-58,647,-85,391;647,-968,459,-166;-85,459,469,323;391,-166,323,-104],[-20,728,757,569;728,531,530,-500;757,530,-47,101;569,-500,101,-500],[-980,413,-81,602;413,647,118,30;-81,118,-787,-709;602,30,-709,582],[518,-59,335,247;-59,-184,460,-518;335,460,510,-216;247,-518,-216,-7],[762,-305,724,-25;-305,-328,805,414;724,805,-942,-83;-25,414,-83,-88],[388,-318,-111,416;-318,146,-678,742;-111,-678,35,543;416,742,543,891],[402,5,-176,845;5,-56,-427,-745;-176,-427,217,196;845,-745,196,363],[981,159,-168,186;159,760,-718,816;-168,-718,356,-245;186,816,-245,244],[495,-302,243,-33;-302,-118,97,-204;243,97,20,192;-33,-204,192,153],[954,-725,339,422;-725,-4,-230,712;339,-230,-57,-11;422,712,-11,-690],[765,-702,29,-644;-702,789,-366,75;29,-366,49,-479;-644,75,-479,575],[-62,381,327,631;381,577,-512,-672;327,-512,146,158;631,-672,158,126],[-947,541,87,-893;541,-495,-41,-665;87,-41,861,60;-893,-665,60,175],[-910,488,-479,-431;488,991,143,229;-479,143,783,-356;-431,229,-356,-333],[846,-356,-144,-336;-356,888,-228,-471;-144,-228,-194,-647;-336,-471,-647,-724],[-10,454,119,65;454,468,-597,260;119,-597,567,-110;65,260,-110,106];[-564,568,485,513,7;568,-526,612,-346,460;485,612,183,-757,-36;513,-346,-757,-536,505;7,460,-36,505,693],[-379,-94,-635,347,-257;-94,-489,84,-418,229;-635,84,361,-107,-17;347,-418,-107,-48,-715;-257,229,-17,-715,-966],[533,-388,15,340,-489;-388,-366,-37,-836,-93;15,-37,627,328,-271;340,-836,328,-576,-812;-489,-93,-271,-812,-769],[-518,-276,-221,336,787;-276,307,463,342,374;-221,463,-417,499,428;336,342,499,-572,-117;787,374,428,-117,-648],[-63,-268,835,-443,-432;-268,-811,713,-136,-363;835,713,58,151,791;-443,-136,151,-517,-412;-432,-363,791,-412,104],[-95,-786,24,-81,-432;-786,744,139,312,251;24,139,423,298,479;-81,312,298,-672,-239;-432,251,479,-239,9],[888,-546,-211,69,-50;-546,220,59,432,76;-211,59,454,552,432;69,432,552,283,-368;-50,76,432,-368,614],[-164,-64,-626,247,-567;-64,116,-387,584,-334;-626,-387,555,-430,553;247,584,-430,213,-966;-567,-334,553,-966,929],[626,493,-33,391,-355;493,868,-572,193,394;-33,-572,252,-258,-172;391,193,-258,-822,349;-355,394,-172,349,359],[-554,412,-131,31,507;412,794,-428,-31,44;-131,-428,683,-157,330;31,-31,-157,-780,464;507,44,330,464,-750],[45,210,831,-678,-52;210,-539,157,219,-94;831,157,452,698,-380;-678,219,698,-203,-513;-52,-94,-380,-513,-221],[148,-171,-445,202,659;-171,-531,551,-48,-440;-445,551,502,18,-69;202,-48,18,240,-437;659,-440,-69,-437,-778],[-544,-88,-52,-34,-341;-88,238,517,527,306;-52,517,-192,403,79;-34,527,403,210,471;-341,306,79,471,781],[463,-680,-929,668,294;-680,-264,682,-498,864;-929,682,-503,-903,-562;668,-498,-903,438,-217;294,864,-562,-217,-58],[-66,-495,-201,-401,-128;-495,171,570,-139,-745;-201,570,614,-566,356;-401,-139,-566,-818,-797;-128,-745,356,-797,967],[-768,345,73,-335,-489;345,-478,52,211,-100;73,52,94,0,264;-335,211,0,619,-695;-489,-100,264,-695,447],[-239,-24,198,-123,-152;-24,374,-611,-425,-191;198,-611,589,-615,336;-123,-425,-615,26,-782;-152,-191,336,-782,950],[-336,670,8,196,86;670,857,144,-710,-682;8,144,648,-21,854;196,-710,-21,936,923;86,-682,854,923,-368],[-536,235,-207,-112,-499;235,-391,-900,106,189;-207,-900,346,-359,581;-112,106,-359,-461,-341;-499,189,581,-341,269],[-264,431,731,73,-190;431,-513,-131,-101,-23;731,-131,-223,119,245;73,-101,119,-553,511;-190,-23,245,511,530],[943,-212,171,-448,-45;-212,-613,286,-453,-603;171,286,-36,-8,-134;-448,-453,-8,-452,-372;-45,-603,-134,-372,-610],[434,-204,457,47,-340;-204,-163,705,327,49;457,705,-463,-555,-40;47,327,-555,-996,-402;-340,49,-40,-402,421],[202,-242,-953,-143,-284;-242,161,225,-197,-828;-953,225,151,-407,808;-143,-197,-407,535,348;-284,-828,808,348,-688],[-668,725,-427,528,330;725,813,-586,-488,209;-427,-586,951,107,-254;528,-488,107,2,-472;330,209,-254,-472,294],[-839,-247,50,445,-82;-247,114,-527,-150,-201;50,-527,-504,-233,96;445,-150,-233,863,697;-82,-201,96,697,254],[-975,-683,-223,410,591;-683,-56,-133,-592,424;-223,-133,-633,174,-339;410,-592,174,453,-286;591,424,-339,-286,-850],[69,75,609,39,182;75,36,292,587,251;609,292,-678,151,-196;39,587,151,-906,-435;182,251,-196,-435,948],[-102,251,-928,478,-2;251,-622,449,-307,-166;-928,449,-832,512,0;478,-307,512,925,491;-2,-166,0,491,646],[14,768,-575,216,555;768,-196,422,772,-823;-575,422,-373,684,305;216,772,684,904,569;555,-823,305,569,15],[741,-172,99,-82,-553;-172,-787,573,320,225;99,573,-672,-740,569;-82,320,-740,-198,-943;-553,225,569,-943,-413],[-981,21,38,19,43;21,-55,-303,568,243;38,-303,-376,-55,-721;19,568,-55,83,-402;43,243,-721,-402,943],[710,97,-685,411,71;97,-324,773,-582,597;-685,773,-692,393,-204;411,-582,393,410,11;71,597,-204,11,-238],[-765,404,-10,-80,251;404,-195,2,167,304;-10,2,369,328,308;-80,167,328,-859,-281;251,304,308,-281,151],[126,584,513,334,-25;584,-358,-99,27,329;513,-99,793,-106,195;334,27,-106,-532,-18;-25,329,195,-18,617],[732,-546,81,-379,-399;-546,-205,79,19,-73;81,79,987,-435,575;-379,19,-435,999,-90;-399,-73,575,-90,-341],[-373,-891,190,539,327;-891,-997,-89,185,433;190,-89,778,-1,-337;539,185,-1,394,-141;327,433,-337,-141,281],[-624,102,-778,200,-350;102,-748,-333,146,-243;-778,-333,-10,90,145;200,146,90,-728,146;-350,-243,145,146,-166],[-848,-806,255,240,283;-806,373,744,858,404;255,744,-504,55,-867;240,858,55,950,101;283,404,-867,101,427],[302,-557,-629,100,8;-557,-627,502,60,226;-629,502,-812,748,352;100,60,748,658,330;8,226,352,330,-252],[280,575,579,-515,257;575,-355,-201,203,163;579,-201,689,-540,58;-515,203,-540,737,-342;257,163,58,-342,485],[491,353,76,-533,337;353,756,-358,-237,105;76,-358,-301,350,-232;-533,-237,350,905,558;337,105,-232,558,616],[-594,299,-104,-275,37;299,883,503,695,592;-104,503,-275,199,248;-275,695,199,21,-32;37,592,248,-32,692],[-79,448,106,323,-45;448,-967,649,351,400;106,649,-458,-435,275;323,351,-435,-117,-759;-45,400,275,-759,-165],[-740,-85,540,-27,244;-85,-934,472,575,171;540,472,-947,476,550;-27,575,476,-582,566;244,171,550,566,-509],[831,-113,-331,92,-472;-113,89,110,-295,93;-331,110,338,665,-273;92,-295,665,-754,558;-472,93,-273,558,-883],[277,-733,-472,67,638;-733,170,-229,160,-805;-472,-229,510,-61,-135;67,160,-61,-89,-231;638,-805,-135,-231,769],[567,517,-261,-38,357;517,386,2,777,226;-261,2,590,-394,-296;-38,777,-394,188,-236;357,226,-296,-236,209],[-697,-632,494,513,-241;-632,95,-245,487,100;494,-245,-37,0,15;513,487,0,717,-33;-241,100,15,-33,440],[-474,-135,-35,-406,-241;-135,-128,402,-26,-170;-35,402,-933,-41,-138;-406,-26,-41,791,-167;-241,-170,-138,-167,-286],[-854,-121,-48,-570,419;-121,-59,22,-196,368;-48,22,-194,-258,-46;-570,-196,-258,497,6;419,368,-46,6,-124],[-306,470,671,-322,41;470,988,-964,131,193;671,-964,-218,175,378;-322,131,175,470,-50;41,193,378,-50,506],[478,-324,-581,89,540;-324,-885,-57,-600,-464;-581,-57,785,-69,-182;89,-600,-69,-595,157;540,-464,-182,157,-322],[-724,62,466,-176,570;62,-735,181,-420,-19;466,181,53,-293,-14;-176,-420,-293,-990,344;570,-19,-14,344,-771],[-429,13,-134,543,-175;13,-200,-702,291,-202;-134,-702,684,-389,321;543,291,-389,-510,189;-175,-202,321,189,-713],[919,83,-70,309,-566;83,-977,402,-190,-312;-70,402,-829,-533,106;309,-190,-533,-306,-35;-566,-312,106,-35,-599],[-620,-223,29,-150,-213;-223,248,497,-768,-305;29,497,-657,798,0;-150,-768,798,930,30;-213,-305,0,30,-51],[-965,53,-98,155,195;53,-349,634,225,948;-98,634,-847,125,573;155,225,125,33,507;195,948,573,507,-390],[-526,338,50,394,607;338,435,-100,590,403;50,-100,-480,-228,792;394,590,-228,-377,-478;607,403,792,-478,514],[-293,280,-137,60,247;280,-6,116,-506,177;-137,116,-906,764,452;60,-506,764,-420,275;247,177,452,275,294],[307,490,-31,-208,347;490,-456,726,-453,113;-31,726,-892,450,-532;-208,-453,450,-393,-230;347,113,-532,-230,-417],[700,408,-90,-330,249;408,325,-344,-6,64;-90,-344,608,358,-550;-330,-6,358,342,388;249,64,-550,388,628],[-668,-7,558,-90,3;-7,805,67,158,8;558,67,178,-635,401;-90,158,-635,-163,-413;3,8,401,-413,-501],[-940,319,-177,-311,170;319,-588,749,843,403;-177,749,-134,-381,-577;-311,843,-381,-709,-161;170,403,-577,-161,995],[458,-800,-2,-551,-101;-800,-832,477,-256,329;-2,477,384,-263,183;-551,-256,-263,800,-468;-101,329,183,-468,-321],[-198,-129,-271,347,-584;-129,182,36,-962,-226;-271,36,-274,-336,-522;347,-962,-336,456,-115;-584,-226,-522,-115,557],[360,283,902,651,-69;283,-673,-326,-867,39;902,-326,199,130,582;651,-867,130,471,37;-69,39,582,37,796],[-795,-20,-143,-308,554;-20,-521,609,174,563;-143,609,-539,44,159;-308,174,44,122,-707;554,563,159,-707,-584],[-885,550,178,-421,145;550,-413,-180,-757,578;178,-180,-501,208,345;-421,-757,208,-882,136;145,578,345,136,-705],[188,552,-114,248,-867;552,-594,-348,266,-172;-114,-348,-428,604,242;248,266,604,617,-81;-867,-172,242,-81,867],[702,361,239,-502,172;361,-932,-89,-486,-789;239,-89,991,91,349;-502,-486,91,447,280;172,-789,349,280,-236],[-717,-249,-608,-505,97;-249,-222,-65,157,505;-608,-65,-796,697,614;-505,157,697,187,139;97,505,614,139,-747],[829,126,59,-147,-5;126,-239,-261,-327,475;59,-261,-13,-210,-417;-147,-327,-210,594,-249;-5,475,-417,-249,637],[710,116,-118,709,285;116,-847,-351,28,-535;-118,-351,-348,232,-256;709,28,232,479,-382;285,-535,-256,-382,906],[-383,-85,563,-666,563;-85,924,974,356,211;563,974,14,250,-510;-666,356,250,458,166;563,211,-510,166,753],[-968,18,-75,638,-462;18,-37,79,-504,-92;-75,79,-543,72,253;638,-504,72,-896,929;-462,-92,253,929,-319],[614,-856,-127,541,-245;-856,-676,816,-940,-298;-127,816,-220,-522,140;541,-940,-522,878,581;-245,-298,140,581,245],[-85,-34,-122,-478,-115;-34,-759,-367,-193,603;-122,-367,605,276,79;-478,-193,276,798,508;-115,603,79,508,592],[-333,-138,-112,-263,179;-138,817,756,-48,391;-112,756,969,-731,752;-263,-48,-731,156,-321;179,391,752,-321,-712],[477,249,-294,-37,336;249,440,-302,622,-527;-294,-302,-692,-319,-269;-37,622,-319,685,-541;336,-527,-269,-541,-967],[-873,138,-286,-799,317;138,779,-78,13,-300;-286,-78,394,24,61;-799,13,24,-578,-441;317,-300,61,-441,178],[731,432,388,128,763;432,-160,-144,-97,24;388,-144,888,330,135;128,-97,330,-884,-301;763,24,135,-301,-902],[903,29,435,-334,522;29,876,526,26,449;435,526,-16,162,27;-334,26,162,-659,-382;522,449,27,-382,262],[-379,-816,431,-196,-632;-816,-939,-65,-621,111;431,-65,254,247,-416;-196,-621,247,-377,-50;-632,111,-416,-50,493],[-140,-350,-271,364,-657;-350,-321,-101,-87,-648;-271,-101,117,-376,-616;364,-87,-376,-331,26;-657,-648,-616,26,-793],[-846,962,-39,798,-742;962,-844,404,123,562;-39,404,-536,44,-729;798,123,44,-552,71;-742,562,-729,71,-458],[-943,-160,-175,148,-289;-160,625,624,-87,123;-175,624,-198,-23,-459;148,-87,-23,-854,291;-289,123,-459,291,119],[125,24,-75,172,605;24,-192,-385,707,129;-75,-385,-106,-110,-81;172,707,-110,179,239;605,129,-81,239,-216],[329,-86,307,-776,-546;-86,818,256,100,-332;307,256,-805,-398,321;-776,100,-398,-761,-576;-546,-332,321,-576,-2],[934,-696,-129,-171,-99;-696,-882,385,-535,-707;-129,385,488,305,8;-171,-535,305,-27,465;-99,-707,8,465,-329],[-279,11,260,-35,-333;11,175,-854,-246,-126;260,-854,-31,487,43;-35,-246,487,-775,195;-333,-126,43,195,-956],[-999,613,-166,-58,808;613,-518,-574,-664,416;-166,-574,-387,313,95;-58,-664,313,872,-34;808,416,95,-34,851],[-746,-456,-738,326,418;-456,418,848,62,483;-738,848,-980,104,-547;326,62,104,118,-18;418,483,-547,-18,301],[268,-302,-195,725,103;-302,-931,-885,812,-278;-195,-885,-3,-572,-280;725,812,-572,719,867;103,-278,-280,867,551],[544,230,-284,344,-698;230,-593,-370,-322,576;-284,-370,-979,-118,-9;344,-322,-118,942,714;-698,576,-9,714,-851],[301,-368,-694,45,212;-368,388,110,-530,-364;-694,110,271,-9,418;45,-530,-9,-838,-239;212,-364,418,-239,-448],[-243,224,27,249,337;224,317,-432,-383,133;27,-432,-681,779,-89;249,-383,779,844,405;337,133,-89,405,138],[481,61,-452,385,-156;61,-549,-691,-389,-36;-452,-691,597,345,-685;385,-389,345,-748,598;-156,-36,-685,598,-745],[-586,846,126,-357,704;846,-840,746,-6,203;126,746,673,-556,-262;-357,-6,-556,556,-206;704,203,-262,-206,663],[796,-218,-314,-352,214;-218,-973,649,-525,410;-314,649,-108,-642,-177;-352,-525,-642,139,-568;214,410,-177,-568,-655],[540,393,834,299,-166;393,153,35,109,150;834,35,-660,-529,569;299,109,-529,695,558;-166,150,569,558,989];[250,623,394,139,394,-485;623,950,605,-643,19,-311;394,605,-188,799,386,-600;139,-643,799,248,659,-616;394,19,386,659,236,-145;-485,-311,-600,-616,-145,-743],[899,543,-487,324,-284,-752;543,-305,-138,-108,-66,-360;-487,-138,-936,121,573,506;324,-108,121,164,-5,-438;-284,-66,573,-5,-878,151;-752,-360,506,-438,151,-891],[-349,136,-393,659,-232,488;136,42,806,279,327,313;-393,806,687,588,-121,223;659,279,588,109,-205,714;-232,327,-121,-205,684,-747;488,313,223,714,-747,192],[932,463,-748,68,-150,-264;463,-444,384,866,726,125;-748,384,-31,-160,804,179;68,866,-160,-498,159,-183;-150,726,804,159,794,463;-264,125,179,-183,463,-507],[519,132,272,-150,56,-96;132,451,38,560,-365,190;272,38,-686,135,-238,-510;-150,560,135,353,-129,240;56,-365,-238,-129,571,-256;-96,190,-510,240,-256,-627],[-694,137,-268,131,-429,-201;137,-130,-69,-39,-130,336;-268,-69,622,-515,174,453;131,-39,-515,-333,165,-316;-429,-130,174,165,853,836;-201,336,453,-316,836,-31],[920,-703,166,174,-451,124;-703,-651,56,297,-34,-24;166,56,530,148,14,516;174,297,148,503,317,82;-451,-34,14,317,934,350;124,-24,516,82,350,-921],[284,333,-642,510,563,441;333,909,442,561,-372,-319;-642,442,72,684,46,-802;510,561,684,-936,-48,285;563,-372,46,-48,546,221;441,-319,-802,285,221,-149],[556,-200,75,-156,529,264;-200,-689,-314,98,-144,-60;75,-314,110,-517,-399,81;-156,98,-517,768,471,706;529,-144,-399,471,-607,134;264,-60,81,706,134,-336],[-31,76,-13,412,-442,-71;76,-179,-306,469,-82,-107;-13,-306,-505,162,71,253;412,469,162,-376,190,231;-442,-82,71,190,-374,-517;-71,-107,253,231,-517,467],[-52,334,-360,-86,-466,80;334,478,43,-203,500,-33;-360,43,294,417,-590,-507;-86,-203,417,305,772,480;-466,500,-590,772,-476,180;80,-33,-507,480,180,-603],[-534,-134,-366,388,-656,-393;-134,-847,565,-148,372,137;-366,565,-550,-68,-262,-716;388,-148,-68,-832,254,162;-656,372,-262,254,-795,47;-393,137,-716,162,47,870],[-49,385,306,-659,479,-423;385,811,-288,5,608,-839;306,-288,-851,-383,-206,117;-659,5,-383,-936,408,569;479,608,-206,408,-438,-203;-423,-839,117,569,-203,-584],[138,-137,32,189,-635,168;-137,-782,19,-224,-133,-523;32,19,726,-57,271,-138;189,-224,-57,-884,-565,-630;-635,-133,271,-565,-305,529;168,-523,-138,-630,529,390],[-875,-791,-144,511,108,-164;-791,-59,-596,6,-520,534;-144,-596,-721,355,201,-129;511,6,355,738,-58,-318;108,-520,201,-58,-41,436;-164,534,-129,-318,436,-743],[457,540,-477,847,412,-89;540,-196,305,841,20,176;-477,305,293,-290,-627,-747;847,841,-290,-962,-147,33;412,20,-627,-147,-651,824;-89,176,-747,33,824,-472],[440,36,42,-257,307,556;36,112,-417,496,-199,298;42,-417,-624,417,395,195;-257,496,417,291,407,142;307,-199,395,407,-724,-167;556,298,195,142,-167,486],[-56,311,800,-536,-91,451;311,724,-120,403,159,339;800,-120,-169,-600,304,-562;-536,403,-600,-444,-404,-475;-91,159,304,-404,886,163;451,339,-562,-475,163,701],[831,-9,-193,250,-259,-177;-9,-279,-447,671,-344,243;-193,-447,119,250,-220,-13;250,671,250,-404,359,-171;-259,-344,-220,359,-77,-141;-177,243,-13,-171,-141,-71],[-290,-385,-7,232,300,-595;-385,715,544,-108,-746,-590;-7,544,365,-105,-187,-159;232,-108,-105,-923,582,334;300,-746,-187,582,-281,651;-595,-590,-159,334,651,322],[-907,229,-390,78,347,-413;229,945,-480,151,-738,711;-390,-480,-89,-188,-693,6;78,151,-188,656,-586,443;347,-738,-693,-586,-751,-396;-413,711,6,443,-396,-17],[-915,-17,591,161,16,-448;-17,177,300,723,326,0;591,300,489,-680,-591,279;161,723,-680,-119,-371,-937;16,326,-591,-371,-724,-244;-448,0,279,-937,-244,-270],[-376,-205,333,-491,171,364;-205,968,120,251,-80,-334;333,120,-33,-346,-517,-757;-491,251,-346,-74,-261,618;171,-80,-517,-261,-537,169;364,-334,-757,618,169,-464],[-158,-435,-280,29,549,-51;-435,-742,427,308,817,-432;-280,427,-317,544,472,-361;29,308,544,-951,256,35;549,817,472,256,907,284;-51,-432,-361,35,284,460],[-497,-300,-715,433,44,-341;-300,296,-76,-900,-319,-644;-715,-76,239,710,-30,-232;433,-900,710,-780,25,-612;44,-319,-30,25,-91,677;-341,-644,-232,-612,677,963],[-483,-373,254,58,112,-472;-373,781,-720,645,432,442;254,-720,227,145,719,-242;58,645,145,-265,-308,-19;112,432,719,-308,-110,305;-472,442,-242,-19,305,-641],[426,717,-190,194,600,-397;717,-324,392,98,238,68;-190,392,-313,316,-723,535;194,98,316,721,419,483;600,238,-723,419,-820,9;-397,68,535,483,9,737],[-682,519,-724,-204,-606,-348;519,-484,299,23,-49,-319;-724,299,-794,342,-498,36;-204,23,342,276,611,332;-606,-49,-498,611,-962,-432;-348,-319,36,332,-432,-955],[971,-610,-29,-607,146,-692;-610,-906,-177,217,536,-522;-29,-177,398,-61,49,-333;-607,217,-61,-421,-69,-21;146,536,49,-69,578,754;-692,-522,-333,-21,754,-889],[137,612,379,731,-89,149;612,-706,-257,-698,507,290;379,-257,110,407,455,260;731,-698,407,659,82,-404;-89,507,455,82,-618,-136;149,290,260,-404,-136,-790],[714,-226,-159,177,-129,450;-226,381,-254,-349,-409,95;-159,-254,-961,129,446,-302;177,-349,129,-396,-198,-214;-129,-409,446,-198,415,-123;450,95,-302,-214,-123,415],[141,699,-683,-890,449,-692;699,-533,-356,293,-166,268;-683,-356,-473,32,-16,151;-890,293,32,-183,240,335;449,-166,-16,240,-534,-122;-692,268,151,335,-122,266],[-307,377,889,-520,-105,-446;377,900,305,302,43,297;889,305,-834,187,-880,294;-520,302,187,-446,-649,-515;-105,43,-880,-649,662,-387;-446,297,294,-515,-387,-570],[-526,-630,488,-512,101,-657;-630,212,-529,-261,-16,7;488,-529,429,172,105,-875;-512,-261,172,-720,172,230;101,-16,105,172,724,-11;-657,7,-875,230,-11,833],[704,840,-58,-261,667,-482;840,-160,90,-382,-89,462;-58,90,-133,59,281,-62;-261,-382,59,-485,784,4;667,-89,281,784,-563,67;-482,462,-62,4,67,-634],[-462,-146,772,494,397,834;-146,174,23,377,15,528;772,23,-445,-144,116,-225;494,377,-144,660,-471,-251;397,15,116,-471,455,-443;834,528,-225,-251,-443,580],[-48,-185,267,-414,206,-165;-185,592,-46,269,84,-306;267,-46,251,-64,-640,82;-414,269,-64,878,-529,-361;206,84,-640,-529,840,48;-165,-306,82,-361,48,929],[376,830,212,-693,32,-372;830,-39,37,-397,140,74;212,37,384,-533,621,577;-693,-397,-533,492,348,-103;32,140,621,348,-107,169;-372,74,577,-103,169,-106],[-460,583,225,-2,687,55;583,724,294,-832,17,-361;225,294,-714,86,-234,272;-2,-832,86,-598,199,-81;687,17,-234,199,-370,-394;55,-361,272,-81,-394,-16],[-352,-297,28,362,-321,-290;-297,972,10,227,-145,526;28,10,-794,-10,397,305;362,227,-10,-94,-400,-430;-321,-145,397,-400,869,352;-290,526,305,-430,352,-93],[-699,-128,29,418,-137,946;-128,-946,293,336,152,-100;29,293,473,-603,233,-260;418,336,-603,883,882,-183;-137,152,233,882,248,-197;946,-100,-260,-183,-197,-688],[696,-143,489,-228,405,549;-143,-919,749,-176,-471,-816;489,749,-221,-272,598,671;-228,-176,-272,652,-51,-6;405,-471,598,-51,563,-734;549,-816,671,-6,-734,360],[-521,405,92,352,-158,-111;405,-696,-361,115,-444,-459;92,-361,871,142,267,-36;352,115,142,905,253,-199;-158,-444,267,253,-320,189;-111,-459,-36,-199,189,-46],[-790,367,117,-43,175,409;367,654,131,-823,-37,377;117,131,89,-14,-185,-317;-43,-823,-14,963,241,767;175,-37,-185,241,-141,-149;409,377,-317,767,-149,811],[-250,666,475,-73,701,-21;666,-136,214,213,-718,185;475,214,-42,456,177,-302;-73,213,456,191,15,231;701,-718,177,15,-331,-490;-21,185,-302,231,-490,-339],[-20,-312,-255,12,-45,123;-312,415,-415,311,-577,424;-255,-415,700,229,-535,222;12,311,229,763,-800,986;-45,-577,-535,-800,784,-45;123,424,222,986,-45,689],[85,-623,-81,-82,440,358;-623,-864,244,108,-61,210;-81,244,-158,46,215,-33;-82,108,46,-955,-36,-402;440,-61,215,-36,-236,-879;358,210,-33,-402,-879,-70],[-750,-192,-92,279,-99,-155;-192,658,-202,628,-366,-563;-92,-202,194,203,38,335;279,628,203,-276,-149,-27;-99,-366,38,-149,550,-79;-155,-563,335,-27,-79,-310],[959,206,-23,-249,793,256;206,-19,-578,284,-8,539;-23,-578,318,-396,292,538;-249,284,-396,394,581,112;793,-8,292,581,721,-371;256,539,538,112,-371,-869],[157,372,-914,641,146,-734;372,-704,130,631,250,466;-914,130,-789,526,675,-252;641,631,526,-341,155,93;146,250,675,155,-321,-845;-734,466,-252,93,-845,18],[408,179,-258,-35,370,-745;179,753,-494,-183,-725,512;-258,-494,255,447,-200,-648;-35,-183,447,912,596,125;370,-725,-200,596,-262,250;-745,512,-648,125,250,-767],[770,-730,289,36,-314,-199;-730,259,-746,740,286,-508;289,-746,580,251,-401,103;36,740,251,764,372,167;-314,286,-401,372,-269,-853;-199,-508,103,167,-853,-34],[-579,325,661,-348,645,-729;325,433,871,801,221,-631;661,871,846,-124,27,433;-348,801,-124,-251,-990,-97;645,221,27,-990,-957,-618;-729,-631,433,-97,-618,-373],[221,204,482,-309,-150,-760;204,-265,-487,-295,26,-244;482,-487,-961,-108,-113,405;-309,-295,-108,-800,-369,-21;-150,26,-113,-369,122,475;-760,-244,405,-21,475,347],[-820,32,-50,356,-705,-243;32,-651,543,121,-684,-186;-50,543,186,-247,656,-244;356,121,-247,350,100,247;-705,-684,656,100,-680,906;-243,-186,-244,247,906,-469],[431,-287,357,-430,-130,373;-287,-248,500,113,895,-59;357,500,60,-576,82,192;-430,113,-576,-478,-772,369;-130,895,82,-772,-462,268;373,-59,192,369,268,-734],[-352,-378,98,-49,374,623;-378,-999,197,68,266,180;98,197,701,-208,-129,-412;-49,68,-208,863,-117,442;374,266,-129,-117,-518,694;623,180,-412,442,694,501],[924,168,-46,550,41,84;168,608,-653,-514,-201,693;-46,-653,-744,751,158,-75;550,-514,751,-549,143,-563;41,-201,158,143,-564,-356;84,693,-75,-563,-356,731],[993,644,-32,-19,-163,372;644,467,-377,297,387,-321;-32,-377,920,76,-455,808;-19,297,76,649,-450,71;-163,387,-455,-450,284,-158;372,-321,808,71,-158,529],[246,248,608,-198,-18,405;248,-359,243,479,-563,-14;608,243,-109,140,314,98;-198,479,140,488,264,321;-18,-563,314,264,-853,-387;405,-14,98,321,-387,616],[-637,-606,-12,-32,902,-41;-606,912,162,-371,-284,-739;-12,162,-909,-711,34,-326;-32,-371,-711,379,-626,151;902,-284,34,-626,-716,125;-41,-739,-326,151,125,-764],[-538,-632,-235,904,480,53;-632,-156,-336,-342,82,-172;-235,-336,-24,123,129,-444;904,-342,123,-125,-151,83;480,82,129,-151,70,-48;53,-172,-444,83,-48,-537],[497,-860,-57,197,-237,-131;-860,-312,-391,202,329,550;-57,-391,139,165,49,578;197,202,165,-771,580,131;-237,329,49,580,643,164;-131,550,578,131,164,-341],[-735,583,120,164,-565,-76;583,-174,-174,389,-674,-180;120,-174,464,375,-454,-451;164,389,375,-605,-317,-821;-565,-674,-454,-317,456,-456;-76,-180,-451,-821,-456,-373],[687,580,851,459,139,-93;580,-476,-912,455,-605,381;851,-912,-532,663,140,-736;459,455,663,665,-312,223;139,-605,140,-312,-724,-185;-93,381,-736,223,-185,132],[160,-532,608,-331,-600,60;-532,613,853,310,296,44;608,853,35,54,212,-7;-331,310,54,519,480,33;-600,296,212,480,293,689;60,44,-7,33,689,266],[579,4,-562,-731,175,-782;4,318,392,468,-568,-563;-562,392,-891,348,256,7;-731,468,348,327,-178,-422;175,-568,256,-178,837,-723;-782,-563,7,-422,-723,-238],[-739,453,742,543,-791,-417;453,793,169,-102,-156,-188;742,169,-17,108,-351,-553;543,-102,108,-599,-18,195;-791,-156,-351,-18,-223,-114;-417,-188,-553,195,-114,-322],[-678,-308,-290,52,175,14;-308,-988,-705,135,-705,-532;-290,-705,-291,-494,-87,-725;52,135,-494,-500,-506,-189;175,-705,-87,-506,-943,-583;14,-532,-725,-189,-583,995],[-837,134,-213,-67,200,104;134,-490,-400,635,199,-255;-213,-400,682,59,-221,322;-67,635,59,-797,284,-399;200,199,-221,284,881,577;104,-255,322,-399,577,477],[555,14,-887,-202,695,528;14,-927,330,-314,375,-391;-887,330,-134,464,446,346;-202,-314,464,-313,345,363;695,375,446,345,-79,-184;528,-391,346,363,-184,780],[422,58,282,210,-461,94;58,796,706,258,588,-301;282,706,-838,-252,291,-204;210,258,-252,-718,-112,414;-461,588,291,-112,-480,-630;94,-301,-204,414,-630,-889],[-256,759,-214,685,465,-315;759,-944,538,57,-482,299;-214,538,307,640,-137,403;685,57,640,-235,367,213;465,-482,-137,367,188,33;-315,299,403,213,33,-175],[-880,-536,-590,-111,127,-279;-536,749,-180,-387,331,44;-590,-180,-735,-445,347,-44;-111,-387,-445,704,-43,-22;127,331,347,-43,-197,215;-279,44,-44,-22,215,-766],[356,180,416,168,658,-14;180,-229,-316,-408,-834,-724;416,-316,408,-197,-218,-406;168,-408,-197,-754,88,429;658,-834,-218,88,-244,587;-14,-724,-406,429,587,-556],[-968,504,-302,-234,-393,667;504,-948,-680,598,-100,770;-302,-680,-94,-419,135,-350;-234,598,-419,-386,303,350;-393,-100,135,303,-116,69;667,770,-350,350,69,411],[385,259,177,46,13,120;259,-467,445,-398,210,189;177,445,560,58,-26,560;46,-398,58,-874,224,63;13,210,-26,224,-628,156;120,189,560,63,156,-497],[-124,429,577,-223,-36,405;429,343,-398,-302,448,-48;577,-398,920,304,768,570;-223,-302,304,-55,-415,-71;-36,448,768,-415,906,-490;405,-48,570,-71,-490,-330],[714,684,-730,-19,290,-210;684,-984,59,256,72,280;-730,59,-122,46,-7,936;-19,256,46,-177,-697,-104;290,72,-7,-697,-812,502;-210,280,936,-104,502,956],[-835,240,277,73,220,448;240,921,286,617,309,52;277,286,3,202,21,42;73,617,202,966,233,-318;220,309,21,233,540,-165;448,52,42,-318,-165,-601],[826,58,-448,7,570,254;58,-803,-45,327,496,-321;-448,-45,753,861,396,313;7,327,861,-277,-240,-484;570,496,396,-240,-350,605;254,-321,313,-484,605,477],[-847,-687,565,-182,719,62;-687,299,138,-496,-38,-438;565,138,256,-156,416,41;-182,-496,-156,-816,580,-533;719,-38,416,580,610,118;62,-438,41,-533,118,-910],[-646,-187,760,489,-95,91;-187,-112,-162,-729,-435,-220;760,-162,-249,197,65,180;489,-729,197,-196,-9,250;-95,-435,65,-9,245,520;91,-220,180,250,520,682],[368,-508,-170,198,508,-43;-508,-900,203,-730,-33,-499;-170,203,-192,-47,151,-75;198,-730,-47,82,-271,-61;508,-33,151,-271,324,737;-43,-499,-75,-61,737,417],[982,350,-168,63,808,-314;350,372,-245,-844,427,-780;-168,-245,350,195,122,322;63,-844,195,-138,-112,434;808,427,122,-112,-418,460;-314,-780,322,434,460,-548],[-754,146,14,154,313,436;146,798,668,499,-626,241;14,668,-954,-68,372,386;154,499,-68,-798,619,-444;313,-626,372,619,588,-121;436,241,386,-444,-121,-831],[-822,-100,-182,39,-913,-73;-100,-374,-379,-64,254,-58;-182,-379,-974,-473,-71,-805;39,-64,-473,-169,335,-471;-913,254,-71,335,320,-419;-73,-58,-805,-471,-419,-161],[-649,-296,877,-659,-394,522;-296,804,-65,456,87,-811;877,-65,931,365,284,113;-659,456,365,73,-174,184;-394,87,284,-174,920,498;522,-811,113,184,498,-483],[288,-408,-114,771,519,-372;-408,-362,-282,565,-94,-137;-114,-282,180,-813,-311,-227;771,565,-813,-306,175,-422;519,-94,-311,175,438,5;-372,-137,-227,-422,5,76],[-298,145,-880,-215,268,-450;145,390,415,-316,-284,-189;-880,415,-89,-21,615,-306;-215,-316,-21,486,576,-214;268,-284,615,576,456,258;-450,-189,-306,-214,258,132],[453,260,-81,-494,-121,164;260,-679,662,-549,-175,625;-81,662,-590,-494,144,349;-494,-549,-494,-510,144,-489;-121,-175,144,144,355,546;164,625,349,-489,546,-822],[-326,-26,-165,-218,342,-278;-26,961,-454,-298,-621,-509;-165,-454,927,-413,-84,-789;-218,-298,-413,603,478,709;342,-621,-84,478,549,-67;-278,-509,-789,709,-67,-356],[888,443,211,186,-204,-166;443,518,339,768,635,-52;211,339,626,-115,854,-179;186,768,-115,910,278,-208;-204,635,854,278,-616,663;-166,-52,-179,-208,663,-371],[13,149,-183,503,388,145;149,174,-481,287,-14,744;-183,-481,11,487,209,73;503,287,487,421,469,-933;388,-14,209,469,463,-219;145,744,73,-933,-219,945],[996,129,-245,-267,-30,-569;129,-399,-692,96,-24,70;-245,-692,508,-256,-412,-59;-267,96,-256,-3,286,-96;-30,-24,-412,286,-964,131;-569,70,-59,-96,131,677],[-568,492,-797,-185,-77,-181;492,-608,237,-143,488,270;-797,237,-19,834,473,-442;-185,-143,834,74,-505,714;-77,488,473,-505,-343,-615;-181,270,-442,714,-615,-168],[825,-302,-377,296,221,542;-302,166,174,-89,44,-213;-377,174,-190,195,-711,26;296,-89,195,425,388,190;221,44,-711,388,669,-69;542,-213,26,190,-69,-292],[302,-942,-32,-165,458,115;-942,-9,-21,447,-412,346;-32,-21,728,-513,-514,-422;-165,447,-513,477,390,315;458,-412,-514,390,173,-532;115,346,-422,315,-532,-499],[370,599,-62,-34,-115,57;599,319,433,423,358,-417;-62,433,-994,-74,147,-352;-34,423,-74,886,128,-472;-115,358,147,128,976,-150;57,-417,-352,-472,-150,-775],[946,-23,-247,-316,628,-800;-23,4,290,-227,-567,-930;-247,290,-403,-185,-505,162;-316,-227,-185,-181,485,2;628,-567,-505,485,603,-833;-800,-930,162,2,-833,382];[-657,218,-1,-499,774,297,-562;218,670,298,71,678,450,417;-1,298,-906,345,-505,-13,146;-499,71,345,-163,-45,-350,-9;774,678,-505,-45,464,68,-744;297,450,-13,-350,68,883,-33;-562,417,146,-9,-744,-33,-653],[-651,277,-344,-557,-100,-5,30;277,173,742,649,426,637,138;-344,742,349,-680,182,-76,-124;-557,649,-680,727,235,513,882;-100,426,182,235,252,-194,-8;-5,637,-76,513,-194,-40,-555;30,138,-124,882,-8,-555,984],[-278,169,-928,416,-189,-786,198;169,-688,123,604,-852,-286,421;-928,123,495,-55,-54,172,149;416,604,-55,156,-103,-362,215;-189,-852,-54,-103,-976,80,67;-786,-286,172,-362,80,-328,445;198,421,149,215,67,445,517],[753,310,-161,167,18,192,-314;310,-549,163,639,67,-150,664;-161,163,871,155,248,-423,194;167,639,155,589,-765,-850,-131;18,67,248,-765,-223,-49,-580;192,-150,-423,-850,-49,-803,440;-314,664,194,-131,-580,440,-791],[-898,-426,-688,-411,-129,-434,-26;-426,287,-618,-166,355,-45,-437;-688,-618,-43,-143,394,-406,-272;-411,-166,-143,-714,548,-679,-178;-129,355,394,548,792,348,291;-434,-45,-406,-679,348,338,-506;-26,-437,-272,-178,291,-506,-872],[-669,-536,-125,567,-808,511,-118;-536,197,84,-11,-443,627,-430;-125,84,286,499,-314,9,-34;567,-11,499,-476,11,-699,-53;-808,-443,-314,11,935,18,261;511,627,9,-699,18,634,11;-118,-430,-34,-53,261,11,-169],[-379,96,11,-80,-343,-385,-744;96,681,62,-343,-10,-240,-9;11,62,-642,-767,183,-421,-800;-80,-343,-767,-259,73,-665,-382;-343,-10,183,73,761,-111,-300;-385,-240,-421,-665,-111,195,-170;-744,-9,-800,-382,-300,-170,662],[876,196,80,-115,-372,220,206;196,343,477,60,-128,751,-298;80,477,256,433,496,-477,143;-115,60,433,522,345,-800,338;-372,-128,496,345,-362,86,575;220,751,-477,-800,86,697,123;206,-298,143,338,575,123,-616],[-205,-318,175,-27,-488,270,-295;-318,-753,-278,-529,199,-352,787;175,-278,-968,-412,450,198,602;-27,-529,-412,778,285,-105,941;-488,199,450,285,455,-842,-66;270,-352,198,-105,-842,380,-103;-295,787,602,941,-66,-103,-790],[-462,-521,403,76,-219,-161,-546;-521,-472,179,-303,552,606,-494;403,179,-991,-245,514,337,133;76,-303,-245,-514,87,-233,31;-219,552,514,87,561,151,462;-161,606,337,-233,151,-74,16;-546,-494,133,31,462,16,-631],[505,53,-114,-406,664,319,-243;53,-983,-393,166,-180,-68,-172;-114,-393,-995,-463,-266,127,-821;-406,166,-463,262,13,36,150;664,-180,-266,13,423,42,-635;319,-68,127,36,42,968,480;-243,-172,-821,150,-635,480,-782],[302,-223,276,-96,85,-138,-263;-223,-793,-501,-293,422,529,382;276,-501,-943,207,514,-70,771;-96,-293,207,586,11,338,756;85,422,514,11,120,-390,411;-138,529,-70,338,-390,-419,302;-263,382,771,756,411,302,481],[335,-465,13,-133,-195,16,593;-465,-737,108,-543,-28,-65,-2;13,108,-416,881,-60,863,225;-133,-543,881,-122,-191,-803,463;-195,-28,-60,-191,69,190,312;16,-65,863,-803,190,-573,-331;593,-2,225,463,312,-331,561],[557,-886,-442,139,-237,575,-334;-886,-165,-99,-578,-587,250,123;-442,-99,20,-206,398,-509,-613;139,-578,-206,696,-250,476,52;-237,-587,398,-250,543,-176,742;575,250,-509,476,-176,-668,162;-334,123,-613,52,742,162,-72],[-256,738,-236,-81,521,512,-67;738,300,67,62,-520,34,235;-236,67,780,-469,140,-228,-247;-81,62,-469,-822,502,649,-368;521,-520,140,502,333,-809,84;512,34,-228,649,-809,-75,657;-67,235,-247,-368,84,657,483],[254,-269,69,341,-754,473,147;-269,660,-699,-134,-24,-67,-45;69,-699,35,-307,-16,-47,-528;341,-134,-307,438,342,-610,-74;-754,-24,-16,342,526,-721,646;473,-67,-47,-610,-721,-454,127;147,-45,-528,-74,646,127,-659],[-407,581,-416,67,66,-379,187;581,633,417,225,-352,62,-64;-416,417,85,-214,722,488,518;67,225,-214,-15,95,265,-36;66,-352,722,95,709,98,-614;-379,62,488,265,98,977,-111;187,-64,518,-36,-614,-111,-144],[168,-149,226,-257,-324,-242,256;-149,-395,-559,7,-415,305,667;226,-559,-737,263,-112,-876,431;-257,7,263,-693,-145,436,617;-324,-415,-112,-145,-8,848,-685;-242,305,-876,436,848,-331,-33;256,667,431,617,-685,-33,781],[-493,150,-108,-195,-30,-562,-557;150,-58,-320,79,-129,-456,191;-108,-320,82,441,-625,151,-112;-195,79,441,625,505,134,188;-30,-129,-625,505,113,788,-446;-562,-456,151,134,788,931,52;-557,191,-112,188,-446,52,-693],[-257,20,262,-274,5,446,-284;20,734,-134,-390,-164,378,335;262,-134,990,643,-3,411,-69;-274,-390,643,398,612,218,-65;5,-164,-3,612,443,634,-337;446,378,411,218,634,200,-841;-284,335,-69,-65,-337,-841,340],[-414,-84,167,142,7,298,-197;-84,-576,795,356,596,289,368;167,795,-594,250,428,-7,44;142,356,250,-481,-357,527,-336;7,596,428,-357,-906,-321,140;298,289,-7,527,-321,804,408;-197,368,44,-336,140,408,668],[35,557,-451,383,189,-443,-533;557,832,995,177,-357,273,139;-451,995,-184,442,40,-357,348;383,177,442,226,-487,-215,-284;189,-357,40,-487,398,-83,151;-443,273,-357,-215,-83,-241,-542;-533,139,348,-284,151,-542,831],[956,-222,-121,-224,-8,-422,-439;-222,965,799,-60,127,808,-458;-121,799,548,-769,25,-235,42;-224,-60,-769,-396,350,-309,433;-8,127,25,350,879,276,339;-422,808,-235,-309,276,-39,-29;-439,-458,42,433,339,-29,-717],[-747,583,508,-311,-22,-100,-176;583,558,777,487,25,626,-218;508,777,446,33,-254,-526,-197;-311,487,33,-865,942,-591,-153;-22,25,-254,942,-566,-310,192;-100,626,-526,-591,-310,750,59;-176,-218,-197,-153,192,59,-920],[667,-531,-248,620,-72,-156,-279;-531,665,-153,-237,-231,91,265;-248,-153,-1,306,-352,-492,202;620,-237,306,-891,-340,1,618;-72,-231,-352,-340,779,68,764;-156,91,-492,1,68,137,33;-279,265,202,618,764,33,653],[386,163,-387,-254,-208,-40,737;163,-296,-546,225,-17,99,-15;-387,-546,571,-72,-895,-100,291;-254,225,-72,-195,-222,478,-592;-208,-17,-895,-222,318,-708,-336;-40,99,-100,478,-708,-883,-148;737,-15,291,-592,-336,-148,-698],[431,-211,-112,160,-3,841,366;-211,198,79,-453,-183,223,183;-112,79,243,-204,480,168,-648;160,-453,-204,169,-80,-52,-341;-3,-183,480,-80,-577,274,55;841,223,168,-52,274,-702,-478;366,183,-648,-341,55,-478,928],[431,21,-4,646,197,366,-363;21,48,904,207,-20,476,597;-4,904,-660,754,211,347,407;646,207,754,-647,-10,-39,387;197,-20,211,-10,726,-372,2;366,476,347,-39,-372,-308,274;-363,597,407,387,2,274,77],[709,192,222,174,-105,-173,364;192,-471,-174,-116,-107,338,-4;222,-174,-911,256,118,-443,412;174,-116,256,781,249,-525,-98;-105,-107,118,249,-658,-81,-154;-173,338,-443,-525,-81,854,719;364,-4,412,-98,-154,719,739],[708,-639,135,400,-524,462,384;-639,-711,90,-302,-496,858,-220;135,90,929,324,212,876,-833;400,-302,324,525,335,-20,-493;-524,-496,212,335,67,491,399;462,858,876,-20,491,640,249;384,-220,-833,-493,399,249,421],[-365,216,-176,275,9,-248,-76;216,459,-334,167,121,427,255;-176,-334,-151,146,-879,-846,-181;275,167,146,-387,-162,149,24;9,121,-879,-162,402,768,560;-248,427,-846,149,768,-290,-195;-76,255,-181,24,560,-195,-123],[-225,283,143,-512,790,-529,-203;283,-405,91,328,236,451,-197;143,91,707,294,-156,-39,413;-512,328,294,-517,641,-27,630;790,236,-156,641,892,474,-414;-529,451,-39,-27,474,494,728;-203,-197,413,630,-414,728,445],[293,247,547,-187,-63,-225,-510;247,525,-182,861,-350,482,515;547,-182,-140,-139,-91,-749,303;-187,861,-139,-856,-402,-307,-198;-63,-350,-91,-402,-432,-406,-440;-225,482,-749,-307,-406,665,-243;-510,515,303,-198,-440,-243,313],[431,282,150,482,-570,-252,294;282,224,240,90,-700,-554,-81;150,240,-516,-74,62,373,328;482,90,-74,-313,189,-54,-730;-570,-700,62,189,402,-26,-282;-252,-554,373,-54,-26,-709,-683;294,-81,328,-730,-282,-683,110],[-174,143,517,614,-145,-362,-519;143,741,383,-381,22,-514,-678;517,383,849,-409,-496,-56,497;614,-381,-409,659,-347,340,736;-145,22,-496,-347,526,296,137;-362,-514,-56,340,296,648,95;-519,-678,497,736,137,95,-934],[318,-645,275,-730,-326,633,107;-645,-247,-156,-53,116,-511,-162;275,-156,-630,-570,262,-343,526;-730,-53,-570,-631,690,329,-312;-326,116,262,690,-455,-207,-152;633,-511,-343,329,-207,-711,-496;107,-162,526,-312,-152,-496,-417],[-101,-812,-33,66,-774,363,378;-812,681,-71,-263,-128,747,547;-33,-71,641,531,613,-531,-99;66,-263,531,579,167,-450,0;-774,-128,613,167,638,-645,-153;363,747,-531,-450,-645,304,-43;378,547,-99,0,-153,-43,408],[-386,189,698,382,-278,-611,609;189,-601,2,-478,344,261,301;698,2,710,-587,-393,-304,255;382,-478,-587,98,-652,-87,87;-278,344,-393,-652,-788,-168,-508;-611,261,-304,-87,-168,792,-22;609,301,255,87,-508,-22,672],[1,-104,-86,40,-647,816,-352;-104,406,-81,-537,493,80,-435;-86,-81,-284,-66,554,-623,680;40,-537,-66,-356,29,-443,248;-647,493,554,29,746,138,685;816,80,-623,-443,138,424,34;-352,-435,680,248,685,34,922],[-682,-50,318,-106,241,743,-780;-50,926,20,385,-582,626,237;318,20,-374,-88,-69,-122,-824;-106,385,-88,-49,-469,390,398;241,-582,-69,-469,-978,-624,-206;743,626,-122,390,-624,557,538;-780,237,-824,398,-206,538,868],[-910,-842,182,171,273,-403,17;-842,737,478,-363,723,319,-225;182,478,99,507,-469,54,-186;171,-363,507,427,-128,271,-239;273,723,-469,-128,-682,-455,-389;-403,319,54,271,-455,712,-162;17,-225,-186,-239,-389,-162,892],[-364,164,-488,-562,-12,-482,416;164,652,-86,436,180,-102,20;-488,-86,-351,-471,-252,346,250;-562,436,-471,758,516,-14,163;-12,180,-252,516,204,-524,-219;-482,-102,346,-14,-524,306,101;416,20,250,163,-219,101,-523],[-916,-771,265,-35,-501,783,587;-771,-632,15,187,687,-308,-32;265,15,103,-346,-254,91,89;-35,187,-346,707,-63,14,436;-501,687,-254,-63,440,-502,-91;783,-308,91,14,-502,405,-182;587,-32,89,436,-91,-182,-450],[-53,-809,-515,-200,44,-145,326;-809,-948,512,-124,-898,-316,322;-515,512,936,153,-148,-146,206;-200,-124,153,959,-152,-321,7;44,-898,-148,-152,71,-76,-786;-145,-316,-146,-321,-76,817,-700;326,322,206,7,-786,-700,-662],[-302,67,-462,263,105,8,292;67,327,-823,-42,-113,527,30;-462,-823,417,55,860,-10,425;263,-42,55,173,281,-394,122;105,-113,860,281,-854,-221,-99;8,527,-10,-394,-221,227,-182;292,30,425,122,-99,-182,-346],[-119,795,-290,-384,121,-469,430;795,-552,645,-722,-394,-170,51;-290,645,600,-222,12,-297,117;-384,-722,-222,-454,-223,-475,-789;121,-394,12,-223,-411,321,529;-469,-170,-297,-475,321,-873,182;430,51,117,-789,529,182,-349],[117,509,-692,-458,-347,-602,203;509,279,-346,393,-879,798,-496;-692,-346,-973,97,-705,-283,62;-458,393,97,-21,-167,-709,-206;-347,-879,-705,-167,-400,-300,-501;-602,798,-283,-709,-300,-803,-620;203,-496,62,-206,-501,-620,920],[975,303,-34,653,-515,-128,-160;303,-703,-62,-749,-24,-40,-108;-34,-62,-391,-85,254,-713,-443;653,-749,-85,597,298,-433,-134;-515,-24,254,298,-460,738,375;-128,-40,-713,-433,738,312,487;-160,-108,-443,-134,375,487,-620],[-981,789,214,562,462,-166,172;789,-829,323,554,-240,35,-524;214,323,491,-355,881,-401,74;562,554,-355,639,-211,10,80;462,-240,881,-211,-383,-868,100;-166,35,-401,10,-868,-229,-605;172,-524,74,80,100,-605,-209],[429,863,-528,200,-44,-239,687;863,-427,684,-810,364,101,-64;-528,684,-196,102,247,-284,-142;200,-810,102,-89,-719,-163,137;-44,364,247,-719,775,-524,247;-239,101,-284,-163,-524,-630,37;687,-64,-142,137,247,37,766],[442,-92,461,-146,-273,75,326;-92,721,243,-13,-137,49,325;461,243,-944,-341,-654,63,-261;-146,-13,-341,-232,-147,518,-381;-273,-137,-654,-147,-976,366,-674;75,49,63,518,366,835,584;326,325,-261,-381,-674,584,-946],[458,294,-391,31,-493,233,-911;294,-262,327,-369,388,-85,-94;-391,327,491,-2,275,45,-40;31,-369,-2,-769,-802,-38,108;-493,388,275,-802,65,-592,706;233,-85,45,-38,-592,696,-294;-911,-94,-40,108,706,-294,419],[991,340,-589,-442,-22,210,897;340,258,-15,-71,-366,29,-201;-589,-15,-888,148,149,-278,246;-442,-71,148,-834,-182,-161,-222;-22,-366,149,-182,-625,-676,111;210,29,-278,-161,-676,38,342;897,-201,246,-222,111,342,798],[736,29,739,-519,-41,174,-774;29,-184,24,-309,826,9,-527;739,24,135,-420,306,589,353;-519,-309,-420,-441,-63,-146,-272;-41,826,306,-63,-953,-569,-297;174,9,589,-146,-569,652,-511;-774,-527,353,-272,-297,-511,-479],[-109,587,6,96,377,-33,-97;587,-609,-191,364,-276,-540,-52;6,-191,500,-21,158,-698,249;96,364,-21,746,-2,-430,-804;377,-276,158,-2,498,-389,626;-33,-540,-698,-430,-389,968,-594;-97,-52,249,-804,626,-594,216],[-571,-349,-384,108,271,604,-1;-349,-949,-190,-891,-93,-143,173;-384,-190,652,-74,-346,-159,618;108,-891,-74,-925,-782,-1,345;271,-93,-346,-782,-244,496,485;604,-143,-159,-1,496,724,166;-1,173,618,345,485,166,604],[-613,73,540,200,372,355,166;73,-962,190,-582,-117,-596,393;540,190,155,18,-327,-89,762;200,-582,18,805,-3,529,-308;372,-117,-327,-3,-604,-88,-450;355,-596,-89,529,-88,679,-111;166,393,762,-308,-450,-111,-247],[330,524,-107,-556,-84,57,783;524,663,-148,373,685,-204,405;-107,-148,-216,104,-264,471,51;-556,373,104,-862,97,-167,-661;-84,685,-264,97,261,745,-393;57,-204,471,-167,745,785,54;783,405,51,-661,-393,54,436],[977,-115,278,768,-817,-844,183;-115,287,178,-402,-558,-397,-558;278,178,-402,123,-708,158,-99;768,-402,123,140,-676,245,-9;-817,-558,-708,-676,985,228,187;-844,-397,158,245,228,-950,129;183,-558,-99,-9,187,129,-905],[-418,19,223,349,-143,561,784;19,200,-698,444,18,633,39;223,-698,-923,-365,419,-71,-104;349,444,-365,-116,64,-278,348;-143,18,419,64,-115,-772,526;561,633,-71,-278,-772,-62,360;784,39,-104,348,526,360,495],[-996,-141,409,84,635,-241,327;-141,607,111,-622,154,-49,-450;409,111,-233,-522,114,-388,-35;84,-622,-522,-496,-648,-210,-180;635,154,114,-648,178,-530,-75;-241,-49,-388,-210,-530,-505,-88;327,-450,-35,-180,-75,-88,505],[-505,-167,448,452,616,-300,473;-167,978,237,580,-364,334,104;448,237,948,74,-536,-860,-344;452,580,74,926,-758,31,581;616,-364,-536,-758,-472,-269,300;-300,334,-860,31,-269,464,-374;473,104,-344,581,300,-374,536],[-924,506,-147,-140,841,-163,-94;506,899,168,-373,-132,-214,618;-147,168,701,-230,-200,100,-632;-140,-373,-230,-86,122,-541,-169;841,-132,-200,122,815,874,-462;-163,-214,100,-541,874,521,521;-94,618,-632,-169,-462,521,998],[960,-103,392,192,-61,280,-369;-103,122,-804,-260,-197,314,76;392,-804,348,161,568,-213,10;192,-260,161,634,166,-222,738;-61,-197,568,166,574,179,-130;280,314,-213,-222,179,354,-241;-369,76,10,738,-130,-241,754],[844,283,407,-361,-784,-629,-443;283,895,-741,377,552,545,-356;407,-741,-446,713,-37,-642,-95;-361,377,713,-706,-509,790,-129;-784,552,-37,-509,929,-216,831;-629,545,-642,790,-216,-381,126;-443,-356,-95,-129,831,126,864],[-44,-613,-265,-59,-454,86,-523;-613,695,-185,100,70,-185,261;-265,-185,516,-915,-514,-305,-183;-59,100,-915,-479,673,-599,9;-454,70,-514,673,-97,147,443;86,-185,-305,-599,147,-52,171;-523,261,-183,9,443,171,40],[615,-292,734,37,350,511,-512;-292,394,773,-557,158,-754,212;734,773,466,406,412,519,-125;37,-557,406,964,117,-569,99;350,158,412,117,-131,-741,134;511,-754,519,-569,-741,-996,32;-512,212,-125,99,134,32,34],[-355,-682,-504,-263,483,226,392;-682,-581,45,142,631,-117,-233;-504,45,334,327,765,-196,-286;-263,142,327,-785,367,98,-324;483,631,765,367,482,-40,468;226,-117,-196,98,-40,151,495;392,-233,-286,-324,468,495,-171],[-691,-179,-303,319,211,-212,59;-179,-148,-340,-622,-170,332,323;-303,-340,-233,52,734,-50,-470;319,-622,52,-522,-204,344,-554;211,-170,734,-204,753,37,133;-212,332,-50,344,37,704,260;59,323,-470,-554,133,260,-214],[-430,244,-408,98,568,-419,-263;244,-498,-523,854,-242,436,573;-408,-523,761,-390,554,-762,-188;98,854,-390,526,196,-723,-193;568,-242,554,196,-930,-118,-299;-419,436,-762,-723,-118,-244,409;-263,573,-188,-193,-299,409,-954],[-735,487,539,-167,200,167,212;487,-195,356,-722,-42,338,77;539,356,37,-497,723,-74,388;-167,-722,-497,-702,-357,-134,-83;200,-42,723,-357,-229,-666,547;167,338,-74,-134,-666,482,-26;212,77,388,-83,547,-26,-699],[-560,-459,8,-566,424,-163,266;-459,40,251,-484,847,-77,-806;8,251,-120,431,23,-32,-17;-566,-484,431,114,-392,-411,-456;424,847,23,-392,492,-92,-128;-163,-77,-32,-411,-92,-644,47;266,-806,-17,-456,-128,47,-358],[-616,38,400,782,-451,-560,243;38,641,-945,-72,-426,-80,-308;400,-945,493,161,150,652,-130;782,-72,161,-182,-392,99,236;-451,-426,150,-392,-164,-7,155;-560,-80,652,99,-7,114,-744;243,-308,-130,236,155,-744,558],[-987,-215,49,-444,-384,-381,-367;-215,-468,61,-421,541,86,432;49,61,21,-308,862,-435,239;-444,-421,-308,-762,-189,62,-520;-384,541,862,-189,33,-358,-566;-381,86,-435,62,-358,-652,504;-367,432,239,-520,-566,504,223],[122,769,689,-167,-441,471,-585;769,217,-172,-209,-408,-284,370;689,-172,-762,714,380,131,-200;-167,-209,714,228,-157,153,-664;-441,-408,380,-157,70,476,-347;471,-284,131,153,476,-505,-284;-585,370,-200,-664,-347,-284,-925],[-435,-265,190,-229,366,212,-510;-265,972,-244,142,-542,304,-272;190,-244,492,-69,-610,555,-292;-229,142,-69,110,-380,-179,-362;366,-542,-610,-380,-600,-228,-80;212,304,555,-179,-228,-465,-65;-510,-272,-292,-362,-80,-65,-722],[-177,-233,784,85,183,-223,-84;-233,817,78,344,391,559,-496;784,78,839,224,330,371,230;85,344,224,-278,412,-272,197;183,391,330,412,639,-809,-132;-223,559,371,-272,-809,109,454;-84,-496,230,197,-132,454,-8],[466,393,20,79,-620,-613,-319;393,48,32,520,13,38,-394;20,32,-607,-369,-263,-144,701;79,520,-369,-666,399,-87,536;-620,13,-263,399,-198,640,-619;-613,38,-144,-87,640,-184,751;-319,-394,701,536,-619,751,-506],[-102,-407,-405,-138,-542,-43,669;-407,955,-156,256,-752,-475,-266;-405,-156,759,54,272,-562,123;-138,256,54,555,-155,-458,520;-542,-752,272,-155,432,678,-187;-43,-475,-562,-458,678,-679,863;669,-266,123,520,-187,863,999],[336,672,-224,-42,-744,803,26;672,-74,-277,402,-180,-131,-288;-224,-277,28,-862,-359,-183,-623;-42,402,-862,-49,-396,-288,-147;-744,-180,-359,-396,-399,401,425;803,-131,-183,-288,401,-523,402;26,-288,-623,-147,425,402,671],[343,302,451,869,-728,461,469;302,-479,-552,-94,99,335,343;451,-552,123,137,-22,-150,371;869,-94,137,-567,29,107,749;-728,99,-22,29,-921,126,78;461,335,-150,107,126,-967,774;469,343,371,749,78,774,-392],[304,146,-18,-752,-8,-481,-790;146,133,175,113,212,-370,-62;-18,175,-586,-334,-677,353,-505;-752,113,-334,-440,-592,431,180;-8,212,-677,-592,79,282,350;-481,-370,353,431,282,569,262;-790,-62,-505,180,350,262,725],[-892,304,-153,-826,-17,209,-21;304,-228,-16,751,167,590,495;-153,-16,339,94,-287,-176,-335;-826,751,94,759,-44,338,-62;-17,167,-287,-44,823,-262,72;209,590,-176,338,-262,166,-551;-21,495,-335,-62,72,-551,267],[858,408,-336,620,83,95,247;408,-973,229,-540,326,126,153;-336,229,379,-102,-37,-334,-233;620,-540,-102,51,-72,-782,372;83,326,-37,-72,778,-571,863;95,126,-334,-782,-571,884,101;247,153,-233,372,863,101,292],[805,581,525,-453,374,-453,64;581,665,155,36,-90,357,-181;525,155,-944,691,-432,-147,-299;-453,36,691,-785,-199,514,-43;374,-90,-432,-199,-278,-559,-390;-453,357,-147,514,-559,501,-89;64,-181,-299,-43,-390,-89,821],[-217,-496,-326,151,715,-222,58;-496,-627,281,-323,-691,-42,20;-326,281,754,-327,269,61,-702;151,-323,-327,418,544,349,-7;715,-691,269,544,-52,-146,-94;-222,-42,61,349,-146,23,656;58,20,-702,-7,-94,656,416],[258,-267,-600,-364,-541,52,-36;-267,-964,-55,343,-169,-401,-160;-600,-55,962,143,-364,136,231;-364,343,143,-814,-149,83,547;-541,-169,-364,-149,-297,441,-664;52,-401,136,83,441,-648,125;-36,-160,231,547,-664,125,-186],[708,-24,600,480,556,-701,628;-24,498,-49,-41,94,-69,407;600,-49,-836,281,641,-636,-372;480,-41,281,173,-193,18,351;556,94,641,-193,-414,-33,59;-701,-69,-636,18,-33,58,-212;628,407,-372,351,59,-212,838],[404,379,-164,490,-372,-323,-178;379,121,-352,-507,-379,-58,-253;-164,-352,936,760,534,-648,463;490,-507,760,540,-221,-193,-283;-372,-379,534,-221,965,114,-500;-323,-58,-648,-193,114,588,516;-178,-253,463,-283,-500,516,133],[-274,-8,774,69,632,746,-742;-8,550,834,-903,291,-438,-107;774,834,902,-160,-580,423,-143;69,-903,-160,852,453,216,-372;632,291,-580,453,562,211,56;746,-438,423,216,211,288,-255;-742,-107,-143,-372,56,-255,381],[29,-608,-241,-79,639,-259,44;-608,-80,727,279,150,-707,11;-241,727,-964,-562,-228,271,299;-79,279,-562,233,-245,-250,-16;639,150,-228,-245,208,-249,566;-259,-707,271,-250,-249,-498,342;44,11,299,-16,566,342,502],[-372,69,-132,48,802,42,-573;69,349,-147,702,-346,177,-132;-132,-147,-588,-729,-253,211,373;48,702,-729,-885,994,206,-391;802,-346,-253,994,-654,286,-125;42,177,211,206,286,-412,5;-573,-132,373,-391,-125,5,917],[857,-510,115,216,-52,263,11;-510,906,25,-444,-200,801,-659;115,25,832,493,-543,-283,-80;216,-444,493,-723,-89,-383,-48;-52,-200,-543,-89,228,641,179;263,801,-283,-383,641,-984,390;11,-659,-80,-48,179,390,314],[-786,-107,592,-837,329,-489,-279;-107,326,699,517,-347,109,-273;592,699,852,366,499,16,-329;-837,517,366,939,-584,-909,494;329,-347,499,-584,-172,-535,-62;-489,109,16,-909,-535,-147,223;-279,-273,-329,494,-62,223,442],[-529,-343,-828,-312,-108,143,-370;-343,583,-181,167,-353,654,490;-828,-181,586,334,-153,-633,214;-312,167,334,538,635,-73,-251;-108,-353,-153,635,338,-2,-38;143,654,-633,-73,-2,732,543;-370,490,214,-251,-38,543,-691],[-791,-269,-24,310,42,44,-620;-269,64,-128,341,635,482,-346;-24,-128,-745,451,-170,232,-236;310,341,451,403,466,-26,-684;42,635,-170,466,-274,510,-103;44,482,232,-26,510,35,-232;-620,-346,-236,-684,-103,-232,736],[-410,-80,172,-425,205,677,232;-80,373,214,214,-24,232,-602;172,214,771,493,250,-99,546;-425,214,493,881,-773,-465,-210;205,-24,250,-773,-858,231,664;677,232,-99,-465,231,337,-335;232,-602,546,-210,664,-335,-405],[268,-65,-243,164,-411,352,-74;-65,-70,-191,22,81,89,508;-243,-191,-211,140,-200,-766,687;164,22,140,572,30,-779,441;-411,81,-200,30,-903,-329,510;352,89,-766,-779,-329,276,352;-74,508,687,441,510,352,-884],[183,-42,-185,-223,389,-71,312;-42,365,387,-828,-348,91,-815;-185,387,-561,484,-238,-10,374;-223,-828,484,-835,383,2,397;389,-348,-238,383,-852,-936,152;-71,91,-10,2,-936,834,-652;312,-815,374,397,152,-652,-485],[577,44,346,411,287,817,385;44,293,-391,67,455,-125,-706;346,-391,-393,690,600,-139,601;411,67,690,-29,112,301,-324;287,455,600,112,431,296,-877;817,-125,-139,301,296,-373,255;385,-706,601,-324,-877,255,-210];[808,-278,875,-231,-399,765,-565,50;-278,221,592,-213,177,-142,857,-69;875,592,-413,56,-105,-81,-184,406;-231,-213,56,-429,-157,175,484,135;-399,177,-105,-157,997,663,302,59;765,-142,-81,175,663,-39,137,106;-565,857,-184,484,302,137,-521,-252;50,-69,406,135,59,106,-252,399],[161,157,43,-345,453,649,77,-136;157,-768,194,-548,480,-97,-710,-429;43,194,-445,490,285,-678,923,637;-345,-548,490,215,271,-107,926,102;453,480,285,271,739,-373,-185,-466;649,-97,-678,-107,-373,755,464,-453;77,-710,923,926,-185,464,-617,-261;-136,-429,637,102,-466,-453,-261,-779],[743,-327,77,563,9,-897,132,362;-327,-673,511,210,-354,-168,-545,301;77,511,514,525,-511,-457,122,-456;563,210,525,236,132,29,199,266;9,-354,-511,132,94,158,286,-78;-897,-168,-457,29,158,738,10,-492;132,-545,122,199,286,10,242,-381;362,301,-456,266,-78,-492,-381,767],[551,505,-571,261,236,-131,341,85;505,641,-277,-294,298,-125,11,271;-571,-277,416,390,-95,-423,166,-278;261,-294,390,-219,-483,582,476,-175;236,298,-95,-483,736,-212,209,49;-131,-125,-423,582,-212,-712,-294,110;341,11,166,476,209,-294,-524,-50;85,271,-278,-175,49,110,-50,-539],[475,359,-523,-420,609,-527,-78,-101;359,953,646,-263,-266,-137,5,307;-523,646,348,289,453,-535,-289,-657;-420,-263,289,963,-124,-118,-1,-70;609,-266,453,-124,-338,470,831,300;-527,-137,-535,-118,470,-970,226,517;-78,5,-289,-1,831,226,-634,404;-101,307,-657,-70,300,517,404,366],[980,164,-93,192,119,-740,245,657;164,844,-4,-506,111,284,-440,-335;-93,-4,474,41,7,583,308,434;192,-506,41,52,-17,477,-103,147;119,111,7,-17,3,-449,-606,-38;-740,284,583,477,-449,288,186,-168;245,-440,308,-103,-606,186,588,-283;657,-335,434,147,-38,-168,-283,-608],[702,374,72,726,26,-251,-277,-646;374,-197,772,48,42,-921,-95,183;72,772,-944,671,685,-164,-307,-742;726,48,671,212,86,57,173,606;26,42,685,86,-552,-80,-561,-73;-251,-921,-164,57,-80,72,497,195;-277,-95,-307,173,-561,497,-715,-35;-646,183,-742,606,-73,195,-35,384],[311,-486,254,208,305,101,379,-147;-486,-706,1,375,-160,249,566,-784;254,1,965,-582,-576,72,367,355;208,375,-582,-634,-189,771,-100,526;305,-160,-576,-189,766,-326,-797,366;101,249,72,771,-326,-275,-288,498;379,566,367,-100,-797,-288,-796,295;-147,-784,355,526,366,498,295,-216],[621,385,545,-215,-193,652,-102,-335;385,663,-954,337,-89,-287,-52,295;545,-954,228,-68,-319,-537,54,548;-215,337,-68,128,-189,-89,-541,578;-193,-89,-319,-189,-471,340,-24,-53;652,-287,-537,-89,340,232,201,-740;-102,-52,54,-541,-24,201,-425,-527;-335,295,548,578,-53,-740,-527,935],[-757,829,-286,395,13,484,72,535;829,-659,-621,-139,-267,-51,833,-148;-286,-621,973,-667,136,-158,-20,-334;395,-139,-667,820,-595,275,54,196;13,-267,136,-595,450,157,-109,879;484,-51,-158,275,157,797,686,22;72,833,-20,54,-109,686,209,-440;535,-148,-334,196,879,22,-440,-811],[-810,-857,-276,-493,-173,-325,372,514;-857,171,228,152,592,-219,-809,-613;-276,228,737,-440,158,-63,-17,-24;-493,152,-440,465,392,592,-11,268;-173,592,158,392,-113,158,-58,-431;-325,-219,-63,592,158,593,164,241;372,-809,-17,-11,-58,164,-75,-227;514,-613,-24,268,-431,241,-227,-207],[-320,220,-310,312,251,-597,-2,-48;220,-268,-316,-874,-290,284,-485,327;-310,-316,-550,899,-626,180,-659,263;312,-874,899,187,-23,-716,166,726;251,-290,-626,-23,-140,-255,146,-160;-597,284,180,-716,-255,-256,429,-32;-2,-485,-659,166,146,429,717,38;-48,327,263,726,-160,-32,38,-834],[-26,222,-112,-333,-202,214,90,-711;222,436,-141,344,-370,108,-703,-562;-112,-141,494,-214,11,-781,-221,231;-333,344,-214,865,175,-617,-41,414;-202,-370,11,175,569,182,-413,-311;214,108,-781,-617,182,-617,409,-260;90,-703,-221,-41,-413,409,209,-42;-711,-562,231,414,-311,-260,-42,481],[-564,30,35,-156,437,-180,-133,-249;30,-287,-632,-442,-332,631,-502,-67;35,-632,-917,-31,-191,495,-541,-644;-156,-442,-31,-83,312,-212,116,192;437,-332,-191,312,-299,-112,-316,232;-180,631,495,-212,-112,264,226,-87;-133,-502,-541,116,-316,226,754,-95;-249,-67,-644,192,232,-87,-95,598],[-912,-37,407,599,368,434,324,26;-37,-10,-78,-400,-21,187,-151,603;407,-78,-198,817,111,-796,859,-436;599,-400,817,968,-805,154,-479,592;368,-21,111,-805,-57,-376,-632,-17;434,187,-796,154,-376,743,369,280;324,-151,859,-479,-632,369,-851,658;26,603,-436,592,-17,280,658,-803],[-211,212,428,-720,-651,188,708,-289;212,-780,-18,-345,265,194,-487,48;428,-18,-501,38,343,685,285,25;-720,-345,38,744,244,519,672,425;-651,265,343,244,941,-318,-56,-181;188,194,685,519,-318,12,-413,161;708,-487,285,672,-56,-413,276,-549;-289,48,25,425,-181,161,-549,604],[-262,150,242,-310,314,-665,312,805;150,-403,-540,80,-676,-607,128,-249;242,-540,-208,-712,-542,-247,358,147;-310,80,-712,-127,337,-608,-614,579;314,-676,-542,337,545,-175,-746,-36;-665,-607,-247,-608,-175,-653,74,245;312,128,358,-614,-746,74,-934,564;805,-249,147,579,-36,245,564,86],[-621,172,354,106,936,-47,258,-305;172,-331,95,-233,-331,445,-542,40;354,95,-677,117,-16,-298,162,247;106,-233,117,372,367,-647,-232,-136;936,-331,-16,367,523,274,375,8;-47,445,-298,-647,274,707,-765,291;258,-542,162,-232,375,-765,36,-485;-305,40,247,-136,8,291,-485,-453],[845,-105,-231,350,329,-442,755,132;-105,399,674,634,123,34,-145,94;-231,674,-531,427,170,683,-181,-350;350,634,427,439,450,333,654,65;329,123,170,450,27,209,373,-483;-442,34,683,333,209,359,808,-578;755,-145,-181,654,373,808,235,-349;132,94,-350,65,-483,-578,-349,353],[-54,-425,166,21,458,-478,-71,-682;-425,837,-567,179,-231,166,-555,-1;166,-567,572,71,329,-143,132,-98;21,179,71,766,447,548,-249,-499;458,-231,329,447,-82,-770,-182,-82;-478,166,-143,548,-770,-679,303,55;-71,-555,132,-249,-182,303,-210,-606;-682,-1,-98,-499,-82,55,-606,-368],[-721,246,-538,945,-96,391,-352,-225;246,-99,-25,127,-123,-252,421,-586;-538,-25,836,-549,-188,242,-514,-467;945,127,-549,-67,-54,-308,-641,-797;-96,-123,-188,-54,690,-45,498,393;391,-252,242,-308,-45,233,728,-371;-352,421,-514,-641,498,728,323,-365;-225,-586,-467,-797,393,-371,-365,728],[-585,-371,752,-334,482,193,-119,-166;-371,-666,736,37,-634,575,65,-174;752,736,893,938,124,325,-414,233;-334,37,938,-467,62,-672,100,416;482,-634,124,62,19,-618,-522,180;193,575,325,-672,-618,-131,253,120;-119,65,-414,100,-522,253,-644,-289;-166,-174,233,416,180,120,-289,598],[-834,14,-85,202,-197,503,-44,-425;14,-689,522,-656,108,-258,56,378;-85,522,-379,-334,-421,540,-321,-436;202,-656,-334,521,-642,475,228,-493;-197,108,-421,-642,-881,-119,-114,177;503,-258,540,475,-119,-137,-41,-60;-44,56,-321,228,-114,-41,432,141;-425,378,-436,-493,177,-60,141,759],[-177,-670,-708,580,-790,-437,-319,-249;-670,173,836,-376,-175,52,366,163;-708,836,-848,-301,-568,384,-254,-718;580,-376,-301,892,-36,310,110,-594;-790,-175,-568,-36,-118,-368,-4,-50;-437,52,384,310,-368,-714,19,-852;-319,366,-254,110,-4,19,2,-241;-249,163,-718,-594,-50,-852,-241,8],[-188,-684,-298,581,626,-102,640,-271;-684,-286,-288,6,563,375,-501,454;-298,-288,-904,-198,816,454,-228,-953;581,6,-198,-901,369,393,169,-407;626,563,816,369,-598,53,-48,223;-102,375,454,393,53,-426,-349,3;640,-501,-228,169,-48,-349,-775,91;-271,454,-953,-407,223,3,91,469],[-406,180,601,-134,-338,-95,63,-351;180,932,-550,469,-303,-40,61,657;601,-550,-144,32,-116,-137,-494,-200;-134,469,32,-249,-351,-722,47,-786;-338,-303,-116,-351,811,238,108,-360;-95,-40,-137,-722,238,905,-138,729;63,61,-494,47,108,-138,-307,-188;-351,657,-200,-786,-360,729,-188,-372],[-301,-656,-404,122,-19,-420,519,32;-656,597,-843,358,-870,-408,-391,-86;-404,-843,489,47,384,-497,260,-724;122,358,47,-27,-191,369,-31,261;-19,-870,384,-191,-545,-383,-707,59;-420,-408,-497,369,-383,-550,514,-45;519,-391,260,-31,-707,514,654,-187;32,-86,-724,261,59,-45,-187,-161],[-353,-129,579,82,195,1,272,-273;-129,9,195,812,-184,51,440,82;579,195,-69,-472,-465,312,104,111;82,812,-472,361,659,-204,267,-156;195,-184,-465,659,-714,62,401,868;1,51,312,-204,62,-976,-556,-353;272,440,104,267,401,-556,-326,-96;-273,82,111,-156,868,-353,-96,-597],[91,-161,609,247,729,447,479,-399;-161,209,-393,-128,-19,-315,465,436;609,-393,-513,321,366,186,423,-297;247,-128,321,-119,124,636,-287,-577;729,-19,366,124,-71,335,552,-241;447,-315,186,636,335,519,310,422;479,465,423,-287,552,310,775,366;-399,436,-297,-577,-241,422,366,-355],[864,442,244,-155,-133,-41,-487,571;442,472,-683,-97,-649,-19,-485,-208;244,-683,-671,-128,-199,-608,150,-536;-155,-97,-128,-925,85,167,-183,-527;-133,-649,-199,85,233,279,-334,135;-41,-19,-608,167,279,69,-373,0;-487,-485,150,-183,-334,-373,-106,-426;571,-208,-536,-527,135,0,-426,523],[-277,799,399,46,-158,-105,-472,-446;799,-725,-636,528,427,918,-580,-205;399,-636,340,250,-379,298,78,-671;46,528,250,856,-187,-67,428,-623;-158,427,-379,-187,-784,-648,-372,-213;-105,918,298,-67,-648,271,-176,126;-472,-580,78,428,-372,-176,-837,585;-446,-205,-671,-623,-213,126,585,-866],[384,-598,-133,-338,148,490,-16,-371;-598,-995,648,-350,342,400,-125,32;-133,648,996,505,0,-19,486,334;-338,-350,505,699,-188,238,-14,-539;148,342,0,-188,138,72,-665,-298;490,400,-19,238,72,-151,484,656;-16,-125,486,-14,-665,484,781,90;-371,32,334,-539,-298,656,90,-913],[92,-103,-494,-476,-657,645,189,167;-103,-454,650,198,-5,483,-364,151;-494,650,-948,373,-314,704,-66,-189;-476,198,373,438,325,289,-566,-82;-657,-5,-314,325,52,-318,726,-194;645,483,704,289,-318,22,-205,572;189,-364,-66,-566,726,-205,416,-656;167,151,-189,-82,-194,572,-656,48],[256,-683,-311,472,475,156,8,-81;-683,-560,272,-892,197,-847,-241,-426;-311,272,-332,240,-20,-498,-603,-791;472,-892,240,-68,-38,543,340,-54;475,197,-20,-38,-489,-220,526,-790;156,-847,-498,543,-220,404,33,-444;8,-241,-603,340,526,33,855,-374;-81,-426,-791,-54,-790,-444,-374,-140],[834,120,-67,-684,-158,287,-257,0;120,696,454,-382,221,298,-420,430;-67,454,-831,61,505,88,29,-217;-684,-382,61,723,-59,907,-77,-198;-158,221,505,-59,-790,-96,-243,-44;287,298,88,907,-96,-375,326,338;-257,-420,29,-77,-243,326,-742,542;0,430,-217,-198,-44,338,542,487],[-73,376,-251,-591,142,88,-240,-553;376,392,-586,-685,-342,62,860,219;-251,-586,-980,358,-652,-34,-337,-669;-591,-685,358,-594,66,-704,-283,-462;142,-342,-652,66,185,23,-832,-505;88,62,-34,-704,23,-48,187,363;-240,860,-337,-283,-832,187,-309,-78;-553,219,-669,-462,-505,363,-78,-382],[704,123,-420,-628,168,47,-187,-517;123,-936,335,460,-331,160,-13,300;-420,335,-344,653,525,-826,-226,-89;-628,460,653,-237,111,633,256,44;168,-331,525,111,-218,-414,-423,103;47,160,-826,633,-414,-976,254,455;-187,-13,-226,256,-423,254,726,-701;-517,300,-89,44,103,455,-701,118],[74,-582,-710,287,45,-329,81,-158;-582,483,48,-32,-267,807,-673,-380;-710,48,657,667,-217,-765,-42,921;287,-32,667,-183,-549,724,-303,-390;45,-267,-217,-549,960,295,-273,141;-329,807,-765,724,295,-575,-576,-53;81,-673,-42,-303,-273,-576,-285,-94;-158,-380,921,-390,141,-53,-94,-403],[-363,-189,12,113,-405,265,-209,-520;-189,-265,-291,-8,655,-267,803,235;12,-291,379,316,615,-94,78,148;113,-8,316,804,764,533,-529,-432;-405,655,615,764,-433,-79,-430,-441;265,-267,-94,533,-79,147,-8,-616;-209,803,78,-529,-430,-8,964,-121;-520,235,148,-432,-441,-616,-121,230],[-715,-69,-734,299,-234,696,-106,718;-69,657,-278,445,109,408,-494,-33;-734,-278,447,31,-49,8,84,356;299,445,31,-354,352,-757,34,672;-234,109,-49,352,-899,523,27,240;696,408,8,-757,523,-903,-324,-774;-106,-494,84,34,27,-324,358,-217;718,-33,356,672,240,-774,-217,527],[-583,-373,75,-445,158,99,-393,319;-373,-531,89,-168,206,-120,582,184;75,89,666,118,341,107,76,-283;-445,-168,118,870,91,47,-477,-305;158,206,341,91,-961,84,77,-237;99,-120,107,47,84,647,-663,81;-393,582,76,-477,77,-663,98,-171;319,184,-283,-305,-237,81,-171,128],[-921,-483,442,-562,500,-511,-292,248;-483,-903,107,-330,515,-219,-111,3;442,107,-303,-132,-487,19,564,830;-562,-330,-132,-18,235,-14,-436,354;500,515,-487,235,-836,97,-343,-125;-511,-219,19,-14,97,811,-63,-162;-292,-111,564,-436,-343,-63,39,100;248,3,830,354,-125,-162,100,-238],[429,75,-149,-102,567,-56,350,788;75,-27,-189,302,-275,-157,-136,319;-149,-189,475,-172,82,98,-54,-680;-102,302,-172,192,288,249,728,-21;567,-275,82,288,421,-188,-834,-563;-56,-157,98,249,-188,989,-245,661;350,-136,-54,728,-834,-245,716,-165;788,319,-680,-21,-563,661,-165,-625],[771,-671,-414,135,-676,-505,-283,-540;-671,228,755,322,-429,-87,-218,-102;-414,755,678,120,-281,-41,62,-28;135,322,120,-69,-160,158,73,-533;-676,-429,-281,-160,677,-133,-518,821;-505,-87,-41,158,-133,-701,87,164;-283,-218,62,73,-518,87,-494,-727;-540,-102,-28,-533,821,164,-727,8],[7,-57,-530,89,212,72,221,-397;-57,-984,-288,-134,-115,-237,16,-609;-530,-288,-355,-75,487,-208,320,48;89,-134,-75,-20,-223,-303,-62,-119;212,-115,487,-223,-657,-306,248,-290;72,-237,-208,-303,-306,375,-375,154;221,16,320,-62,248,-375,-568,-201;-397,-609,48,-119,-290,154,-201,-626],[-320,-26,261,617,-684,-155,-3,-251;-26,-683,-415,890,596,106,194,-555;261,-415,-11,184,106,611,159,-57;617,890,184,122,-552,755,644,-332;-684,596,106,-552,164,-389,-260,-35;-155,106,611,755,-389,90,442,196;-3,194,159,644,-260,442,7,83;-251,-555,-57,-332,-35,196,83,-862],[-115,-242,247,-150,-239,-13,340,-158;-242,889,-712,172,-772,48,37,172;247,-712,749,333,-221,-244,-206,-474;-150,172,333,36,389,374,-73,-204;-239,-772,-221,389,599,-311,36,-293;-13,48,-244,374,-311,-985,-43,-149;340,37,-206,-73,36,-43,-949,633;-158,172,-474,-204,-293,-149,633,-202],[185,390,-301,-518,11,382,285,112;390,166,-418,66,-113,-163,-552,-874;-301,-418,-736,317,-216,713,-36,-508;-518,66,317,-191,865,108,964,218;11,-113,-216,865,-994,-528,234,-54;382,-163,713,108,-528,-481,509,742;285,-552,-36,964,234,509,-181,-354;112,-874,-508,218,-54,742,-354,606],[225,-41,-323,-325,857,2,-111,852;-41,-296,-186,181,-1,77,-152,-513;-323,-186,-964,372,-599,-264,24,-232;-325,181,372,-285,22,225,-502,-88;857,-1,-599,22,-500,354,352,114;2,77,-264,225,354,247,77,-245;-111,-152,24,-502,352,77,823,272;852,-513,-232,-88,114,-245,272,-640],[-882,182,-721,-2,708,658,-128,-405;182,-600,-779,-15,-33,-307,3,500;-721,-779,726,14,816,30,79,-513;-2,-15,14,-937,-385,-212,106,-673;708,-33,816,-385,652,857,125,-490;658,-307,30,-212,857,327,478,-519;-128,3,79,106,125,478,604,348;-405,500,-513,-673,-490,-519,348,-49],[-247,279,-233,300,-596,536,107,119;279,-955,-57,-108,-312,-241,-470,-649;-233,-57,968,-576,-494,160,-80,254;300,-108,-576,-275,258,-208,-187,-574;-596,-312,-494,258,312,301,262,202;536,-241,160,-208,301,-13,-220,-389;107,-470,-80,-187,262,-220,292,412;119,-649,254,-574,202,-389,412,428],[-992,-65,97,-390,110,-593,65,469;-65,849,100,813,302,-85,1,445;97,100,-914,841,-808,149,-604,-588;-390,813,841,-444,-129,338,276,-397;110,302,-808,-129,672,316,-197,88;-593,-85,149,338,316,350,-83,-642;65,1,-604,276,-197,-83,-872,249;469,445,-588,-397,88,-642,249,900],[-518,-140,218,137,-57,-375,618,614;-140,-544,255,156,-208,424,45,-306;218,255,851,-169,-208,100,432,-277;137,156,-169,276,-540,435,-567,591;-57,-208,-208,-540,-706,360,79,-168;-375,424,100,435,360,-959,-542,39;618,45,432,-567,79,-542,243,-547;614,-306,-277,591,-168,39,-547,985],[659,-3,124,177,-179,-29,764,-387;-3,-481,302,172,-11,23,30,-255;124,302,-722,255,-99,496,247,-661;177,172,255,-551,584,364,27,83;-179,-11,-99,584,-849,-119,-627,91;-29,23,496,364,-119,-189,195,-173;764,30,247,27,-627,195,-196,-547;-387,-255,-661,83,91,-173,-547,558],[-467,572,-60,174,-365,155,-386,-903;572,-724,298,97,302,-434,-77,173;-60,298,-941,-511,178,212,434,191;174,97,-511,-928,831,-352,584,114;-365,302,178,831,-165,-25,-308,-87;155,-434,212,-352,-25,-254,-314,-740;-386,-77,434,584,-308,-314,236,173;-903,173,191,114,-87,-740,173,-567],[584,220,-533,423,173,214,-377,623;220,662,-31,912,-94,45,606,512;-533,-31,-451,-122,-411,65,393,855;423,912,-122,-142,348,-541,449,368;173,-94,-411,348,934,376,213,-579;214,45,65,-541,376,700,116,432;-377,606,393,449,213,116,-404,-43;623,512,855,368,-579,432,-43,-804],[542,64,-578,858,-678,-686,373,-98;64,314,-421,610,-603,-73,414,-411;-578,-421,-644,-311,-172,136,198,-320;858,610,-311,639,941,-22,142,397;-678,-603,-172,941,-831,304,-262,-155;-686,-73,136,-22,304,463,-216,-88;373,414,198,142,-262,-216,236,-381;-98,-411,-320,397,-155,-88,-381,-264],[773,-819,-786,105,-88,-614,-700,-859;-819,-558,-403,725,-163,-168,-124,-35;-786,-403,-618,-257,-685,369,357,471;105,725,-257,430,-530,473,-178,347;-88,-163,-685,-530,-794,197,144,708;-614,-168,369,473,197,-255,282,237;-700,-124,357,-178,144,282,757,451;-859,-35,471,347,708,237,451,134],[-829,21,-560,-575,193,-236,-375,-315;21,-125,31,-537,-127,-577,-390,-607;-560,31,801,-352,13,-126,-42,169;-575,-537,-352,509,231,25,-174,122;193,-127,13,231,201,550,134,419;-236,-577,-126,25,550,-591,-149,-534;-375,-390,-42,-174,134,-149,-158,-290;-315,-607,169,122,419,-534,-290,412],[311,371,379,404,213,474,314,-104;371,683,-450,107,66,-27,35,37;379,-450,-232,17,-94,115,603,-1;404,107,17,-500,768,634,-765,14;213,66,-94,768,-80,62,-318,-243;474,-27,115,634,62,486,-331,594;314,35,603,-765,-318,-331,910,-389;-104,37,-1,14,-243,594,-389,-788],[-796,156,607,220,-460,23,-736,-365;156,620,-547,-507,-226,418,40,-217;607,-547,-238,283,-676,-375,77,263;220,-507,283,-262,-30,46,130,-325;-460,-226,-676,-30,-83,7,434,-307;23,418,-375,46,7,-664,756,-274;-736,40,77,130,434,756,601,65;-365,-217,263,-325,-307,-274,65,867],[332,-160,-560,30,-455,505,-16,-30;-160,227,293,157,-68,-201,-32,341;-560,293,-676,682,392,85,60,385;30,157,682,350,585,-1,-314,-117;-455,-68,392,585,571,224,-112,720;505,-201,85,-1,224,-69,-83,-237;-16,-32,60,-314,-112,-83,-20,333;-30,341,385,-117,720,-237,333,-638],[-257,400,-726,473,104,-420,-104,-332;400,-219,-591,389,-249,-163,230,-100;-726,-591,-491,-311,-280,605,-699,89;473,389,-311,-729,203,-358,451,-77;104,-249,-280,203,-113,-682,544,330;-420,-163,605,-358,-682,551,609,-65;-104,230,-699,451,544,609,921,-452;-332,-100,89,-77,330,-65,-452,575],[-172,-171,-32,549,-113,328,-33,-219;-171,-630,843,-273,-135,-17,-395,-30;-32,843,-249,-309,50,-250,481,525;549,-273,-309,-945,521,766,134,488;-113,-135,50,521,808,-341,311,485;328,-17,-250,766,-341,-684,846,-132;-33,-395,481,134,311,846,-536,-541;-219,-30,525,488,485,-132,-541,-235],[-7,-168,267,44,525,215,739,74;-168,-792,105,575,643,-374,-272,613;267,105,911,841,-72,316,-390,-109;44,575,841,-348,142,53,-49,-176;525,643,-72,142,369,463,269,-86;215,-374,316,53,463,-217,197,-37;739,-272,-390,-49,269,197,-922,32;74,613,-109,-176,-86,-37,32,595],[-211,856,-146,-570,-229,-636,-109,282;856,-94,-63,409,-620,234,498,641;-146,-63,134,90,533,93,156,-454;-570,409,90,-568,-617,-89,33,-511;-229,-620,533,-617,396,-278,526,-220;-636,234,93,-89,-278,456,-308,700;-109,498,156,33,526,-308,-456,-540;282,641,-454,-511,-220,700,-540,-886],[143,-192,-28,-357,370,50,359,143;-192,-232,729,-314,767,55,108,-599;-28,729,-278,12,-316,803,-842,869;-357,-314,12,-420,552,-467,634,388;370,767,-316,552,-500,-42,212,-277;50,55,803,-467,-42,392,885,98;359,108,-842,634,212,885,-183,-117;143,-599,869,388,-277,98,-117,938],[-801,780,-373,306,688,-182,573,-120;780,-749,424,-128,-456,584,116,-312;-373,424,-407,-389,-408,153,-533,48;306,-128,-389,571,-142,687,-170,-137;688,-456,-408,-142,17,-236,-234,507;-182,584,153,687,-236,-819,-447,865;573,116,-533,-170,-234,-447,-451,-411;-120,-312,48,-137,507,865,-411,459],[-157,-171,263,17,-728,-193,762,257;-171,-413,-239,-868,431,364,-566,-172;263,-239,-37,-585,311,362,-186,715;17,-868,-585,797,-416,-674,138,-520;-728,431,311,-416,-918,-227,-483,483;-193,364,362,-674,-227,-581,-508,923;762,-566,-186,138,-483,-508,42,-343;257,-172,715,-520,483,923,-343,-720],[367,329,361,-44,320,-128,349,580;329,-827,370,37,412,-234,358,399;361,370,-232,231,-103,-208,778,-174;-44,37,231,471,-605,450,-70,-310;320,412,-103,-605,416,229,143,-225;-128,-234,-208,450,229,-617,561,771;349,358,778,-70,143,561,-742,6;580,399,-174,-310,-225,771,6,-852],[-229,-391,772,601,-348,-207,312,952;-391,-368,-245,265,170,252,694,109;772,-245,893,-441,156,235,-210,-620;601,265,-441,838,585,-262,753,-32;-348,170,156,585,465,476,-52,-421;-207,252,235,-262,476,986,-370,-203;312,694,-210,753,-52,-370,-897,521;952,109,-620,-32,-421,-203,521,506],[-895,-403,690,-490,130,-670,-27,837;-403,-392,384,-401,932,195,-213,-813;690,384,658,205,448,-825,182,-445;-490,-401,205,-742,-179,-657,-368,36;130,932,448,-179,-606,717,-29,176;-670,195,-825,-657,717,-861,271,-35;-27,-213,182,-368,-29,271,541,369;837,-813,-445,36,176,-35,369,-628],[-208,-129,8,142,-466,103,11,-558;-129,136,84,631,198,715,-292,-724;8,84,-917,-178,-648,-243,868,-444;142,631,-178,-893,-614,792,146,-291;-466,198,-648,-614,22,83,-180,245;103,715,-243,792,83,-465,22,413;11,-292,868,146,-180,22,-818,895;-558,-724,-444,-291,245,413,895,617],[-749,13,400,364,-214,-750,632,-364;13,-929,664,398,-182,30,80,115;400,664,-703,58,84,472,-419,-60;364,398,58,-487,162,-686,-466,-577;-214,-182,84,162,138,504,674,759;-750,30,472,-686,504,439,770,311;632,80,-419,-466,674,770,859,393;-364,115,-60,-577,759,311,393,787],[-780,366,-190,-207,963,-465,-393,-877;366,-624,-844,-177,571,-282,-3,430;-190,-844,-927,753,440,-517,-286,378;-207,-177,753,-189,540,-9,322,889;963,571,440,540,-286,141,272,219;-465,-282,-517,-9,141,411,268,-27;-393,-3,-286,322,272,268,-738,-192;-877,430,378,889,219,-27,-192,462],[-969,275,-875,-677,-65,29,-457,281;275,-833,262,116,-111,-162,-803,262;-875,262,773,56,-424,277,613,-156;-677,116,56,-825,187,-17,-92,-595;-65,-111,-424,187,401,49,-206,235;29,-162,277,-17,49,4,-2,-491;-457,-803,613,-92,-206,-2,87,-117;281,262,-156,-595,235,-491,-117,746],[662,-401,-344,169,-494,-266,58,-462;-401,282,-394,-578,583,-777,129,-408;-344,-394,130,-422,-675,-224,-202,844;169,-578,-422,-772,46,-336,285,193;-494,583,-675,46,257,519,-626,361;-266,-777,-224,-336,519,-710,-395,-567;58,129,-202,285,-626,-395,197,-529;-462,-408,844,193,361,-567,-529,825],[771,-245,-364,456,818,466,-355,418;-245,683,63,841,-615,-647,-229,-571;-364,63,-904,-357,-173,248,-72,-122;456,841,-357,551,-822,-150,-466,-277;818,-615,-173,-822,26,-44,590,-105;466,-647,248,-150,-44,697,-201,462;-355,-229,-72,-466,590,-201,200,-273;418,-571,-122,-277,-105,462,-273,-389],[965,-217,305,-118,-647,45,-167,309;-217,400,-58,-466,871,47,24,-351;305,-58,600,440,81,-628,392,-551;-118,-466,440,821,30,408,-66,334;-647,871,81,30,372,-576,599,-252;45,47,-628,408,-576,-48,120,-643;-167,24,392,-66,599,120,376,-424;309,-351,-551,334,-252,-643,-424,353],[-551,-129,218,172,224,294,-114,759;-129,786,-11,-40,-258,-180,216,-302;218,-11,-593,339,-345,464,297,-39;172,-40,339,918,403,-652,524,-436;224,-258,-345,403,304,-88,731,-248;294,-180,464,-652,-88,-967,180,-17;-114,216,297,524,731,180,-709,369;759,-302,-39,-436,-248,-17,369,671],[751,511,288,32,-487,-406,560,-452;511,694,174,-578,-261,78,740,-114;288,174,-655,-159,93,-592,171,-450;32,-578,-159,-300,-98,-871,-337,414;-487,-261,93,-98,-360,130,114,734;-406,78,-592,-871,130,-107,-67,-138;560,740,171,-337,114,-67,-524,-192;-452,-114,-450,414,734,-138,-192,-172],[-409,-70,-354,16,302,674,-392,37;-70,812,-82,-106,-660,443,52,-681;-354,-82,-971,-380,676,0,78,-649;16,-106,-380,209,826,238,-415,-588;302,-660,676,826,691,-912,-414,392;674,443,0,238,-912,271,-704,-648;-392,52,78,-415,-414,-704,-564,238;37,-681,-649,-588,392,-648,238,143],[49,-361,-254,183,596,77,-489,223;-361,690,-97,731,-794,321,218,-377;-254,-97,-213,-178,50,-583,-87,-61;183,731,-178,-75,478,-828,194,635;596,-794,50,478,443,-66,-569,482;77,321,-583,-828,-66,-710,-145,152;-489,218,-87,194,-569,-145,-186,76;223,-377,-61,635,482,152,76,280],[12,-62,256,-318,-301,163,517,676;-62,140,-179,192,722,422,-51,460;256,-179,865,256,-222,223,512,-360;-318,192,256,-693,-478,-147,-717,-12;-301,722,-222,-478,356,-483,-401,58;163,422,223,-147,-483,615,-348,208;517,-51,512,-717,-401,-348,-94,658;676,460,-360,-12,58,208,658,774],[-482,-99,101,290,699,779,444,4;-99,-530,-619,805,-731,303,494,432;101,-619,35,-658,283,-201,776,133;290,805,-658,149,-429,40,117,-153;699,-731,283,-429,501,-178,-100,457;779,303,-201,40,-178,795,7,151;444,494,776,117,-100,7,790,-32;4,432,133,-153,457,151,-32,450],[-102,-121,606,747,-445,650,-248,-322;-121,-324,623,449,-222,79,-5,284;606,623,638,-378,-312,306,-624,223;747,449,-378,426,317,-322,-254,789;-445,-222,-312,317,80,-69,-729,-560;650,79,306,-322,-69,-4,19,290;-248,-5,-624,-254,-729,19,-786,717;-322,284,223,789,-560,290,717,536],[769,728,83,-893,-123,303,-727,73;728,2,44,-400,-118,-698,-106,462;83,44,611,395,-65,253,-311,-104;-893,-400,395,-888,-445,221,-342,454;-123,-118,-65,-445,-498,-643,-461,396;303,-698,253,221,-643,-309,-84,-275;-727,-106,-311,-342,-461,-84,-77,-83;73,462,-104,454,396,-275,-83,-915],[-264,-34,-773,-380,-165,-238,-451,233;-34,411,276,-418,-599,-411,-329,-122;-773,276,-527,-522,-863,-540,-534,-267;-380,-418,-522,-922,143,-219,-640,719;-165,-599,-863,143,-8,-426,-780,688;-238,-411,-540,-219,-426,956,578,525;-451,-329,-534,-640,-780,578,-482,611;233,-122,-267,719,688,525,611,-91],[-727,-204,-407,561,715,523,97,403;-204,321,6,-311,-835,-57,-320,-651;-407,6,-734,328,-513,-315,-684,467;561,-311,328,472,389,-406,158,144;715,-835,-513,389,-670,293,-288,243;523,-57,-315,-406,293,-126,-424,3;97,-320,-684,158,-288,-424,-20,-409;403,-651,467,144,243,3,-409,-404],[585,-649,-20,-788,-492,233,-3,-459;-649,592,-444,-52,108,-208,60,-471;-20,-444,-670,-284,112,-614,437,-51;-788,-52,-284,-851,-380,-418,-83,313;-492,108,112,-380,659,484,-148,-851;233,-208,-614,-418,484,-878,-229,-51;-3,60,437,-83,-148,-229,856,-48;-459,-471,-51,313,-851,-51,-48,-736],[-632,792,-88,-409,-516,253,57,7;792,-950,26,-138,-687,-384,-321,221;-88,26,395,-111,124,78,-866,9;-409,-138,-111,485,-381,-61,-227,-21;-516,-687,124,-381,-621,-608,-847,-447;253,-384,78,-61,-608,-807,-31,289;57,-321,-866,-227,-847,-31,-293,1;7,221,9,-21,-447,289,1,537],[-809,-182,-507,-173,66,-252,384,362;-182,973,76,-203,132,-386,-237,-167;-507,76,768,580,-290,-558,479,-341;-173,-203,580,561,346,469,-259,55;66,132,-290,346,-992,-268,-890,-687;-252,-386,-558,469,-268,770,382,-15;384,-237,479,-259,-890,382,735,-448;362,-167,-341,55,-687,-15,-448,-161],[862,-108,755,-38,-596,137,-448,-350;-108,763,-551,-180,-255,-748,-630,298;755,-551,543,495,442,833,91,-214;-38,-180,495,24,-157,-970,-101,-680;-596,-255,442,-157,468,-23,830,-133;137,-748,833,-970,-23,-377,-425,67;-448,-630,91,-101,830,-425,-360,-172;-350,298,-214,-680,-133,67,-172,-555],[445,-67,205,766,-107,-244,645,-225;-67,-335,16,578,-516,561,37,159;205,16,566,-155,79,35,336,12;766,578,-155,-980,-589,-244,278,-707;-107,-516,79,-589,604,149,-175,487;-244,561,35,-244,149,996,333,-445;645,37,336,278,-175,333,552,167;-225,159,12,-707,487,-445,167,-196],[719,465,663,-460,488,254,289,543;465,696,-397,462,-45,-60,-52,-414;663,-397,-498,-795,-1,85,-641,542;-460,462,-795,448,149,-162,-191,103;488,-45,-1,149,846,-310,151,-451;254,-60,85,-162,-310,-209,329,-401;289,-52,-641,-191,151,329,523,-535;543,-414,542,103,-451,-401,-535,-482],[686,168,490,158,-28,-255,-603,-335;168,81,80,586,-518,-173,-347,-52;490,80,681,-523,-47,726,175,-173;158,586,-523,-623,633,-510,-341,240;-28,-518,-47,633,-244,6,163,680;-255,-173,726,-510,6,-38,-308,536;-603,-347,175,-341,163,-308,373,-285;-335,-52,-173,240,680,536,-285,928],[-645,493,252,544,490,-55,678,489;493,300,175,264,592,-118,-149,162;252,175,506,-71,-783,476,-311,-383;544,264,-71,807,15,310,5,-54;490,592,-783,15,-208,-24,24,602;-55,-118,476,310,-24,-661,-438,622;678,-149,-311,5,24,-438,-191,-717;489,162,-383,-54,602,622,-717,633],[-649,492,-617,-501,436,492,68,420;492,-527,158,451,-751,-511,-27,362;-617,158,47,-742,287,-440,-207,-633;-501,451,-742,60,3,591,-272,576;436,-751,287,3,987,171,-341,216;492,-511,-440,591,171,754,-589,72;68,-27,-207,-272,-341,-589,-457,-540;420,362,-633,576,216,72,-540,-671],[-987,-794,-212,262,437,361,75,10;-794,-864,54,258,-749,196,-740,559;-212,54,-981,347,117,-94,-148,270;262,258,347,-102,186,251,-199,617;437,-749,117,186,308,-212,244,-56;361,196,-94,251,-212,630,404,-369;75,-740,-148,-199,244,404,-236,-387;10,559,270,617,-56,-369,-387,216],[460,-64,-595,-579,468,780,626,353;-64,-439,223,-29,-324,286,748,-228;-595,223,727,867,481,106,670,90;-579,-29,867,120,-139,-151,35,144;468,-324,481,-139,-673,229,347,552;780,286,106,-151,229,319,273,210;626,748,670,35,347,273,646,-330;353,-228,90,144,552,210,-330,-173]];} +TEST(deb=1,fin=6)= +{ + for(i=deb,fin, + print("dim=",i+2); + for(j=1,100, + Q=M[i,j]; + s=qfsolve(Q); + if(type(s)=="t_INT", print([j,s]), if(s~*Q*s, error(Q))); + ); + ); +} +TEST() + +G = [1,0,0;0,1,0;0,0,-34]; +qfparam(G, qfsolve(G)) +qfparam(G, qfsolve(G),1) +qfparam(G, qfsolve(G),2) + +qfsolve(Mat(0)) +qfsolve(Mat(1)) +qfsolve([1,2;2,1]) +qfsolve([0,1;1,1]) +qfsolve([35, 46; 46, 60]) + +qfparam(matdiagonal([1,1,-1]),[1,0,1]) +qfsolve(matdiagonal([1,1,-25])) + +qfsolve([1,0,0;0,3,0;0,0,-2]) +qfparam([0,0,-12;0,-12,0;-12,0,-1],[1,0,0]~,3) +q=[-1,-4,-8;-4,-15,-31;-8,-31,-62]/4; qfparam(q,qfsolve(q)) + +\\#1661 +qfsolve([1,0,0;0,1,1;0,0,1]); +\\#1725 +qfsolve(matdiagonal([1,1,1,1,1,1,-7])) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestQfsolve(unittest.TestCase): + def test_qfsolve(self): + M = [['[-634,-706,-200;-706,527,-110;-200,-110,-997]', '[-670,164,205;164,-391,-509;205,-509,-117]', + '[586,-448,120;-448,-342,-233;120,-233,-851]', '[-387,-147,450;-147,-808,-22;450,-22,-119]', + '[739,-44,-48;-44,-739,-134;-48,-134,459]', '[-519,-45,-514;-45,324,178;-514,178,-83]', + '[-482,-683,18;-683,705,852;18,852,315]', '[808,-16,555;-16,-723,-538;555,-538,-66]', + '[243,205,-14;205,-119,853;-14,853,891]', '[-220,10,-564;10,-440,-9;-564,-9,413]', + '[383,66,53;66,-962,-104;53,-104,300]', '[-845,257,264;257,-7,-866;264,-866,259]', + '[-76,676,371;676,-541,-332;371,-332,-417]', '[111,-203,-57;-203,-634,-30;-57,-30,275]', + '[-926,-548,-178;-548,483,141;-178,141,-953]', '[-810,-164,648;-164,-802,-612;648,-612,-274]', + '[818,88,630;88,369,524;630,524,-565]', '[-165,99,-70;99,83,-716;-70,-716,-493]', + '[-183,56,320;56,509,-931;320,-931,-543]', '[19,799,-94;799,-866,-658;-94,-658,-604]', + '[-859,-569,525;-569,476,217;525,217,-852]', '[-527,708,47;708,22,-79;47,-79,902]', + '[360,-425,126;-425,-578,-411;126,-411,581]', '[2,821,59;821,-893,524;59,524,-788]', + '[470,155,-752;155,-679,-683;-752,-683,-584]', '[398,107,-644;107,-840,374;-644,374,-274]', + '[-839,8,-410;8,-451,-774;-410,-774,801]', '[-556,-134,-368;-134,183,566;-368,566,686]', + '[-62,354,-396;354,313,350;-396,350,-891]', '[518,163,17;163,821,332;17,332,-593]', + '[574,-155,19;-155,424,305;19,305,-978]', '[-720,873,341;873,-131,-116;341,-116,-414]', + '[417,-39,201;-39,910,-9;201,-9,-538]', '[-34,-193,-22;-193,-632,362;-22,362,-778]', + '[36,-748,-131;-748,-21,147;-131,147,-143]', '[-236,-560,-211;-560,803,-632;-211,-632,620]', + '[708,-76,-360;-76,814,248;-360,248,263]', '[790,-271,-338;-271,-114,-400;-338,-400,-12]', + '[-744,-737,-70;-737,-270,-754;-70,-754,816]', '[-845,520,141;520,-559,73;141,73,132]', + '[-276,406,-305;406,153,-349;-305,-349,41]', '[632,62,653;62,-125,439;653,439,-256]', + '[-598,-39,-488;-39,-36,461;-488,461,-506]', '[406,99,-178;99,747,-99;-178,-99,781]', + '[686,-38,-491;-38,-330,-564;-491,-564,253]', '[427,69,-615;69,933,215;-615,215,-558]', + '[290,-326,-365;-326,928,208;-365,208,754]', '[-149,-113,197;-113,877,292;197,292,233]', + '[-701,-265,776;-265,911,-259;776,-259,-531]', '[81,-169,-170;-169,445,-107;-170,-107,632]', + '[-433,153,215;153,15,-362;215,-362,-77]', '[-108,10,-734;10,-133,-88;-734,-88,-154]', + '[-48,-365,-68;-365,413,-217;-68,-217,-436]', '[162,-63,184;-63,-728,-240;184,-240,-845]', + '[-96,-233,-747;-233,951,833;-747,833,-30]', '[-314,-311,-656;-311,322,-663;-656,-663,-639]', + '[-106,-465,-662;-465,-111,53;-662,53,-97]', '[-410,166,-445;166,-565,104;-445,104,823]', + '[180,-312,19;-312,984,-10;19,-10,701]', '[-165,936,-247;936,103,743;-247,743,-414]', + '[-571,451,-527;451,419,-499;-527,-499,-473]', '[-680,182,651;182,-194,-89;651,-89,-889]', + '[670,75,246;75,72,609;246,609,-58]', '[-929,-764,508;-764,-984,-405;508,-405,-915]', + '[102,736,116;736,634,722;116,722,-656]', '[33,214,-533;214,-205,-453;-533,-453,844]', + '[235,270,-692;270,68,-323;-692,-323,729]', '[945,236,5;236,-506,329;5,329,866]', + '[885,-737,539;-737,908,146;539,146,314]', '[-179,-252,-29;-252,-966,442;-29,442,-116]', + '[-496,-25,-581;-25,-90,-136;-581,-136,492]', '[513,432,-290;432,-708,47;-290,47,-933]', + '[364,-386,-310;-386,-460,224;-310,224,-363]', '[-124,214,795;214,-930,-213;795,-213,818]', + '[69,-552,-189;-552,807,-300;-189,-300,249]', '[-977,-141,-158;-141,169,199;-158,199,-355]', + '[929,268,383;268,945,618;383,618,943]', '[177,-329,-78;-329,-953,216;-78,216,644]', + '[-335,-314,-76;-314,-572,-229;-76,-229,-214]', '[609,-226,65;-226,578,271;65,271,-938]', + '[962,-213,483;-213,-159,383;483,383,473]', '[-821,-501,368;-501,-602,489;368,489,461]', + '[-636,-385,597;-385,-913,903;597,903,849]', '[967,350,-825;350,352,475;-825,475,974]', + '[-982,7,98;7,-563,-840;98,-840,-726]', '[-504,81,-124;81,-470,191;-124,191,-846]', + '[756,273,253;273,932,348;253,348,331]', '[52,-645,783;-645,-606,-565;783,-565,918]', + '[22,-781,-238;-781,-382,-637;-238,-637,-618]', '[-405,497,-397;497,-489,-593;-397,-593,-916]', + '[-856,5,85;5,-866,-24;85,-24,-540]', '[764,-153,9;-153,362,-127;9,-127,-1000]', + '[-551,-637,624;-637,-864,361;624,361,12]', '[-522,203,-199;203,-239,-581;-199,-581,-228]', + '[724,644,245;644,71,456;245,456,983]', '[-369,-142,164;-142,-644,302;164,302,580]', + '[-485,-786,-362;-786,-207,-326;-362,-326,-257]', '[373,-271,514;-271,734,390;514,390,-410]', + '[-223,-301,32;-301,-480,-549;32,-549,358]', '[-501,82,-557;82,609,-296;-557,-296,962]'], + ['[394,-209,-606,-399;-209,-552,157,-626;-606,157,144,-188;-399,-626,-188,293]', + '[-870,-559,-338,-156;-559,931,293,-7;-338,293,-920,46;-156,-7,46,-563]', + '[703,435,-32,-310;435,-313,103,-144;-32,103,-262,64;-310,-144,64,-769]', + '[523,481,141,-252;481,-291,-403,7;141,-403,-625,-556;-252,7,-556,847]', + '[473,331,-38,-36;331,-346,-409,58;-38,-409,-864,-20;-36,58,-20,-299]', + '[847,138,609,-195;138,-215,232,-257;609,232,953,220;-195,-257,220,63]', + '[544,-494,56,-441;-494,-73,154,-847;56,154,-427,565;-441,-847,565,-503]', + '[-548,200,253,353;200,-582,142,278;253,142,-514,-577;353,278,-577,-555]', + '[-954,-835,-720,-541;-835,-642,116,74;-720,116,-939,168;-541,74,168,32]', + '[-921,16,-253,-807;16,559,-16,-401;-253,-16,604,591;-807,-401,591,848]', + '[-184,326,-437,151;326,-560,373,-103;-437,373,-913,-731;151,-103,-731,735]', + '[637,57,-209,785;57,708,463,-909;-209,463,197,-275;785,-909,-275,751]', + '[901,175,-364,245;175,14,141,811;-364,141,-104,-499;245,811,-499,-705]', + '[-184,942,-258,171;942,-149,-629,366;-258,-629,-935,216;171,366,216,986]', + '[661,647,-235,-432;647,-176,177,192;-235,177,-123,379;-432,192,379,-760]', + '[-957,440,-161,-888;440,2,-148,-48;-161,-148,-598,-743;-888,-48,-743,550]', + '[959,720,-158,225;720,-588,-46,258;-158,-46,530,-753;225,258,-753,367]', + '[291,-64,-481,-53;-64,829,386,305;-481,386,638,213;-53,305,213,22]', + '[949,-74,304,129;-74,-143,-673,-167;304,-673,545,-43;129,-167,-43,-485]', + '[217,861,-669,-333;861,884,-12,675;-669,-12,110,-540;-333,675,-540,67]', + '[957,-415,416,493;-415,862,148,-308;416,148,453,-253;493,-308,-253,-822]', + '[-838,-392,-57,-288;-392,-83,130,323;-57,130,87,199;-288,323,199,-464]', + '[-43,256,-625,-195;256,-320,362,1;-625,362,-611,-142;-195,1,-142,-538]', + '[-524,-608,-260,-17;-608,-211,-123,-438;-260,-123,633,-264;-17,-438,-264,659]', + '[139,-93,776,-239;-93,384,67,-639;776,67,-561,-645;-239,-639,-645,895]', + '[704,-399,-485,-425;-399,-519,748,163;-485,748,-182,-274;-425,163,-274,834]', + '[67,-693,-88,664;-693,987,39,-62;-88,39,-915,-327;664,-62,-327,-434]', + '[-901,102,-239,-270;102,-311,-212,591;-239,-212,771,-105;-270,591,-105,502]', + '[-58,-876,422,-195;-876,-105,-761,-819;422,-761,-760,379;-195,-819,379,117]', + '[995,22,48,-495;22,519,368,-411;48,368,-925,720;-495,-411,720,632]', + '[445,-738,-222,299;-738,-786,-232,-352;-222,-232,-619,-341;299,-352,-341,81]', + '[-490,495,1,-342;495,-222,192,608;1,192,6,-412;-342,608,-412,-723]', + '[684,-101,124,-102;-101,395,-184,413;124,-184,-731,14;-102,413,14,-945]', + '[102,-118,-635,-737;-118,-652,37,575;-635,37,-879,-84;-737,575,-84,748]', + '[732,-244,-50,270;-244,-277,53,574;-50,53,-224,683;270,574,683,223]', + '[466,-48,-330,-472;-48,-834,699,-489;-330,699,-318,745;-472,-489,745,859]', + '[252,72,115,248;72,-846,11,-645;115,11,289,281;248,-645,281,-276]', + '[270,537,-17,345;537,289,-338,489;-17,-338,429,-701;345,489,-701,-214]', + '[731,812,-291,-457;812,-9,-77,294;-291,-77,217,156;-457,294,156,-646]', + '[246,160,-739,53;160,560,-7,437;-739,-7,-803,13;53,437,13,4]', + '[789,-415,-730,436;-415,905,-467,34;-730,-467,97,-35;436,34,-35,128]', + '[111,120,-205,-83;120,358,-58,284;-205,-58,-131,-463;-83,284,-463,825]', + '[96,-218,-174,-75;-218,-200,378,201;-174,378,-221,-29;-75,201,-29,169]', + '[841,-443,244,834;-443,-46,774,-48;244,774,188,194;834,-48,194,-966]', + '[-622,430,-699,-145;430,-977,30,-116;-699,30,-781,-447;-145,-116,-447,452]', + '[787,-20,-232,-250;-20,-50,310,-314;-232,310,-106,422;-250,-314,422,-894]', + '[17,275,-251,-497;275,-581,-179,196;-251,-179,-643,-558;-497,196,-558,-114]', + '[-867,-236,-249,300;-236,318,-308,237;-249,-308,721,-321;300,237,-321,531]', + '[738,575,-59,145;575,721,-480,442;-59,-480,592,170;145,442,170,-757]', + '[201,121,-379,162;121,-469,-132,378;-379,-132,-272,309;162,378,309,-280]', + '[908,109,-209,-921;109,-203,495,371;-209,495,350,240;-921,371,240,-571]', + '[93,29,-738,-360;29,-715,287,-725;-738,287,-523,-109;-360,-725,-109,16]', + '[-97,-86,131,-369;-86,231,-168,30;131,-168,-751,-484;-369,30,-484,-399]', + '[-815,-360,-481,-48;-360,320,326,191;-481,326,555,548;-48,191,548,-707]', + '[96,235,-680,612;235,748,-74,-298;-680,-74,-648,-670;612,-298,-670,622]', + '[-39,-344,297,-252;-344,834,-77,41;297,-77,-60,-279;-252,41,-279,645]', + '[914,196,209,-238;196,-7,44,447;209,44,16,-194;-238,447,-194,-632]', + '[-314,163,756,341;163,982,-61,288;756,-61,706,-76;341,288,-76,-321]', + '[-492,-316,-59,-350;-316,-861,-647,-270;-59,-647,837,-90;-350,-270,-90,-629]', + '[-565,450,97,156;450,984,-271,-315;97,-271,583,-40;156,-315,-40,-110]', + '[-496,-37,98,-453;-37,-152,-81,-349;98,-81,-811,-292;-453,-349,-292,-688]', + '[953,281,-556,904;281,311,-557,-644;-556,-557,845,100;904,-644,100,-359]', + '[-643,497,-310,-229;497,-925,172,255;-310,172,-151,350;-229,255,350,854]', + '[863,150,318,-30;150,-522,-464,-274;318,-464,-942,-256;-30,-274,-256,228]', + '[-211,493,-509,-6;493,215,344,-548;-509,344,227,-727;-6,-548,-727,-682]', + '[-276,-9,204,515;-9,-80,-2,-211;204,-2,-842,43;515,-211,43,543]', + '[-169,669,215,22;669,92,370,18;215,370,684,123;22,18,123,707]', + '[-577,-130,-286,-189;-130,-529,-189,-770;-286,-189,381,-12;-189,-770,-12,-169]', + '[952,-268,40,545;-268,-710,-236,196;40,-236,-559,-115;545,196,-115,571]', + '[418,132,-154,278;132,928,116,-122;-154,116,538,-528;278,-122,-528,37]', + '[782,83,-31,351;83,-662,-39,-609;-31,-39,-414,-249;351,-609,-249,215]', + '[318,532,-172,-248;532,-783,-399,10;-172,-399,-877,823;-248,10,823,-748]', + '[-68,233,-456,-484;233,225,-375,455;-456,-375,-324,188;-484,455,188,-250]', + '[-684,-179,65,466;-179,647,-392,-1;65,-392,-222,292;466,-1,292,-251]', + '[-592,447,-605,51;447,-233,430,67;-605,430,-573,-263;51,67,-263,-506]', + '[-43,308,-326,-746;308,-241,-537,-197;-326,-537,-407,34;-746,-197,34,112]', + '[112,95,137,533;95,317,807,711;137,807,4,26;533,711,26,-792]', + '[755,-108,121,-537;-108,-730,-485,-202;121,-485,753,29;-537,-202,29,965]', + '[-54,235,113,192;235,320,-837,-258;113,-837,398,-498;192,-258,-498,683]', + '[-852,55,-567,102;55,612,-594,460;-567,-594,29,-501;102,460,-501,-213]', + '[4,-100,473,-28;-100,202,64,48;473,64,-593,-616;-28,48,-616,-834]', + '[-692,-666,531,-306;-666,559,49,-619;531,49,-390,-730;-306,-619,-730,324]', + '[-641,-381,108,62;-381,118,-110,-194;108,-110,697,329;62,-194,329,-869]', + '[281,752,-869,350;752,-545,-169,138;-869,-169,782,-376;350,138,-376,97]', + '[-58,647,-85,391;647,-968,459,-166;-85,459,469,323;391,-166,323,-104]', + '[-20,728,757,569;728,531,530,-500;757,530,-47,101;569,-500,101,-500]', + '[-980,413,-81,602;413,647,118,30;-81,118,-787,-709;602,30,-709,582]', + '[518,-59,335,247;-59,-184,460,-518;335,460,510,-216;247,-518,-216,-7]', + '[762,-305,724,-25;-305,-328,805,414;724,805,-942,-83;-25,414,-83,-88]', + '[388,-318,-111,416;-318,146,-678,742;-111,-678,35,543;416,742,543,891]', + '[402,5,-176,845;5,-56,-427,-745;-176,-427,217,196;845,-745,196,363]', + '[981,159,-168,186;159,760,-718,816;-168,-718,356,-245;186,816,-245,244]', + '[495,-302,243,-33;-302,-118,97,-204;243,97,20,192;-33,-204,192,153]', + '[954,-725,339,422;-725,-4,-230,712;339,-230,-57,-11;422,712,-11,-690]', + '[765,-702,29,-644;-702,789,-366,75;29,-366,49,-479;-644,75,-479,575]', + '[-62,381,327,631;381,577,-512,-672;327,-512,146,158;631,-672,158,126]', + '[-947,541,87,-893;541,-495,-41,-665;87,-41,861,60;-893,-665,60,175]', + '[-910,488,-479,-431;488,991,143,229;-479,143,783,-356;-431,229,-356,-333]', + '[846,-356,-144,-336;-356,888,-228,-471;-144,-228,-194,-647;-336,-471,-647,-724]', + '[-10,454,119,65;454,468,-597,260;119,-597,567,-110;65,260,-110,106]'], + [ + '[-564,568,485,513,7;568,-526,612,-346,460;485,612,183,-757,-36;513,-346,-757,-536,505;7,460,-36,' + '505,693]', + '[-379,-94,-635,347,-257;-94,-489,84,-418,229;-635,84,361,-107,-17;347,-418,-107,-48,-715;-257,229,' + '-17,-715,-966]', + '[533,-388,15,340,-489;-388,-366,-37,-836,-93;15,-37,627,328,-271;340,-836,328,-576,-812;-489,-93,' + '-271,-812,-769]', + '[-518,-276,-221,336,787;-276,307,463,342,374;-221,463,-417,499,428;336,342,499,-572,-117;787,374,' + '428,-117,-648]', + '[-63,-268,835,-443,-432;-268,-811,713,-136,-363;835,713,58,151,791;-443,-136,151,-517,-412;-432,' + '-363,791,-412,104]', + '[-95,-786,24,-81,-432;-786,744,139,312,251;24,139,423,298,479;-81,312,298,-672,-239;-432,251,479,' + '-239,9]', + '[888,-546,-211,69,-50;-546,220,59,432,76;-211,59,454,552,432;69,432,552,283,-368;-50,76,432,-368,614]', + '[-164,-64,-626,247,-567;-64,116,-387,584,-334;-626,-387,555,-430,553;247,584,-430,213,-966;-567,' + '-334,553,-966,929]', + '[626,493,-33,391,-355;493,868,-572,193,394;-33,-572,252,-258,-172;391,193,-258,-822,349;-355,394,' + '-172,349,359]', + '[-554,412,-131,31,507;412,794,-428,-31,44;-131,-428,683,-157,330;31,-31,-157,-780,464;507,44,330,' + '464,-750]', + '[45,210,831,-678,-52;210,-539,157,219,-94;831,157,452,698,-380;-678,219,698,-203,-513;-52,-94,-380,' + '-513,-221]', + '[148,-171,-445,202,659;-171,-531,551,-48,-440;-445,551,502,18,-69;202,-48,18,240,-437;659,-440,-69,' + '-437,-778]', + '[-544,-88,-52,-34,-341;-88,238,517,527,306;-52,517,-192,403,79;-34,527,403,210,471;-341,306,79,471,' + '781]', + '[463,-680,-929,668,294;-680,-264,682,-498,864;-929,682,-503,-903,-562;668,-498,-903,438,-217;294,' + '864,-562,-217,-58]', + '[-66,-495,-201,-401,-128;-495,171,570,-139,-745;-201,570,614,-566,356;-401,-139,-566,-818,' + '-797;-128,-745,356,-797,967]', + '[-768,345,73,-335,-489;345,-478,52,211,-100;73,52,94,0,264;-335,211,0,619,-695;-489,-100,264,-695,' + '447]', + '[-239,-24,198,-123,-152;-24,374,-611,-425,-191;198,-611,589,-615,336;-123,-425,-615,26,-782;-152,' + '-191,336,-782,950]', + '[-336,670,8,196,86;670,857,144,-710,-682;8,144,648,-21,854;196,-710,-21,936,923;86,-682,854,923,-368]', + '[-536,235,-207,-112,-499;235,-391,-900,106,189;-207,-900,346,-359,581;-112,106,-359,-461,-341;-499,' + '189,581,-341,269]', + '[-264,431,731,73,-190;431,-513,-131,-101,-23;731,-131,-223,119,245;73,-101,119,-553,511;-190,-23,' + '245,511,530]', + '[943,-212,171,-448,-45;-212,-613,286,-453,-603;171,286,-36,-8,-134;-448,-453,-8,-452,-372;-45,-603,' + '-134,-372,-610]', + '[434,-204,457,47,-340;-204,-163,705,327,49;457,705,-463,-555,-40;47,327,-555,-996,-402;-340,49,-40,' + '-402,421]', + '[202,-242,-953,-143,-284;-242,161,225,-197,-828;-953,225,151,-407,808;-143,-197,-407,535,348;-284,' + '-828,808,348,-688]', + '[-668,725,-427,528,330;725,813,-586,-488,209;-427,-586,951,107,-254;528,-488,107,2,-472;330,209,' + '-254,-472,294]', + '[-839,-247,50,445,-82;-247,114,-527,-150,-201;50,-527,-504,-233,96;445,-150,-233,863,697;-82,-201,' + '96,697,254]', + '[-975,-683,-223,410,591;-683,-56,-133,-592,424;-223,-133,-633,174,-339;410,-592,174,453,-286;591,' + '424,-339,-286,-850]', + '[69,75,609,39,182;75,36,292,587,251;609,292,-678,151,-196;39,587,151,-906,-435;182,251,-196,-435,948]', + '[-102,251,-928,478,-2;251,-622,449,-307,-166;-928,449,-832,512,0;478,-307,512,925,491;-2,-166,0,' + '491,646]', + '[14,768,-575,216,555;768,-196,422,772,-823;-575,422,-373,684,305;216,772,684,904,569;555,-823,305,' + '569,15]', + '[741,-172,99,-82,-553;-172,-787,573,320,225;99,573,-672,-740,569;-82,320,-740,-198,-943;-553,225,' + '569,-943,-413]', + '[-981,21,38,19,43;21,-55,-303,568,243;38,-303,-376,-55,-721;19,568,-55,83,-402;43,243,-721,-402,943]', + '[710,97,-685,411,71;97,-324,773,-582,597;-685,773,-692,393,-204;411,-582,393,410,11;71,597,-204,11,' + '-238]', + '[-765,404,-10,-80,251;404,-195,2,167,304;-10,2,369,328,308;-80,167,328,-859,-281;251,304,308,-281,' + '151]', + '[126,584,513,334,-25;584,-358,-99,27,329;513,-99,793,-106,195;334,27,-106,-532,-18;-25,329,195,-18,' + '617]', + '[732,-546,81,-379,-399;-546,-205,79,19,-73;81,79,987,-435,575;-379,19,-435,999,-90;-399,-73,575,' + '-90,-341]', + '[-373,-891,190,539,327;-891,-997,-89,185,433;190,-89,778,-1,-337;539,185,-1,394,-141;327,433,-337,' + '-141,281]', + '[-624,102,-778,200,-350;102,-748,-333,146,-243;-778,-333,-10,90,145;200,146,90,-728,146;-350,-243,' + '145,146,-166]', + '[-848,-806,255,240,283;-806,373,744,858,404;255,744,-504,55,-867;240,858,55,950,101;283,404,-867,' + '101,427]', + '[302,-557,-629,100,8;-557,-627,502,60,226;-629,502,-812,748,352;100,60,748,658,330;8,226,352,330,' + '-252]', + '[280,575,579,-515,257;575,-355,-201,203,163;579,-201,689,-540,58;-515,203,-540,737,-342;257,163,58,' + '-342,485]', + '[491,353,76,-533,337;353,756,-358,-237,105;76,-358,-301,350,-232;-533,-237,350,905,558;337,105,' + '-232,558,616]', + '[-594,299,-104,-275,37;299,883,503,695,592;-104,503,-275,199,248;-275,695,199,21,-32;37,592,248,' + '-32,692]', + '[-79,448,106,323,-45;448,-967,649,351,400;106,649,-458,-435,275;323,351,-435,-117,-759;-45,400,275,' + '-759,-165]', + '[-740,-85,540,-27,244;-85,-934,472,575,171;540,472,-947,476,550;-27,575,476,-582,566;244,171,550,' + '566,-509]', + '[831,-113,-331,92,-472;-113,89,110,-295,93;-331,110,338,665,-273;92,-295,665,-754,558;-472,93,-273,' + '558,-883]', + '[277,-733,-472,67,638;-733,170,-229,160,-805;-472,-229,510,-61,-135;67,160,-61,-89,-231;638,-805,' + '-135,-231,769]', + '[567,517,-261,-38,357;517,386,2,777,226;-261,2,590,-394,-296;-38,777,-394,188,-236;357,226,-296,' + '-236,209]', + '[-697,-632,494,513,-241;-632,95,-245,487,100;494,-245,-37,0,15;513,487,0,717,-33;-241,100,15,-33,440]', + '[-474,-135,-35,-406,-241;-135,-128,402,-26,-170;-35,402,-933,-41,-138;-406,-26,-41,791,-167;-241,' + '-170,-138,-167,-286]', + '[-854,-121,-48,-570,419;-121,-59,22,-196,368;-48,22,-194,-258,-46;-570,-196,-258,497,6;419,368,-46,' + '6,-124]', + '[-306,470,671,-322,41;470,988,-964,131,193;671,-964,-218,175,378;-322,131,175,470,-50;41,193,378,' + '-50,506]', + '[478,-324,-581,89,540;-324,-885,-57,-600,-464;-581,-57,785,-69,-182;89,-600,-69,-595,157;540,-464,' + '-182,157,-322]', + '[-724,62,466,-176,570;62,-735,181,-420,-19;466,181,53,-293,-14;-176,-420,-293,-990,344;570,-19,-14,' + '344,-771]', + '[-429,13,-134,543,-175;13,-200,-702,291,-202;-134,-702,684,-389,321;543,291,-389,-510,189;-175,' + '-202,321,189,-713]', + '[919,83,-70,309,-566;83,-977,402,-190,-312;-70,402,-829,-533,106;309,-190,-533,-306,-35;-566,-312,' + '106,-35,-599]', + '[-620,-223,29,-150,-213;-223,248,497,-768,-305;29,497,-657,798,0;-150,-768,798,930,30;-213,-305,0,' + '30,-51]', + '[-965,53,-98,155,195;53,-349,634,225,948;-98,634,-847,125,573;155,225,125,33,507;195,948,573,507,' + '-390]', + '[-526,338,50,394,607;338,435,-100,590,403;50,-100,-480,-228,792;394,590,-228,-377,-478;607,403,792,' + '-478,514]', + '[-293,280,-137,60,247;280,-6,116,-506,177;-137,116,-906,764,452;60,-506,764,-420,275;247,177,452,' + '275,294]', + '[307,490,-31,-208,347;490,-456,726,-453,113;-31,726,-892,450,-532;-208,-453,450,-393,-230;347,113,' + '-532,-230,-417]', + '[700,408,-90,-330,249;408,325,-344,-6,64;-90,-344,608,358,-550;-330,-6,358,342,388;249,64,-550,388,' + '628]', + '[-668,-7,558,-90,3;-7,805,67,158,8;558,67,178,-635,401;-90,158,-635,-163,-413;3,8,401,-413,-501]', + '[-940,319,-177,-311,170;319,-588,749,843,403;-177,749,-134,-381,-577;-311,843,-381,-709,-161;170,' + '403,-577,-161,995]', + '[458,-800,-2,-551,-101;-800,-832,477,-256,329;-2,477,384,-263,183;-551,-256,-263,800,-468;-101,329,' + '183,-468,-321]', + '[-198,-129,-271,347,-584;-129,182,36,-962,-226;-271,36,-274,-336,-522;347,-962,-336,456,-115;-584,' + '-226,-522,-115,557]', + '[360,283,902,651,-69;283,-673,-326,-867,39;902,-326,199,130,582;651,-867,130,471,37;-69,39,582,37,' + '796]', + '[-795,-20,-143,-308,554;-20,-521,609,174,563;-143,609,-539,44,159;-308,174,44,122,-707;554,563,159,' + '-707,-584]', + '[-885,550,178,-421,145;550,-413,-180,-757,578;178,-180,-501,208,345;-421,-757,208,-882,136;145,578,' + '345,136,-705]', + '[188,552,-114,248,-867;552,-594,-348,266,-172;-114,-348,-428,604,242;248,266,604,617,-81;-867,-172,' + '242,-81,867]', + '[702,361,239,-502,172;361,-932,-89,-486,-789;239,-89,991,91,349;-502,-486,91,447,280;172,-789,349,' + '280,-236]', + '[-717,-249,-608,-505,97;-249,-222,-65,157,505;-608,-65,-796,697,614;-505,157,697,187,139;97,505,' + '614,139,-747]', + '[829,126,59,-147,-5;126,-239,-261,-327,475;59,-261,-13,-210,-417;-147,-327,-210,594,-249;-5,475,' + '-417,-249,637]', + '[710,116,-118,709,285;116,-847,-351,28,-535;-118,-351,-348,232,-256;709,28,232,479,-382;285,-535,' + '-256,-382,906]', + '[-383,-85,563,-666,563;-85,924,974,356,211;563,974,14,250,-510;-666,356,250,458,166;563,211,-510,' + '166,753]', + '[-968,18,-75,638,-462;18,-37,79,-504,-92;-75,79,-543,72,253;638,-504,72,-896,929;-462,-92,253,929,' + '-319]', + '[614,-856,-127,541,-245;-856,-676,816,-940,-298;-127,816,-220,-522,140;541,-940,-522,878,581;-245,' + '-298,140,581,245]', + '[-85,-34,-122,-478,-115;-34,-759,-367,-193,603;-122,-367,605,276,79;-478,-193,276,798,508;-115,603,' + '79,508,592]', + '[-333,-138,-112,-263,179;-138,817,756,-48,391;-112,756,969,-731,752;-263,-48,-731,156,-321;179,391,' + '752,-321,-712]', + '[477,249,-294,-37,336;249,440,-302,622,-527;-294,-302,-692,-319,-269;-37,622,-319,685,-541;336,' + '-527,-269,-541,-967]', + '[-873,138,-286,-799,317;138,779,-78,13,-300;-286,-78,394,24,61;-799,13,24,-578,-441;317,-300,61,' + '-441,178]', + '[731,432,388,128,763;432,-160,-144,-97,24;388,-144,888,330,135;128,-97,330,-884,-301;763,24,135,' + '-301,-902]', + '[903,29,435,-334,522;29,876,526,26,449;435,526,-16,162,27;-334,26,162,-659,-382;522,449,27,-382,' + '262]', + '[-379,-816,431,-196,-632;-816,-939,-65,-621,111;431,-65,254,247,-416;-196,-621,247,-377,-50;-632,' + '111,-416,-50,493]', + '[-140,-350,-271,364,-657;-350,-321,-101,-87,-648;-271,-101,117,-376,-616;364,-87,-376,-331,26;-657,' + '-648,-616,26,-793]', + '[-846,962,-39,798,-742;962,-844,404,123,562;-39,404,-536,44,-729;798,123,44,-552,71;-742,562,-729,' + '71,-458]', + '[-943,-160,-175,148,-289;-160,625,624,-87,123;-175,624,-198,-23,-459;148,-87,-23,-854,291;-289,123,' + '-459,291,119]', + '[125,24,-75,172,605;24,-192,-385,707,129;-75,-385,-106,-110,-81;172,707,-110,179,239;605,129,-81,' + '239,-216]', + '[329,-86,307,-776,-546;-86,818,256,100,-332;307,256,-805,-398,321;-776,100,-398,-761,-576;-546,' + '-332,321,-576,-2]', + '[934,-696,-129,-171,-99;-696,-882,385,-535,-707;-129,385,488,305,8;-171,-535,305,-27,465;-99,-707,' + '8,465,-329]', + '[-279,11,260,-35,-333;11,175,-854,-246,-126;260,-854,-31,487,43;-35,-246,487,-775,195;-333,-126,43,' + '195,-956]', + '[-999,613,-166,-58,808;613,-518,-574,-664,416;-166,-574,-387,313,95;-58,-664,313,872,-34;808,416,' + '95,-34,851]', + '[-746,-456,-738,326,418;-456,418,848,62,483;-738,848,-980,104,-547;326,62,104,118,-18;418,483,-547,' + '-18,301]', + '[268,-302,-195,725,103;-302,-931,-885,812,-278;-195,-885,-3,-572,-280;725,812,-572,719,867;103,' + '-278,-280,867,551]', + '[544,230,-284,344,-698;230,-593,-370,-322,576;-284,-370,-979,-118,-9;344,-322,-118,942,714;-698,' + '576,-9,714,-851]', + '[301,-368,-694,45,212;-368,388,110,-530,-364;-694,110,271,-9,418;45,-530,-9,-838,-239;212,-364,418,' + '-239,-448]', + '[-243,224,27,249,337;224,317,-432,-383,133;27,-432,-681,779,-89;249,-383,779,844,405;337,133,-89,' + '405,138]', + '[481,61,-452,385,-156;61,-549,-691,-389,-36;-452,-691,597,345,-685;385,-389,345,-748,598;-156,-36,' + '-685,598,-745]', + '[-586,846,126,-357,704;846,-840,746,-6,203;126,746,673,-556,-262;-357,-6,-556,556,-206;704,203,' + '-262,-206,663]', + '[796,-218,-314,-352,214;-218,-973,649,-525,410;-314,649,-108,-642,-177;-352,-525,-642,139,-568;214,' + '410,-177,-568,-655]', + '[540,393,834,299,-166;393,153,35,109,150;834,35,-660,-529,569;299,109,-529,695,558;-166,150,569,' + '558,989]'], + [ + '[250,623,394,139,394,-485;623,950,605,-643,19,-311;394,605,-188,799,386,-600;139,-643,799,248,659,' + '-616;394,19,386,659,236,-145;-485,-311,-600,-616,-145,-743]', + '[899,543,-487,324,-284,-752;543,-305,-138,-108,-66,-360;-487,-138,-936,121,573,506;324,-108,121,' + '164,-5,-438;-284,-66,573,-5,-878,151;-752,-360,506,-438,151,-891]', + '[-349,136,-393,659,-232,488;136,42,806,279,327,313;-393,806,687,588,-121,223;659,279,588,109,-205,' + '714;-232,327,-121,-205,684,-747;488,313,223,714,-747,192]', + '[932,463,-748,68,-150,-264;463,-444,384,866,726,125;-748,384,-31,-160,804,179;68,866,-160,-498,159,' + '-183;-150,726,804,159,794,463;-264,125,179,-183,463,-507]', + '[519,132,272,-150,56,-96;132,451,38,560,-365,190;272,38,-686,135,-238,-510;-150,560,135,353,-129,' + '240;56,-365,-238,-129,571,-256;-96,190,-510,240,-256,-627]', + '[-694,137,-268,131,-429,-201;137,-130,-69,-39,-130,336;-268,-69,622,-515,174,453;131,-39,-515,-333,' + '165,-316;-429,-130,174,165,853,836;-201,336,453,-316,836,-31]', + '[920,-703,166,174,-451,124;-703,-651,56,297,-34,-24;166,56,530,148,14,516;174,297,148,503,317,' + '82;-451,-34,14,317,934,350;124,-24,516,82,350,-921]', + '[284,333,-642,510,563,441;333,909,442,561,-372,-319;-642,442,72,684,46,-802;510,561,684,-936,-48,' + '285;563,-372,46,-48,546,221;441,-319,-802,285,221,-149]', + '[556,-200,75,-156,529,264;-200,-689,-314,98,-144,-60;75,-314,110,-517,-399,81;-156,98,-517,768,471,' + '706;529,-144,-399,471,-607,134;264,-60,81,706,134,-336]', + '[-31,76,-13,412,-442,-71;76,-179,-306,469,-82,-107;-13,-306,-505,162,71,253;412,469,162,-376,190,' + '231;-442,-82,71,190,-374,-517;-71,-107,253,231,-517,467]', + '[-52,334,-360,-86,-466,80;334,478,43,-203,500,-33;-360,43,294,417,-590,-507;-86,-203,417,305,772,' + '480;-466,500,-590,772,-476,180;80,-33,-507,480,180,-603]', + '[-534,-134,-366,388,-656,-393;-134,-847,565,-148,372,137;-366,565,-550,-68,-262,-716;388,-148,-68,' + '-832,254,162;-656,372,-262,254,-795,47;-393,137,-716,162,47,870]', + '[-49,385,306,-659,479,-423;385,811,-288,5,608,-839;306,-288,-851,-383,-206,117;-659,5,-383,-936,' + '408,569;479,608,-206,408,-438,-203;-423,-839,117,569,-203,-584]', + '[138,-137,32,189,-635,168;-137,-782,19,-224,-133,-523;32,19,726,-57,271,-138;189,-224,-57,-884,' + '-565,-630;-635,-133,271,-565,-305,529;168,-523,-138,-630,529,390]', + '[-875,-791,-144,511,108,-164;-791,-59,-596,6,-520,534;-144,-596,-721,355,201,-129;511,6,355,738,' + '-58,-318;108,-520,201,-58,-41,436;-164,534,-129,-318,436,-743]', + '[457,540,-477,847,412,-89;540,-196,305,841,20,176;-477,305,293,-290,-627,-747;847,841,-290,-962,' + '-147,33;412,20,-627,-147,-651,824;-89,176,-747,33,824,-472]', + '[440,36,42,-257,307,556;36,112,-417,496,-199,298;42,-417,-624,417,395,195;-257,496,417,291,407,' + '142;307,-199,395,407,-724,-167;556,298,195,142,-167,486]', + '[-56,311,800,-536,-91,451;311,724,-120,403,159,339;800,-120,-169,-600,304,-562;-536,403,-600,-444,' + '-404,-475;-91,159,304,-404,886,163;451,339,-562,-475,163,701]', + '[831,-9,-193,250,-259,-177;-9,-279,-447,671,-344,243;-193,-447,119,250,-220,-13;250,671,250,-404,' + '359,-171;-259,-344,-220,359,-77,-141;-177,243,-13,-171,-141,-71]', + '[-290,-385,-7,232,300,-595;-385,715,544,-108,-746,-590;-7,544,365,-105,-187,-159;232,-108,-105,' + '-923,582,334;300,-746,-187,582,-281,651;-595,-590,-159,334,651,322]', + '[-907,229,-390,78,347,-413;229,945,-480,151,-738,711;-390,-480,-89,-188,-693,6;78,151,-188,656,' + '-586,443;347,-738,-693,-586,-751,-396;-413,711,6,443,-396,-17]', + '[-915,-17,591,161,16,-448;-17,177,300,723,326,0;591,300,489,-680,-591,279;161,723,-680,-119,-371,' + '-937;16,326,-591,-371,-724,-244;-448,0,279,-937,-244,-270]', + '[-376,-205,333,-491,171,364;-205,968,120,251,-80,-334;333,120,-33,-346,-517,-757;-491,251,-346,-74,' + '-261,618;171,-80,-517,-261,-537,169;364,-334,-757,618,169,-464]', + '[-158,-435,-280,29,549,-51;-435,-742,427,308,817,-432;-280,427,-317,544,472,-361;29,308,544,-951,' + '256,35;549,817,472,256,907,284;-51,-432,-361,35,284,460]', + '[-497,-300,-715,433,44,-341;-300,296,-76,-900,-319,-644;-715,-76,239,710,-30,-232;433,-900,710,' + '-780,25,-612;44,-319,-30,25,-91,677;-341,-644,-232,-612,677,963]', + '[-483,-373,254,58,112,-472;-373,781,-720,645,432,442;254,-720,227,145,719,-242;58,645,145,-265,' + '-308,-19;112,432,719,-308,-110,305;-472,442,-242,-19,305,-641]', + '[426,717,-190,194,600,-397;717,-324,392,98,238,68;-190,392,-313,316,-723,535;194,98,316,721,419,' + '483;600,238,-723,419,-820,9;-397,68,535,483,9,737]', + '[-682,519,-724,-204,-606,-348;519,-484,299,23,-49,-319;-724,299,-794,342,-498,36;-204,23,342,276,' + '611,332;-606,-49,-498,611,-962,-432;-348,-319,36,332,-432,-955]', + '[971,-610,-29,-607,146,-692;-610,-906,-177,217,536,-522;-29,-177,398,-61,49,-333;-607,217,-61,-421,' + '-69,-21;146,536,49,-69,578,754;-692,-522,-333,-21,754,-889]', + '[137,612,379,731,-89,149;612,-706,-257,-698,507,290;379,-257,110,407,455,260;731,-698,407,659,82,' + '-404;-89,507,455,82,-618,-136;149,290,260,-404,-136,-790]', + '[714,-226,-159,177,-129,450;-226,381,-254,-349,-409,95;-159,-254,-961,129,446,-302;177,-349,129,' + '-396,-198,-214;-129,-409,446,-198,415,-123;450,95,-302,-214,-123,415]', + '[141,699,-683,-890,449,-692;699,-533,-356,293,-166,268;-683,-356,-473,32,-16,151;-890,293,32,-183,' + '240,335;449,-166,-16,240,-534,-122;-692,268,151,335,-122,266]', + '[-307,377,889,-520,-105,-446;377,900,305,302,43,297;889,305,-834,187,-880,294;-520,302,187,-446,' + '-649,-515;-105,43,-880,-649,662,-387;-446,297,294,-515,-387,-570]', + '[-526,-630,488,-512,101,-657;-630,212,-529,-261,-16,7;488,-529,429,172,105,-875;-512,-261,172,-720,' + '172,230;101,-16,105,172,724,-11;-657,7,-875,230,-11,833]', + '[704,840,-58,-261,667,-482;840,-160,90,-382,-89,462;-58,90,-133,59,281,-62;-261,-382,59,-485,784,' + '4;667,-89,281,784,-563,67;-482,462,-62,4,67,-634]', + '[-462,-146,772,494,397,834;-146,174,23,377,15,528;772,23,-445,-144,116,-225;494,377,-144,660,-471,' + '-251;397,15,116,-471,455,-443;834,528,-225,-251,-443,580]', + '[-48,-185,267,-414,206,-165;-185,592,-46,269,84,-306;267,-46,251,-64,-640,82;-414,269,-64,878,-529,' + '-361;206,84,-640,-529,840,48;-165,-306,82,-361,48,929]', + '[376,830,212,-693,32,-372;830,-39,37,-397,140,74;212,37,384,-533,621,577;-693,-397,-533,492,348,' + '-103;32,140,621,348,-107,169;-372,74,577,-103,169,-106]', + '[-460,583,225,-2,687,55;583,724,294,-832,17,-361;225,294,-714,86,-234,272;-2,-832,86,-598,199,' + '-81;687,17,-234,199,-370,-394;55,-361,272,-81,-394,-16]', + '[-352,-297,28,362,-321,-290;-297,972,10,227,-145,526;28,10,-794,-10,397,305;362,227,-10,-94,-400,' + '-430;-321,-145,397,-400,869,352;-290,526,305,-430,352,-93]', + '[-699,-128,29,418,-137,946;-128,-946,293,336,152,-100;29,293,473,-603,233,-260;418,336,-603,883,' + '882,-183;-137,152,233,882,248,-197;946,-100,-260,-183,-197,-688]', + '[696,-143,489,-228,405,549;-143,-919,749,-176,-471,-816;489,749,-221,-272,598,671;-228,-176,-272,' + '652,-51,-6;405,-471,598,-51,563,-734;549,-816,671,-6,-734,360]', + '[-521,405,92,352,-158,-111;405,-696,-361,115,-444,-459;92,-361,871,142,267,-36;352,115,142,905,253,' + '-199;-158,-444,267,253,-320,189;-111,-459,-36,-199,189,-46]', + '[-790,367,117,-43,175,409;367,654,131,-823,-37,377;117,131,89,-14,-185,-317;-43,-823,-14,963,241,' + '767;175,-37,-185,241,-141,-149;409,377,-317,767,-149,811]', + '[-250,666,475,-73,701,-21;666,-136,214,213,-718,185;475,214,-42,456,177,-302;-73,213,456,191,15,' + '231;701,-718,177,15,-331,-490;-21,185,-302,231,-490,-339]', + '[-20,-312,-255,12,-45,123;-312,415,-415,311,-577,424;-255,-415,700,229,-535,222;12,311,229,763,' + '-800,986;-45,-577,-535,-800,784,-45;123,424,222,986,-45,689]', + '[85,-623,-81,-82,440,358;-623,-864,244,108,-61,210;-81,244,-158,46,215,-33;-82,108,46,-955,-36,' + '-402;440,-61,215,-36,-236,-879;358,210,-33,-402,-879,-70]', + '[-750,-192,-92,279,-99,-155;-192,658,-202,628,-366,-563;-92,-202,194,203,38,335;279,628,203,-276,' + '-149,-27;-99,-366,38,-149,550,-79;-155,-563,335,-27,-79,-310]', + '[959,206,-23,-249,793,256;206,-19,-578,284,-8,539;-23,-578,318,-396,292,538;-249,284,-396,394,581,' + '112;793,-8,292,581,721,-371;256,539,538,112,-371,-869]', + '[157,372,-914,641,146,-734;372,-704,130,631,250,466;-914,130,-789,526,675,-252;641,631,526,-341,' + '155,93;146,250,675,155,-321,-845;-734,466,-252,93,-845,18]', + '[408,179,-258,-35,370,-745;179,753,-494,-183,-725,512;-258,-494,255,447,-200,-648;-35,-183,447,912,' + '596,125;370,-725,-200,596,-262,250;-745,512,-648,125,250,-767]', + '[770,-730,289,36,-314,-199;-730,259,-746,740,286,-508;289,-746,580,251,-401,103;36,740,251,764,372,' + '167;-314,286,-401,372,-269,-853;-199,-508,103,167,-853,-34]', + '[-579,325,661,-348,645,-729;325,433,871,801,221,-631;661,871,846,-124,27,433;-348,801,-124,-251,' + '-990,-97;645,221,27,-990,-957,-618;-729,-631,433,-97,-618,-373]', + '[221,204,482,-309,-150,-760;204,-265,-487,-295,26,-244;482,-487,-961,-108,-113,405;-309,-295,-108,' + '-800,-369,-21;-150,26,-113,-369,122,475;-760,-244,405,-21,475,347]', + '[-820,32,-50,356,-705,-243;32,-651,543,121,-684,-186;-50,543,186,-247,656,-244;356,121,-247,350,' + '100,247;-705,-684,656,100,-680,906;-243,-186,-244,247,906,-469]', + '[431,-287,357,-430,-130,373;-287,-248,500,113,895,-59;357,500,60,-576,82,192;-430,113,-576,-478,' + '-772,369;-130,895,82,-772,-462,268;373,-59,192,369,268,-734]', + '[-352,-378,98,-49,374,623;-378,-999,197,68,266,180;98,197,701,-208,-129,-412;-49,68,-208,863,-117,' + '442;374,266,-129,-117,-518,694;623,180,-412,442,694,501]', + '[924,168,-46,550,41,84;168,608,-653,-514,-201,693;-46,-653,-744,751,158,-75;550,-514,751,-549,143,' + '-563;41,-201,158,143,-564,-356;84,693,-75,-563,-356,731]', + '[993,644,-32,-19,-163,372;644,467,-377,297,387,-321;-32,-377,920,76,-455,808;-19,297,76,649,-450,' + '71;-163,387,-455,-450,284,-158;372,-321,808,71,-158,529]', + '[246,248,608,-198,-18,405;248,-359,243,479,-563,-14;608,243,-109,140,314,98;-198,479,140,488,264,' + '321;-18,-563,314,264,-853,-387;405,-14,98,321,-387,616]', + '[-637,-606,-12,-32,902,-41;-606,912,162,-371,-284,-739;-12,162,-909,-711,34,-326;-32,-371,-711,379,' + '-626,151;902,-284,34,-626,-716,125;-41,-739,-326,151,125,-764]', + '[-538,-632,-235,904,480,53;-632,-156,-336,-342,82,-172;-235,-336,-24,123,129,-444;904,-342,123,' + '-125,-151,83;480,82,129,-151,70,-48;53,-172,-444,83,-48,-537]', + '[497,-860,-57,197,-237,-131;-860,-312,-391,202,329,550;-57,-391,139,165,49,578;197,202,165,-771,' + '580,131;-237,329,49,580,643,164;-131,550,578,131,164,-341]', + '[-735,583,120,164,-565,-76;583,-174,-174,389,-674,-180;120,-174,464,375,-454,-451;164,389,375,-605,' + '-317,-821;-565,-674,-454,-317,456,-456;-76,-180,-451,-821,-456,-373]', + '[687,580,851,459,139,-93;580,-476,-912,455,-605,381;851,-912,-532,663,140,-736;459,455,663,665,' + '-312,223;139,-605,140,-312,-724,-185;-93,381,-736,223,-185,132]', + '[160,-532,608,-331,-600,60;-532,613,853,310,296,44;608,853,35,54,212,-7;-331,310,54,519,480,' + '33;-600,296,212,480,293,689;60,44,-7,33,689,266]', + '[579,4,-562,-731,175,-782;4,318,392,468,-568,-563;-562,392,-891,348,256,7;-731,468,348,327,-178,' + '-422;175,-568,256,-178,837,-723;-782,-563,7,-422,-723,-238]', + '[-739,453,742,543,-791,-417;453,793,169,-102,-156,-188;742,169,-17,108,-351,-553;543,-102,108,-599,' + '-18,195;-791,-156,-351,-18,-223,-114;-417,-188,-553,195,-114,-322]', + '[-678,-308,-290,52,175,14;-308,-988,-705,135,-705,-532;-290,-705,-291,-494,-87,-725;52,135,-494,' + '-500,-506,-189;175,-705,-87,-506,-943,-583;14,-532,-725,-189,-583,995]', + '[-837,134,-213,-67,200,104;134,-490,-400,635,199,-255;-213,-400,682,59,-221,322;-67,635,59,-797,' + '284,-399;200,199,-221,284,881,577;104,-255,322,-399,577,477]', + '[555,14,-887,-202,695,528;14,-927,330,-314,375,-391;-887,330,-134,464,446,346;-202,-314,464,-313,' + '345,363;695,375,446,345,-79,-184;528,-391,346,363,-184,780]', + '[422,58,282,210,-461,94;58,796,706,258,588,-301;282,706,-838,-252,291,-204;210,258,-252,-718,-112,' + '414;-461,588,291,-112,-480,-630;94,-301,-204,414,-630,-889]', + '[-256,759,-214,685,465,-315;759,-944,538,57,-482,299;-214,538,307,640,-137,403;685,57,640,-235,367,' + '213;465,-482,-137,367,188,33;-315,299,403,213,33,-175]', + '[-880,-536,-590,-111,127,-279;-536,749,-180,-387,331,44;-590,-180,-735,-445,347,-44;-111,-387,-445,' + '704,-43,-22;127,331,347,-43,-197,215;-279,44,-44,-22,215,-766]', + '[356,180,416,168,658,-14;180,-229,-316,-408,-834,-724;416,-316,408,-197,-218,-406;168,-408,-197,' + '-754,88,429;658,-834,-218,88,-244,587;-14,-724,-406,429,587,-556]', + '[-968,504,-302,-234,-393,667;504,-948,-680,598,-100,770;-302,-680,-94,-419,135,-350;-234,598,-419,' + '-386,303,350;-393,-100,135,303,-116,69;667,770,-350,350,69,411]', + '[385,259,177,46,13,120;259,-467,445,-398,210,189;177,445,560,58,-26,560;46,-398,58,-874,224,63;13,' + '210,-26,224,-628,156;120,189,560,63,156,-497]', + '[-124,429,577,-223,-36,405;429,343,-398,-302,448,-48;577,-398,920,304,768,570;-223,-302,304,-55,' + '-415,-71;-36,448,768,-415,906,-490;405,-48,570,-71,-490,-330]', + '[714,684,-730,-19,290,-210;684,-984,59,256,72,280;-730,59,-122,46,-7,936;-19,256,46,-177,-697,' + '-104;290,72,-7,-697,-812,502;-210,280,936,-104,502,956]', + '[-835,240,277,73,220,448;240,921,286,617,309,52;277,286,3,202,21,42;73,617,202,966,233,-318;220,' + '309,21,233,540,-165;448,52,42,-318,-165,-601]', + '[826,58,-448,7,570,254;58,-803,-45,327,496,-321;-448,-45,753,861,396,313;7,327,861,-277,-240,' + '-484;570,496,396,-240,-350,605;254,-321,313,-484,605,477]', + '[-847,-687,565,-182,719,62;-687,299,138,-496,-38,-438;565,138,256,-156,416,41;-182,-496,-156,-816,' + '580,-533;719,-38,416,580,610,118;62,-438,41,-533,118,-910]', + '[-646,-187,760,489,-95,91;-187,-112,-162,-729,-435,-220;760,-162,-249,197,65,180;489,-729,197,-196,' + '-9,250;-95,-435,65,-9,245,520;91,-220,180,250,520,682]', + '[368,-508,-170,198,508,-43;-508,-900,203,-730,-33,-499;-170,203,-192,-47,151,-75;198,-730,-47,82,' + '-271,-61;508,-33,151,-271,324,737;-43,-499,-75,-61,737,417]', + '[982,350,-168,63,808,-314;350,372,-245,-844,427,-780;-168,-245,350,195,122,322;63,-844,195,-138,' + '-112,434;808,427,122,-112,-418,460;-314,-780,322,434,460,-548]', + '[-754,146,14,154,313,436;146,798,668,499,-626,241;14,668,-954,-68,372,386;154,499,-68,-798,619,' + '-444;313,-626,372,619,588,-121;436,241,386,-444,-121,-831]', + '[-822,-100,-182,39,-913,-73;-100,-374,-379,-64,254,-58;-182,-379,-974,-473,-71,-805;39,-64,-473,' + '-169,335,-471;-913,254,-71,335,320,-419;-73,-58,-805,-471,-419,-161]', + '[-649,-296,877,-659,-394,522;-296,804,-65,456,87,-811;877,-65,931,365,284,113;-659,456,365,73,-174,' + '184;-394,87,284,-174,920,498;522,-811,113,184,498,-483]', + '[288,-408,-114,771,519,-372;-408,-362,-282,565,-94,-137;-114,-282,180,-813,-311,-227;771,565,-813,' + '-306,175,-422;519,-94,-311,175,438,5;-372,-137,-227,-422,5,76]', + '[-298,145,-880,-215,268,-450;145,390,415,-316,-284,-189;-880,415,-89,-21,615,-306;-215,-316,-21,' + '486,576,-214;268,-284,615,576,456,258;-450,-189,-306,-214,258,132]', + '[453,260,-81,-494,-121,164;260,-679,662,-549,-175,625;-81,662,-590,-494,144,349;-494,-549,-494,' + '-510,144,-489;-121,-175,144,144,355,546;164,625,349,-489,546,-822]', + '[-326,-26,-165,-218,342,-278;-26,961,-454,-298,-621,-509;-165,-454,927,-413,-84,-789;-218,-298,' + '-413,603,478,709;342,-621,-84,478,549,-67;-278,-509,-789,709,-67,-356]', + '[888,443,211,186,-204,-166;443,518,339,768,635,-52;211,339,626,-115,854,-179;186,768,-115,910,278,' + '-208;-204,635,854,278,-616,663;-166,-52,-179,-208,663,-371]', + '[13,149,-183,503,388,145;149,174,-481,287,-14,744;-183,-481,11,487,209,73;503,287,487,421,469,' + '-933;388,-14,209,469,463,-219;145,744,73,-933,-219,945]', + '[996,129,-245,-267,-30,-569;129,-399,-692,96,-24,70;-245,-692,508,-256,-412,-59;-267,96,-256,-3,' + '286,-96;-30,-24,-412,286,-964,131;-569,70,-59,-96,131,677]', + '[-568,492,-797,-185,-77,-181;492,-608,237,-143,488,270;-797,237,-19,834,473,-442;-185,-143,834,74,' + '-505,714;-77,488,473,-505,-343,-615;-181,270,-442,714,-615,-168]', + '[825,-302,-377,296,221,542;-302,166,174,-89,44,-213;-377,174,-190,195,-711,26;296,-89,195,425,388,' + '190;221,44,-711,388,669,-69;542,-213,26,190,-69,-292]', + '[302,-942,-32,-165,458,115;-942,-9,-21,447,-412,346;-32,-21,728,-513,-514,-422;-165,447,-513,477,' + '390,315;458,-412,-514,390,173,-532;115,346,-422,315,-532,-499]', + '[370,599,-62,-34,-115,57;599,319,433,423,358,-417;-62,433,-994,-74,147,-352;-34,423,-74,886,128,' + '-472;-115,358,147,128,976,-150;57,-417,-352,-472,-150,-775]', + '[946,-23,-247,-316,628,-800;-23,4,290,-227,-567,-930;-247,290,-403,-185,-505,162;-316,-227,-185,' + '-181,485,2;628,-567,-505,485,603,-833;-800,-930,162,2,-833,382]'], + [ + '[-657,218,-1,-499,774,297,-562;218,670,298,71,678,450,417;-1,298,-906,345,-505,-13,146;-499,71,345,' + '-163,-45,-350,-9;774,678,-505,-45,464,68,-744;297,450,-13,-350,68,883,-33;-562,417,146,-9,-744,-33,' + '-653]', + '[-651,277,-344,-557,-100,-5,30;277,173,742,649,426,637,138;-344,742,349,-680,182,-76,-124;-557,649,' + '-680,727,235,513,882;-100,426,182,235,252,-194,-8;-5,637,-76,513,-194,-40,-555;30,138,-124,882,-8,' + '-555,984]', + '[-278,169,-928,416,-189,-786,198;169,-688,123,604,-852,-286,421;-928,123,495,-55,-54,172,149;416,' + '604,-55,156,-103,-362,215;-189,-852,-54,-103,-976,80,67;-786,-286,172,-362,80,-328,445;198,421,149,' + '215,67,445,517]', + '[753,310,-161,167,18,192,-314;310,-549,163,639,67,-150,664;-161,163,871,155,248,-423,194;167,639,' + '155,589,-765,-850,-131;18,67,248,-765,-223,-49,-580;192,-150,-423,-850,-49,-803,440;-314,664,194,' + '-131,-580,440,-791]', + '[-898,-426,-688,-411,-129,-434,-26;-426,287,-618,-166,355,-45,-437;-688,-618,-43,-143,394,-406,' + '-272;-411,-166,-143,-714,548,-679,-178;-129,355,394,548,792,348,291;-434,-45,-406,-679,348,338,' + '-506;-26,-437,-272,-178,291,-506,-872]', + '[-669,-536,-125,567,-808,511,-118;-536,197,84,-11,-443,627,-430;-125,84,286,499,-314,9,-34;567,-11,' + '499,-476,11,-699,-53;-808,-443,-314,11,935,18,261;511,627,9,-699,18,634,11;-118,-430,-34,-53,261,' + '11,-169]', + '[-379,96,11,-80,-343,-385,-744;96,681,62,-343,-10,-240,-9;11,62,-642,-767,183,-421,-800;-80,-343,' + '-767,-259,73,-665,-382;-343,-10,183,73,761,-111,-300;-385,-240,-421,-665,-111,195,-170;-744,-9,' + '-800,-382,-300,-170,662]', + '[876,196,80,-115,-372,220,206;196,343,477,60,-128,751,-298;80,477,256,433,496,-477,143;-115,60,433,' + '522,345,-800,338;-372,-128,496,345,-362,86,575;220,751,-477,-800,86,697,123;206,-298,143,338,575,' + '123,-616]', + '[-205,-318,175,-27,-488,270,-295;-318,-753,-278,-529,199,-352,787;175,-278,-968,-412,450,198,' + '602;-27,-529,-412,778,285,-105,941;-488,199,450,285,455,-842,-66;270,-352,198,-105,-842,380,' + '-103;-295,787,602,941,-66,-103,-790]', + '[-462,-521,403,76,-219,-161,-546;-521,-472,179,-303,552,606,-494;403,179,-991,-245,514,337,133;76,' + '-303,-245,-514,87,-233,31;-219,552,514,87,561,151,462;-161,606,337,-233,151,-74,16;-546,-494,133,' + '31,462,16,-631]', + '[505,53,-114,-406,664,319,-243;53,-983,-393,166,-180,-68,-172;-114,-393,-995,-463,-266,127,' + '-821;-406,166,-463,262,13,36,150;664,-180,-266,13,423,42,-635;319,-68,127,36,42,968,480;-243,-172,' + '-821,150,-635,480,-782]', + '[302,-223,276,-96,85,-138,-263;-223,-793,-501,-293,422,529,382;276,-501,-943,207,514,-70,771;-96,' + '-293,207,586,11,338,756;85,422,514,11,120,-390,411;-138,529,-70,338,-390,-419,302;-263,382,771,756,' + '411,302,481]', + '[335,-465,13,-133,-195,16,593;-465,-737,108,-543,-28,-65,-2;13,108,-416,881,-60,863,225;-133,-543,' + '881,-122,-191,-803,463;-195,-28,-60,-191,69,190,312;16,-65,863,-803,190,-573,-331;593,-2,225,463,' + '312,-331,561]', + '[557,-886,-442,139,-237,575,-334;-886,-165,-99,-578,-587,250,123;-442,-99,20,-206,398,-509,' + '-613;139,-578,-206,696,-250,476,52;-237,-587,398,-250,543,-176,742;575,250,-509,476,-176,-668,' + '162;-334,123,-613,52,742,162,-72]', + '[-256,738,-236,-81,521,512,-67;738,300,67,62,-520,34,235;-236,67,780,-469,140,-228,-247;-81,62,' + '-469,-822,502,649,-368;521,-520,140,502,333,-809,84;512,34,-228,649,-809,-75,657;-67,235,-247,-368,' + '84,657,483]', + '[254,-269,69,341,-754,473,147;-269,660,-699,-134,-24,-67,-45;69,-699,35,-307,-16,-47,-528;341,-134,' + '-307,438,342,-610,-74;-754,-24,-16,342,526,-721,646;473,-67,-47,-610,-721,-454,127;147,-45,-528,' + '-74,646,127,-659]', + '[-407,581,-416,67,66,-379,187;581,633,417,225,-352,62,-64;-416,417,85,-214,722,488,518;67,225,-214,' + '-15,95,265,-36;66,-352,722,95,709,98,-614;-379,62,488,265,98,977,-111;187,-64,518,-36,-614,-111,' + '-144]', + '[168,-149,226,-257,-324,-242,256;-149,-395,-559,7,-415,305,667;226,-559,-737,263,-112,-876,' + '431;-257,7,263,-693,-145,436,617;-324,-415,-112,-145,-8,848,-685;-242,305,-876,436,848,-331,' + '-33;256,667,431,617,-685,-33,781]', + '[-493,150,-108,-195,-30,-562,-557;150,-58,-320,79,-129,-456,191;-108,-320,82,441,-625,151,' + '-112;-195,79,441,625,505,134,188;-30,-129,-625,505,113,788,-446;-562,-456,151,134,788,931,52;-557,' + '191,-112,188,-446,52,-693]', + '[-257,20,262,-274,5,446,-284;20,734,-134,-390,-164,378,335;262,-134,990,643,-3,411,-69;-274,-390,' + '643,398,612,218,-65;5,-164,-3,612,443,634,-337;446,378,411,218,634,200,-841;-284,335,-69,-65,-337,' + '-841,340]', + '[-414,-84,167,142,7,298,-197;-84,-576,795,356,596,289,368;167,795,-594,250,428,-7,44;142,356,250,' + '-481,-357,527,-336;7,596,428,-357,-906,-321,140;298,289,-7,527,-321,804,408;-197,368,44,-336,140,' + '408,668]', + '[35,557,-451,383,189,-443,-533;557,832,995,177,-357,273,139;-451,995,-184,442,40,-357,348;383,177,' + '442,226,-487,-215,-284;189,-357,40,-487,398,-83,151;-443,273,-357,-215,-83,-241,-542;-533,139,348,' + '-284,151,-542,831]', + '[956,-222,-121,-224,-8,-422,-439;-222,965,799,-60,127,808,-458;-121,799,548,-769,25,-235,42;-224,' + '-60,-769,-396,350,-309,433;-8,127,25,350,879,276,339;-422,808,-235,-309,276,-39,-29;-439,-458,42,' + '433,339,-29,-717]', + '[-747,583,508,-311,-22,-100,-176;583,558,777,487,25,626,-218;508,777,446,33,-254,-526,-197;-311,' + '487,33,-865,942,-591,-153;-22,25,-254,942,-566,-310,192;-100,626,-526,-591,-310,750,59;-176,-218,' + '-197,-153,192,59,-920]', + '[667,-531,-248,620,-72,-156,-279;-531,665,-153,-237,-231,91,265;-248,-153,-1,306,-352,-492,202;620,' + '-237,306,-891,-340,1,618;-72,-231,-352,-340,779,68,764;-156,91,-492,1,68,137,33;-279,265,202,618,' + '764,33,653]', + '[386,163,-387,-254,-208,-40,737;163,-296,-546,225,-17,99,-15;-387,-546,571,-72,-895,-100,291;-254,' + '225,-72,-195,-222,478,-592;-208,-17,-895,-222,318,-708,-336;-40,99,-100,478,-708,-883,-148;737,-15,' + '291,-592,-336,-148,-698]', + '[431,-211,-112,160,-3,841,366;-211,198,79,-453,-183,223,183;-112,79,243,-204,480,168,-648;160,-453,' + '-204,169,-80,-52,-341;-3,-183,480,-80,-577,274,55;841,223,168,-52,274,-702,-478;366,183,-648,-341,' + '55,-478,928]', + '[431,21,-4,646,197,366,-363;21,48,904,207,-20,476,597;-4,904,-660,754,211,347,407;646,207,754,-647,' + '-10,-39,387;197,-20,211,-10,726,-372,2;366,476,347,-39,-372,-308,274;-363,597,407,387,2,274,77]', + '[709,192,222,174,-105,-173,364;192,-471,-174,-116,-107,338,-4;222,-174,-911,256,118,-443,412;174,' + '-116,256,781,249,-525,-98;-105,-107,118,249,-658,-81,-154;-173,338,-443,-525,-81,854,719;364,-4,' + '412,-98,-154,719,739]', + '[708,-639,135,400,-524,462,384;-639,-711,90,-302,-496,858,-220;135,90,929,324,212,876,-833;400,' + '-302,324,525,335,-20,-493;-524,-496,212,335,67,491,399;462,858,876,-20,491,640,249;384,-220,-833,' + '-493,399,249,421]', + '[-365,216,-176,275,9,-248,-76;216,459,-334,167,121,427,255;-176,-334,-151,146,-879,-846,-181;275,' + '167,146,-387,-162,149,24;9,121,-879,-162,402,768,560;-248,427,-846,149,768,-290,-195;-76,255,-181,' + '24,560,-195,-123]', + '[-225,283,143,-512,790,-529,-203;283,-405,91,328,236,451,-197;143,91,707,294,-156,-39,413;-512,328,' + '294,-517,641,-27,630;790,236,-156,641,892,474,-414;-529,451,-39,-27,474,494,728;-203,-197,413,630,' + '-414,728,445]', + '[293,247,547,-187,-63,-225,-510;247,525,-182,861,-350,482,515;547,-182,-140,-139,-91,-749,303;-187,' + '861,-139,-856,-402,-307,-198;-63,-350,-91,-402,-432,-406,-440;-225,482,-749,-307,-406,665,' + '-243;-510,515,303,-198,-440,-243,313]', + '[431,282,150,482,-570,-252,294;282,224,240,90,-700,-554,-81;150,240,-516,-74,62,373,328;482,90,-74,' + '-313,189,-54,-730;-570,-700,62,189,402,-26,-282;-252,-554,373,-54,-26,-709,-683;294,-81,328,-730,' + '-282,-683,110]', + '[-174,143,517,614,-145,-362,-519;143,741,383,-381,22,-514,-678;517,383,849,-409,-496,-56,497;614,' + '-381,-409,659,-347,340,736;-145,22,-496,-347,526,296,137;-362,-514,-56,340,296,648,95;-519,-678,' + '497,736,137,95,-934]', + '[318,-645,275,-730,-326,633,107;-645,-247,-156,-53,116,-511,-162;275,-156,-630,-570,262,-343,' + '526;-730,-53,-570,-631,690,329,-312;-326,116,262,690,-455,-207,-152;633,-511,-343,329,-207,-711,' + '-496;107,-162,526,-312,-152,-496,-417]', + '[-101,-812,-33,66,-774,363,378;-812,681,-71,-263,-128,747,547;-33,-71,641,531,613,-531,-99;66,-263,' + '531,579,167,-450,0;-774,-128,613,167,638,-645,-153;363,747,-531,-450,-645,304,-43;378,547,-99,0,' + '-153,-43,408]', + '[-386,189,698,382,-278,-611,609;189,-601,2,-478,344,261,301;698,2,710,-587,-393,-304,255;382,-478,' + '-587,98,-652,-87,87;-278,344,-393,-652,-788,-168,-508;-611,261,-304,-87,-168,792,-22;609,301,255,' + '87,-508,-22,672]', + '[1,-104,-86,40,-647,816,-352;-104,406,-81,-537,493,80,-435;-86,-81,-284,-66,554,-623,680;40,-537,' + '-66,-356,29,-443,248;-647,493,554,29,746,138,685;816,80,-623,-443,138,424,34;-352,-435,680,248,685,' + '34,922]', + '[-682,-50,318,-106,241,743,-780;-50,926,20,385,-582,626,237;318,20,-374,-88,-69,-122,-824;-106,385,' + '-88,-49,-469,390,398;241,-582,-69,-469,-978,-624,-206;743,626,-122,390,-624,557,538;-780,237,-824,' + '398,-206,538,868]', + '[-910,-842,182,171,273,-403,17;-842,737,478,-363,723,319,-225;182,478,99,507,-469,54,-186;171,-363,' + '507,427,-128,271,-239;273,723,-469,-128,-682,-455,-389;-403,319,54,271,-455,712,-162;17,-225,-186,' + '-239,-389,-162,892]', + '[-364,164,-488,-562,-12,-482,416;164,652,-86,436,180,-102,20;-488,-86,-351,-471,-252,346,250;-562,' + '436,-471,758,516,-14,163;-12,180,-252,516,204,-524,-219;-482,-102,346,-14,-524,306,101;416,20,250,' + '163,-219,101,-523]', + '[-916,-771,265,-35,-501,783,587;-771,-632,15,187,687,-308,-32;265,15,103,-346,-254,91,89;-35,187,' + '-346,707,-63,14,436;-501,687,-254,-63,440,-502,-91;783,-308,91,14,-502,405,-182;587,-32,89,436,-91,' + '-182,-450]', + '[-53,-809,-515,-200,44,-145,326;-809,-948,512,-124,-898,-316,322;-515,512,936,153,-148,-146,' + '206;-200,-124,153,959,-152,-321,7;44,-898,-148,-152,71,-76,-786;-145,-316,-146,-321,-76,817,' + '-700;326,322,206,7,-786,-700,-662]', + '[-302,67,-462,263,105,8,292;67,327,-823,-42,-113,527,30;-462,-823,417,55,860,-10,425;263,-42,55,' + '173,281,-394,122;105,-113,860,281,-854,-221,-99;8,527,-10,-394,-221,227,-182;292,30,425,122,-99,' + '-182,-346]', + '[-119,795,-290,-384,121,-469,430;795,-552,645,-722,-394,-170,51;-290,645,600,-222,12,-297,117;-384,' + '-722,-222,-454,-223,-475,-789;121,-394,12,-223,-411,321,529;-469,-170,-297,-475,321,-873,182;430,' + '51,117,-789,529,182,-349]', + '[117,509,-692,-458,-347,-602,203;509,279,-346,393,-879,798,-496;-692,-346,-973,97,-705,-283,' + '62;-458,393,97,-21,-167,-709,-206;-347,-879,-705,-167,-400,-300,-501;-602,798,-283,-709,-300,-803,' + '-620;203,-496,62,-206,-501,-620,920]', + '[975,303,-34,653,-515,-128,-160;303,-703,-62,-749,-24,-40,-108;-34,-62,-391,-85,254,-713,-443;653,' + '-749,-85,597,298,-433,-134;-515,-24,254,298,-460,738,375;-128,-40,-713,-433,738,312,487;-160,-108,' + '-443,-134,375,487,-620]', + '[-981,789,214,562,462,-166,172;789,-829,323,554,-240,35,-524;214,323,491,-355,881,-401,74;562,554,' + '-355,639,-211,10,80;462,-240,881,-211,-383,-868,100;-166,35,-401,10,-868,-229,-605;172,-524,74,80,' + '100,-605,-209]', + '[429,863,-528,200,-44,-239,687;863,-427,684,-810,364,101,-64;-528,684,-196,102,247,-284,-142;200,' + '-810,102,-89,-719,-163,137;-44,364,247,-719,775,-524,247;-239,101,-284,-163,-524,-630,37;687,-64,' + '-142,137,247,37,766]', + '[442,-92,461,-146,-273,75,326;-92,721,243,-13,-137,49,325;461,243,-944,-341,-654,63,-261;-146,-13,' + '-341,-232,-147,518,-381;-273,-137,-654,-147,-976,366,-674;75,49,63,518,366,835,584;326,325,-261,' + '-381,-674,584,-946]', + '[458,294,-391,31,-493,233,-911;294,-262,327,-369,388,-85,-94;-391,327,491,-2,275,45,-40;31,-369,-2,' + '-769,-802,-38,108;-493,388,275,-802,65,-592,706;233,-85,45,-38,-592,696,-294;-911,-94,-40,108,706,' + '-294,419]', + '[991,340,-589,-442,-22,210,897;340,258,-15,-71,-366,29,-201;-589,-15,-888,148,149,-278,246;-442,' + '-71,148,-834,-182,-161,-222;-22,-366,149,-182,-625,-676,111;210,29,-278,-161,-676,38,342;897,-201,' + '246,-222,111,342,798]', + '[736,29,739,-519,-41,174,-774;29,-184,24,-309,826,9,-527;739,24,135,-420,306,589,353;-519,-309,' + '-420,-441,-63,-146,-272;-41,826,306,-63,-953,-569,-297;174,9,589,-146,-569,652,-511;-774,-527,353,' + '-272,-297,-511,-479]', + '[-109,587,6,96,377,-33,-97;587,-609,-191,364,-276,-540,-52;6,-191,500,-21,158,-698,249;96,364,-21,' + '746,-2,-430,-804;377,-276,158,-2,498,-389,626;-33,-540,-698,-430,-389,968,-594;-97,-52,249,-804,' + '626,-594,216]', + '[-571,-349,-384,108,271,604,-1;-349,-949,-190,-891,-93,-143,173;-384,-190,652,-74,-346,-159,' + '618;108,-891,-74,-925,-782,-1,345;271,-93,-346,-782,-244,496,485;604,-143,-159,-1,496,724,166;-1,' + '173,618,345,485,166,604]', + '[-613,73,540,200,372,355,166;73,-962,190,-582,-117,-596,393;540,190,155,18,-327,-89,762;200,-582,' + '18,805,-3,529,-308;372,-117,-327,-3,-604,-88,-450;355,-596,-89,529,-88,679,-111;166,393,762,-308,' + '-450,-111,-247]', + '[330,524,-107,-556,-84,57,783;524,663,-148,373,685,-204,405;-107,-148,-216,104,-264,471,51;-556,' + '373,104,-862,97,-167,-661;-84,685,-264,97,261,745,-393;57,-204,471,-167,745,785,54;783,405,51,-661,' + '-393,54,436]', + '[977,-115,278,768,-817,-844,183;-115,287,178,-402,-558,-397,-558;278,178,-402,123,-708,158,-99;768,' + '-402,123,140,-676,245,-9;-817,-558,-708,-676,985,228,187;-844,-397,158,245,228,-950,129;183,-558,' + '-99,-9,187,129,-905]', + '[-418,19,223,349,-143,561,784;19,200,-698,444,18,633,39;223,-698,-923,-365,419,-71,-104;349,444,' + '-365,-116,64,-278,348;-143,18,419,64,-115,-772,526;561,633,-71,-278,-772,-62,360;784,39,-104,348,' + '526,360,495]', + '[-996,-141,409,84,635,-241,327;-141,607,111,-622,154,-49,-450;409,111,-233,-522,114,-388,-35;84,' + '-622,-522,-496,-648,-210,-180;635,154,114,-648,178,-530,-75;-241,-49,-388,-210,-530,-505,-88;327,' + '-450,-35,-180,-75,-88,505]', + '[-505,-167,448,452,616,-300,473;-167,978,237,580,-364,334,104;448,237,948,74,-536,-860,-344;452,' + '580,74,926,-758,31,581;616,-364,-536,-758,-472,-269,300;-300,334,-860,31,-269,464,-374;473,104,' + '-344,581,300,-374,536]', + '[-924,506,-147,-140,841,-163,-94;506,899,168,-373,-132,-214,618;-147,168,701,-230,-200,100,' + '-632;-140,-373,-230,-86,122,-541,-169;841,-132,-200,122,815,874,-462;-163,-214,100,-541,874,521,' + '521;-94,618,-632,-169,-462,521,998]', + '[960,-103,392,192,-61,280,-369;-103,122,-804,-260,-197,314,76;392,-804,348,161,568,-213,10;192,' + '-260,161,634,166,-222,738;-61,-197,568,166,574,179,-130;280,314,-213,-222,179,354,-241;-369,76,10,' + '738,-130,-241,754]', + '[844,283,407,-361,-784,-629,-443;283,895,-741,377,552,545,-356;407,-741,-446,713,-37,-642,-95;-361,' + '377,713,-706,-509,790,-129;-784,552,-37,-509,929,-216,831;-629,545,-642,790,-216,-381,126;-443,' + '-356,-95,-129,831,126,864]', + '[-44,-613,-265,-59,-454,86,-523;-613,695,-185,100,70,-185,261;-265,-185,516,-915,-514,-305,' + '-183;-59,100,-915,-479,673,-599,9;-454,70,-514,673,-97,147,443;86,-185,-305,-599,147,-52,171;-523,' + '261,-183,9,443,171,40]', + '[615,-292,734,37,350,511,-512;-292,394,773,-557,158,-754,212;734,773,466,406,412,519,-125;37,-557,' + '406,964,117,-569,99;350,158,412,117,-131,-741,134;511,-754,519,-569,-741,-996,32;-512,212,-125,99,' + '134,32,34]', + '[-355,-682,-504,-263,483,226,392;-682,-581,45,142,631,-117,-233;-504,45,334,327,765,-196,-286;-263,' + '142,327,-785,367,98,-324;483,631,765,367,482,-40,468;226,-117,-196,98,-40,151,495;392,-233,-286,' + '-324,468,495,-171]', + '[-691,-179,-303,319,211,-212,59;-179,-148,-340,-622,-170,332,323;-303,-340,-233,52,734,-50,' + '-470;319,-622,52,-522,-204,344,-554;211,-170,734,-204,753,37,133;-212,332,-50,344,37,704,260;59,' + '323,-470,-554,133,260,-214]', + '[-430,244,-408,98,568,-419,-263;244,-498,-523,854,-242,436,573;-408,-523,761,-390,554,-762,-188;98,' + '854,-390,526,196,-723,-193;568,-242,554,196,-930,-118,-299;-419,436,-762,-723,-118,-244,409;-263,' + '573,-188,-193,-299,409,-954]', + '[-735,487,539,-167,200,167,212;487,-195,356,-722,-42,338,77;539,356,37,-497,723,-74,388;-167,-722,' + '-497,-702,-357,-134,-83;200,-42,723,-357,-229,-666,547;167,338,-74,-134,-666,482,-26;212,77,388,' + '-83,547,-26,-699]', + '[-560,-459,8,-566,424,-163,266;-459,40,251,-484,847,-77,-806;8,251,-120,431,23,-32,-17;-566,-484,' + '431,114,-392,-411,-456;424,847,23,-392,492,-92,-128;-163,-77,-32,-411,-92,-644,47;266,-806,-17,' + '-456,-128,47,-358]', + '[-616,38,400,782,-451,-560,243;38,641,-945,-72,-426,-80,-308;400,-945,493,161,150,652,-130;782,-72,' + '161,-182,-392,99,236;-451,-426,150,-392,-164,-7,155;-560,-80,652,99,-7,114,-744;243,-308,-130,236,' + '155,-744,558]', + '[-987,-215,49,-444,-384,-381,-367;-215,-468,61,-421,541,86,432;49,61,21,-308,862,-435,239;-444,' + '-421,-308,-762,-189,62,-520;-384,541,862,-189,33,-358,-566;-381,86,-435,62,-358,-652,504;-367,432,' + '239,-520,-566,504,223]', + '[122,769,689,-167,-441,471,-585;769,217,-172,-209,-408,-284,370;689,-172,-762,714,380,131,' + '-200;-167,-209,714,228,-157,153,-664;-441,-408,380,-157,70,476,-347;471,-284,131,153,476,-505,' + '-284;-585,370,-200,-664,-347,-284,-925]', + '[-435,-265,190,-229,366,212,-510;-265,972,-244,142,-542,304,-272;190,-244,492,-69,-610,555,' + '-292;-229,142,-69,110,-380,-179,-362;366,-542,-610,-380,-600,-228,-80;212,304,555,-179,-228,-465,' + '-65;-510,-272,-292,-362,-80,-65,-722]', + '[-177,-233,784,85,183,-223,-84;-233,817,78,344,391,559,-496;784,78,839,224,330,371,230;85,344,224,' + '-278,412,-272,197;183,391,330,412,639,-809,-132;-223,559,371,-272,-809,109,454;-84,-496,230,197,' + '-132,454,-8]', + '[466,393,20,79,-620,-613,-319;393,48,32,520,13,38,-394;20,32,-607,-369,-263,-144,701;79,520,-369,' + '-666,399,-87,536;-620,13,-263,399,-198,640,-619;-613,38,-144,-87,640,-184,751;-319,-394,701,536,' + '-619,751,-506]', + '[-102,-407,-405,-138,-542,-43,669;-407,955,-156,256,-752,-475,-266;-405,-156,759,54,272,-562,' + '123;-138,256,54,555,-155,-458,520;-542,-752,272,-155,432,678,-187;-43,-475,-562,-458,678,-679,' + '863;669,-266,123,520,-187,863,999]', + '[336,672,-224,-42,-744,803,26;672,-74,-277,402,-180,-131,-288;-224,-277,28,-862,-359,-183,-623;-42,' + '402,-862,-49,-396,-288,-147;-744,-180,-359,-396,-399,401,425;803,-131,-183,-288,401,-523,402;26,' + '-288,-623,-147,425,402,671]', + '[343,302,451,869,-728,461,469;302,-479,-552,-94,99,335,343;451,-552,123,137,-22,-150,371;869,-94,' + '137,-567,29,107,749;-728,99,-22,29,-921,126,78;461,335,-150,107,126,-967,774;469,343,371,749,78,' + '774,-392]', + '[304,146,-18,-752,-8,-481,-790;146,133,175,113,212,-370,-62;-18,175,-586,-334,-677,353,-505;-752,' + '113,-334,-440,-592,431,180;-8,212,-677,-592,79,282,350;-481,-370,353,431,282,569,262;-790,-62,-505,' + '180,350,262,725]', + '[-892,304,-153,-826,-17,209,-21;304,-228,-16,751,167,590,495;-153,-16,339,94,-287,-176,-335;-826,' + '751,94,759,-44,338,-62;-17,167,-287,-44,823,-262,72;209,590,-176,338,-262,166,-551;-21,495,-335,' + '-62,72,-551,267]', + '[858,408,-336,620,83,95,247;408,-973,229,-540,326,126,153;-336,229,379,-102,-37,-334,-233;620,-540,' + '-102,51,-72,-782,372;83,326,-37,-72,778,-571,863;95,126,-334,-782,-571,884,101;247,153,-233,372,' + '863,101,292]', + '[805,581,525,-453,374,-453,64;581,665,155,36,-90,357,-181;525,155,-944,691,-432,-147,-299;-453,36,' + '691,-785,-199,514,-43;374,-90,-432,-199,-278,-559,-390;-453,357,-147,514,-559,501,-89;64,-181,-299,' + '-43,-390,-89,821]', + '[-217,-496,-326,151,715,-222,58;-496,-627,281,-323,-691,-42,20;-326,281,754,-327,269,61,-702;151,' + '-323,-327,418,544,349,-7;715,-691,269,544,-52,-146,-94;-222,-42,61,349,-146,23,656;58,20,-702,-7,' + '-94,656,416]', + '[258,-267,-600,-364,-541,52,-36;-267,-964,-55,343,-169,-401,-160;-600,-55,962,143,-364,136,' + '231;-364,343,143,-814,-149,83,547;-541,-169,-364,-149,-297,441,-664;52,-401,136,83,441,-648,' + '125;-36,-160,231,547,-664,125,-186]', + '[708,-24,600,480,556,-701,628;-24,498,-49,-41,94,-69,407;600,-49,-836,281,641,-636,-372;480,-41,' + '281,173,-193,18,351;556,94,641,-193,-414,-33,59;-701,-69,-636,18,-33,58,-212;628,407,-372,351,59,' + '-212,838]', + '[404,379,-164,490,-372,-323,-178;379,121,-352,-507,-379,-58,-253;-164,-352,936,760,534,-648,' + '463;490,-507,760,540,-221,-193,-283;-372,-379,534,-221,965,114,-500;-323,-58,-648,-193,114,588,' + '516;-178,-253,463,-283,-500,516,133]', + '[-274,-8,774,69,632,746,-742;-8,550,834,-903,291,-438,-107;774,834,902,-160,-580,423,-143;69,-903,' + '-160,852,453,216,-372;632,291,-580,453,562,211,56;746,-438,423,216,211,288,-255;-742,-107,-143,' + '-372,56,-255,381]', + '[29,-608,-241,-79,639,-259,44;-608,-80,727,279,150,-707,11;-241,727,-964,-562,-228,271,299;-79,279,' + '-562,233,-245,-250,-16;639,150,-228,-245,208,-249,566;-259,-707,271,-250,-249,-498,342;44,11,299,' + '-16,566,342,502]', + '[-372,69,-132,48,802,42,-573;69,349,-147,702,-346,177,-132;-132,-147,-588,-729,-253,211,373;48,702,' + '-729,-885,994,206,-391;802,-346,-253,994,-654,286,-125;42,177,211,206,286,-412,5;-573,-132,373,' + '-391,-125,5,917]', + '[857,-510,115,216,-52,263,11;-510,906,25,-444,-200,801,-659;115,25,832,493,-543,-283,-80;216,-444,' + '493,-723,-89,-383,-48;-52,-200,-543,-89,228,641,179;263,801,-283,-383,641,-984,390;11,-659,-80,-48,' + '179,390,314]', + '[-786,-107,592,-837,329,-489,-279;-107,326,699,517,-347,109,-273;592,699,852,366,499,16,-329;-837,' + '517,366,939,-584,-909,494;329,-347,499,-584,-172,-535,-62;-489,109,16,-909,-535,-147,223;-279,-273,' + '-329,494,-62,223,442]', + '[-529,-343,-828,-312,-108,143,-370;-343,583,-181,167,-353,654,490;-828,-181,586,334,-153,-633,' + '214;-312,167,334,538,635,-73,-251;-108,-353,-153,635,338,-2,-38;143,654,-633,-73,-2,732,543;-370,' + '490,214,-251,-38,543,-691]', + '[-791,-269,-24,310,42,44,-620;-269,64,-128,341,635,482,-346;-24,-128,-745,451,-170,232,-236;310,' + '341,451,403,466,-26,-684;42,635,-170,466,-274,510,-103;44,482,232,-26,510,35,-232;-620,-346,-236,' + '-684,-103,-232,736]', + '[-410,-80,172,-425,205,677,232;-80,373,214,214,-24,232,-602;172,214,771,493,250,-99,546;-425,214,' + '493,881,-773,-465,-210;205,-24,250,-773,-858,231,664;677,232,-99,-465,231,337,-335;232,-602,546,' + '-210,664,-335,-405]', + '[268,-65,-243,164,-411,352,-74;-65,-70,-191,22,81,89,508;-243,-191,-211,140,-200,-766,687;164,22,' + '140,572,30,-779,441;-411,81,-200,30,-903,-329,510;352,89,-766,-779,-329,276,352;-74,508,687,441,' + '510,352,-884]', + '[183,-42,-185,-223,389,-71,312;-42,365,387,-828,-348,91,-815;-185,387,-561,484,-238,-10,374;-223,' + '-828,484,-835,383,2,397;389,-348,-238,383,-852,-936,152;-71,91,-10,2,-936,834,-652;312,-815,374,' + '397,152,-652,-485]', + '[577,44,346,411,287,817,385;44,293,-391,67,455,-125,-706;346,-391,-393,690,600,-139,601;411,67,690,' + '-29,112,301,-324;287,455,600,112,431,296,-877;817,-125,-139,301,296,-373,255;385,-706,601,-324,' + '-877,255,-210]'], + [ + '[808,-278,875,-231,-399,765,-565,50;-278,221,592,-213,177,-142,857,-69;875,592,-413,56,-105,-81,' + '-184,406;-231,-213,56,-429,-157,175,484,135;-399,177,-105,-157,997,663,302,59;765,-142,-81,175,663,' + '-39,137,106;-565,857,-184,484,302,137,-521,-252;50,-69,406,135,59,106,-252,399]', + '[161,157,43,-345,453,649,77,-136;157,-768,194,-548,480,-97,-710,-429;43,194,-445,490,285,-678,923,' + '637;-345,-548,490,215,271,-107,926,102;453,480,285,271,739,-373,-185,-466;649,-97,-678,-107,-373,' + '755,464,-453;77,-710,923,926,-185,464,-617,-261;-136,-429,637,102,-466,-453,-261,-779]', + '[743,-327,77,563,9,-897,132,362;-327,-673,511,210,-354,-168,-545,301;77,511,514,525,-511,-457,122,' + '-456;563,210,525,236,132,29,199,266;9,-354,-511,132,94,158,286,-78;-897,-168,-457,29,158,738,10,' + '-492;132,-545,122,199,286,10,242,-381;362,301,-456,266,-78,-492,-381,767]', + '[551,505,-571,261,236,-131,341,85;505,641,-277,-294,298,-125,11,271;-571,-277,416,390,-95,-423,166,' + '-278;261,-294,390,-219,-483,582,476,-175;236,298,-95,-483,736,-212,209,49;-131,-125,-423,582,-212,' + '-712,-294,110;341,11,166,476,209,-294,-524,-50;85,271,-278,-175,49,110,-50,-539]', + '[475,359,-523,-420,609,-527,-78,-101;359,953,646,-263,-266,-137,5,307;-523,646,348,289,453,-535,' + '-289,-657;-420,-263,289,963,-124,-118,-1,-70;609,-266,453,-124,-338,470,831,300;-527,-137,-535,' + '-118,470,-970,226,517;-78,5,-289,-1,831,226,-634,404;-101,307,-657,-70,300,517,404,366]', + '[980,164,-93,192,119,-740,245,657;164,844,-4,-506,111,284,-440,-335;-93,-4,474,41,7,583,308,' + '434;192,-506,41,52,-17,477,-103,147;119,111,7,-17,3,-449,-606,-38;-740,284,583,477,-449,288,186,' + '-168;245,-440,308,-103,-606,186,588,-283;657,-335,434,147,-38,-168,-283,-608]', + '[702,374,72,726,26,-251,-277,-646;374,-197,772,48,42,-921,-95,183;72,772,-944,671,685,-164,-307,' + '-742;726,48,671,212,86,57,173,606;26,42,685,86,-552,-80,-561,-73;-251,-921,-164,57,-80,72,497,' + '195;-277,-95,-307,173,-561,497,-715,-35;-646,183,-742,606,-73,195,-35,384]', + '[311,-486,254,208,305,101,379,-147;-486,-706,1,375,-160,249,566,-784;254,1,965,-582,-576,72,367,' + '355;208,375,-582,-634,-189,771,-100,526;305,-160,-576,-189,766,-326,-797,366;101,249,72,771,-326,' + '-275,-288,498;379,566,367,-100,-797,-288,-796,295;-147,-784,355,526,366,498,295,-216]', + '[621,385,545,-215,-193,652,-102,-335;385,663,-954,337,-89,-287,-52,295;545,-954,228,-68,-319,-537,' + '54,548;-215,337,-68,128,-189,-89,-541,578;-193,-89,-319,-189,-471,340,-24,-53;652,-287,-537,-89,' + '340,232,201,-740;-102,-52,54,-541,-24,201,-425,-527;-335,295,548,578,-53,-740,-527,935]', + '[-757,829,-286,395,13,484,72,535;829,-659,-621,-139,-267,-51,833,-148;-286,-621,973,-667,136,-158,' + '-20,-334;395,-139,-667,820,-595,275,54,196;13,-267,136,-595,450,157,-109,879;484,-51,-158,275,157,' + '797,686,22;72,833,-20,54,-109,686,209,-440;535,-148,-334,196,879,22,-440,-811]', + '[-810,-857,-276,-493,-173,-325,372,514;-857,171,228,152,592,-219,-809,-613;-276,228,737,-440,158,' + '-63,-17,-24;-493,152,-440,465,392,592,-11,268;-173,592,158,392,-113,158,-58,-431;-325,-219,-63,592,' + '158,593,164,241;372,-809,-17,-11,-58,164,-75,-227;514,-613,-24,268,-431,241,-227,-207]', + '[-320,220,-310,312,251,-597,-2,-48;220,-268,-316,-874,-290,284,-485,327;-310,-316,-550,899,-626,' + '180,-659,263;312,-874,899,187,-23,-716,166,726;251,-290,-626,-23,-140,-255,146,-160;-597,284,180,' + '-716,-255,-256,429,-32;-2,-485,-659,166,146,429,717,38;-48,327,263,726,-160,-32,38,-834]', + '[-26,222,-112,-333,-202,214,90,-711;222,436,-141,344,-370,108,-703,-562;-112,-141,494,-214,11,-781,' + '-221,231;-333,344,-214,865,175,-617,-41,414;-202,-370,11,175,569,182,-413,-311;214,108,-781,-617,' + '182,-617,409,-260;90,-703,-221,-41,-413,409,209,-42;-711,-562,231,414,-311,-260,-42,481]', + '[-564,30,35,-156,437,-180,-133,-249;30,-287,-632,-442,-332,631,-502,-67;35,-632,-917,-31,-191,495,' + '-541,-644;-156,-442,-31,-83,312,-212,116,192;437,-332,-191,312,-299,-112,-316,232;-180,631,495,' + '-212,-112,264,226,-87;-133,-502,-541,116,-316,226,754,-95;-249,-67,-644,192,232,-87,-95,598]', + '[-912,-37,407,599,368,434,324,26;-37,-10,-78,-400,-21,187,-151,603;407,-78,-198,817,111,-796,859,' + '-436;599,-400,817,968,-805,154,-479,592;368,-21,111,-805,-57,-376,-632,-17;434,187,-796,154,-376,' + '743,369,280;324,-151,859,-479,-632,369,-851,658;26,603,-436,592,-17,280,658,-803]', + '[-211,212,428,-720,-651,188,708,-289;212,-780,-18,-345,265,194,-487,48;428,-18,-501,38,343,685,285,' + '25;-720,-345,38,744,244,519,672,425;-651,265,343,244,941,-318,-56,-181;188,194,685,519,-318,12,' + '-413,161;708,-487,285,672,-56,-413,276,-549;-289,48,25,425,-181,161,-549,604]', + '[-262,150,242,-310,314,-665,312,805;150,-403,-540,80,-676,-607,128,-249;242,-540,-208,-712,-542,' + '-247,358,147;-310,80,-712,-127,337,-608,-614,579;314,-676,-542,337,545,-175,-746,-36;-665,-607,' + '-247,-608,-175,-653,74,245;312,128,358,-614,-746,74,-934,564;805,-249,147,579,-36,245,564,86]', + '[-621,172,354,106,936,-47,258,-305;172,-331,95,-233,-331,445,-542,40;354,95,-677,117,-16,-298,162,' + '247;106,-233,117,372,367,-647,-232,-136;936,-331,-16,367,523,274,375,8;-47,445,-298,-647,274,707,' + '-765,291;258,-542,162,-232,375,-765,36,-485;-305,40,247,-136,8,291,-485,-453]', + '[845,-105,-231,350,329,-442,755,132;-105,399,674,634,123,34,-145,94;-231,674,-531,427,170,683,-181,' + '-350;350,634,427,439,450,333,654,65;329,123,170,450,27,209,373,-483;-442,34,683,333,209,359,808,' + '-578;755,-145,-181,654,373,808,235,-349;132,94,-350,65,-483,-578,-349,353]', + '[-54,-425,166,21,458,-478,-71,-682;-425,837,-567,179,-231,166,-555,-1;166,-567,572,71,329,-143,132,' + '-98;21,179,71,766,447,548,-249,-499;458,-231,329,447,-82,-770,-182,-82;-478,166,-143,548,-770,-679,' + '303,55;-71,-555,132,-249,-182,303,-210,-606;-682,-1,-98,-499,-82,55,-606,-368]', + '[-721,246,-538,945,-96,391,-352,-225;246,-99,-25,127,-123,-252,421,-586;-538,-25,836,-549,-188,242,' + '-514,-467;945,127,-549,-67,-54,-308,-641,-797;-96,-123,-188,-54,690,-45,498,393;391,-252,242,-308,' + '-45,233,728,-371;-352,421,-514,-641,498,728,323,-365;-225,-586,-467,-797,393,-371,-365,728]', + '[-585,-371,752,-334,482,193,-119,-166;-371,-666,736,37,-634,575,65,-174;752,736,893,938,124,325,' + '-414,233;-334,37,938,-467,62,-672,100,416;482,-634,124,62,19,-618,-522,180;193,575,325,-672,-618,' + '-131,253,120;-119,65,-414,100,-522,253,-644,-289;-166,-174,233,416,180,120,-289,598]', + '[-834,14,-85,202,-197,503,-44,-425;14,-689,522,-656,108,-258,56,378;-85,522,-379,-334,-421,540,' + '-321,-436;202,-656,-334,521,-642,475,228,-493;-197,108,-421,-642,-881,-119,-114,177;503,-258,540,' + '475,-119,-137,-41,-60;-44,56,-321,228,-114,-41,432,141;-425,378,-436,-493,177,-60,141,759]', + '[-177,-670,-708,580,-790,-437,-319,-249;-670,173,836,-376,-175,52,366,163;-708,836,-848,-301,-568,' + '384,-254,-718;580,-376,-301,892,-36,310,110,-594;-790,-175,-568,-36,-118,-368,-4,-50;-437,52,384,' + '310,-368,-714,19,-852;-319,366,-254,110,-4,19,2,-241;-249,163,-718,-594,-50,-852,-241,8]', + '[-188,-684,-298,581,626,-102,640,-271;-684,-286,-288,6,563,375,-501,454;-298,-288,-904,-198,816,' + '454,-228,-953;581,6,-198,-901,369,393,169,-407;626,563,816,369,-598,53,-48,223;-102,375,454,393,53,' + '-426,-349,3;640,-501,-228,169,-48,-349,-775,91;-271,454,-953,-407,223,3,91,469]', + '[-406,180,601,-134,-338,-95,63,-351;180,932,-550,469,-303,-40,61,657;601,-550,-144,32,-116,-137,' + '-494,-200;-134,469,32,-249,-351,-722,47,-786;-338,-303,-116,-351,811,238,108,-360;-95,-40,-137,' + '-722,238,905,-138,729;63,61,-494,47,108,-138,-307,-188;-351,657,-200,-786,-360,729,-188,-372]', + '[-301,-656,-404,122,-19,-420,519,32;-656,597,-843,358,-870,-408,-391,-86;-404,-843,489,47,384,-497,' + '260,-724;122,358,47,-27,-191,369,-31,261;-19,-870,384,-191,-545,-383,-707,59;-420,-408,-497,369,' + '-383,-550,514,-45;519,-391,260,-31,-707,514,654,-187;32,-86,-724,261,59,-45,-187,-161]', + '[-353,-129,579,82,195,1,272,-273;-129,9,195,812,-184,51,440,82;579,195,-69,-472,-465,312,104,' + '111;82,812,-472,361,659,-204,267,-156;195,-184,-465,659,-714,62,401,868;1,51,312,-204,62,-976,-556,' + '-353;272,440,104,267,401,-556,-326,-96;-273,82,111,-156,868,-353,-96,-597]', + '[91,-161,609,247,729,447,479,-399;-161,209,-393,-128,-19,-315,465,436;609,-393,-513,321,366,186,' + '423,-297;247,-128,321,-119,124,636,-287,-577;729,-19,366,124,-71,335,552,-241;447,-315,186,636,335,' + '519,310,422;479,465,423,-287,552,310,775,366;-399,436,-297,-577,-241,422,366,-355]', + '[864,442,244,-155,-133,-41,-487,571;442,472,-683,-97,-649,-19,-485,-208;244,-683,-671,-128,-199,' + '-608,150,-536;-155,-97,-128,-925,85,167,-183,-527;-133,-649,-199,85,233,279,-334,135;-41,-19,-608,' + '167,279,69,-373,0;-487,-485,150,-183,-334,-373,-106,-426;571,-208,-536,-527,135,0,-426,523]', + '[-277,799,399,46,-158,-105,-472,-446;799,-725,-636,528,427,918,-580,-205;399,-636,340,250,-379,298,' + '78,-671;46,528,250,856,-187,-67,428,-623;-158,427,-379,-187,-784,-648,-372,-213;-105,918,298,-67,' + '-648,271,-176,126;-472,-580,78,428,-372,-176,-837,585;-446,-205,-671,-623,-213,126,585,-866]', + '[384,-598,-133,-338,148,490,-16,-371;-598,-995,648,-350,342,400,-125,32;-133,648,996,505,0,-19,486,' + '334;-338,-350,505,699,-188,238,-14,-539;148,342,0,-188,138,72,-665,-298;490,400,-19,238,72,-151,' + '484,656;-16,-125,486,-14,-665,484,781,90;-371,32,334,-539,-298,656,90,-913]', + '[92,-103,-494,-476,-657,645,189,167;-103,-454,650,198,-5,483,-364,151;-494,650,-948,373,-314,704,' + '-66,-189;-476,198,373,438,325,289,-566,-82;-657,-5,-314,325,52,-318,726,-194;645,483,704,289,-318,' + '22,-205,572;189,-364,-66,-566,726,-205,416,-656;167,151,-189,-82,-194,572,-656,48]', + '[256,-683,-311,472,475,156,8,-81;-683,-560,272,-892,197,-847,-241,-426;-311,272,-332,240,-20,-498,' + '-603,-791;472,-892,240,-68,-38,543,340,-54;475,197,-20,-38,-489,-220,526,-790;156,-847,-498,543,' + '-220,404,33,-444;8,-241,-603,340,526,33,855,-374;-81,-426,-791,-54,-790,-444,-374,-140]', + '[834,120,-67,-684,-158,287,-257,0;120,696,454,-382,221,298,-420,430;-67,454,-831,61,505,88,29,' + '-217;-684,-382,61,723,-59,907,-77,-198;-158,221,505,-59,-790,-96,-243,-44;287,298,88,907,-96,-375,' + '326,338;-257,-420,29,-77,-243,326,-742,542;0,430,-217,-198,-44,338,542,487]', + '[-73,376,-251,-591,142,88,-240,-553;376,392,-586,-685,-342,62,860,219;-251,-586,-980,358,-652,-34,' + '-337,-669;-591,-685,358,-594,66,-704,-283,-462;142,-342,-652,66,185,23,-832,-505;88,62,-34,-704,23,' + '-48,187,363;-240,860,-337,-283,-832,187,-309,-78;-553,219,-669,-462,-505,363,-78,-382]', + '[704,123,-420,-628,168,47,-187,-517;123,-936,335,460,-331,160,-13,300;-420,335,-344,653,525,-826,' + '-226,-89;-628,460,653,-237,111,633,256,44;168,-331,525,111,-218,-414,-423,103;47,160,-826,633,-414,' + '-976,254,455;-187,-13,-226,256,-423,254,726,-701;-517,300,-89,44,103,455,-701,118]', + '[74,-582,-710,287,45,-329,81,-158;-582,483,48,-32,-267,807,-673,-380;-710,48,657,667,-217,-765,-42,' + '921;287,-32,667,-183,-549,724,-303,-390;45,-267,-217,-549,960,295,-273,141;-329,807,-765,724,295,' + '-575,-576,-53;81,-673,-42,-303,-273,-576,-285,-94;-158,-380,921,-390,141,-53,-94,-403]', + '[-363,-189,12,113,-405,265,-209,-520;-189,-265,-291,-8,655,-267,803,235;12,-291,379,316,615,-94,78,' + '148;113,-8,316,804,764,533,-529,-432;-405,655,615,764,-433,-79,-430,-441;265,-267,-94,533,-79,147,' + '-8,-616;-209,803,78,-529,-430,-8,964,-121;-520,235,148,-432,-441,-616,-121,230]', + '[-715,-69,-734,299,-234,696,-106,718;-69,657,-278,445,109,408,-494,-33;-734,-278,447,31,-49,8,84,' + '356;299,445,31,-354,352,-757,34,672;-234,109,-49,352,-899,523,27,240;696,408,8,-757,523,-903,-324,' + '-774;-106,-494,84,34,27,-324,358,-217;718,-33,356,672,240,-774,-217,527]', + '[-583,-373,75,-445,158,99,-393,319;-373,-531,89,-168,206,-120,582,184;75,89,666,118,341,107,76,' + '-283;-445,-168,118,870,91,47,-477,-305;158,206,341,91,-961,84,77,-237;99,-120,107,47,84,647,-663,' + '81;-393,582,76,-477,77,-663,98,-171;319,184,-283,-305,-237,81,-171,128]', + '[-921,-483,442,-562,500,-511,-292,248;-483,-903,107,-330,515,-219,-111,3;442,107,-303,-132,-487,19,' + '564,830;-562,-330,-132,-18,235,-14,-436,354;500,515,-487,235,-836,97,-343,-125;-511,-219,19,-14,97,' + '811,-63,-162;-292,-111,564,-436,-343,-63,39,100;248,3,830,354,-125,-162,100,-238]', + '[429,75,-149,-102,567,-56,350,788;75,-27,-189,302,-275,-157,-136,319;-149,-189,475,-172,82,98,-54,' + '-680;-102,302,-172,192,288,249,728,-21;567,-275,82,288,421,-188,-834,-563;-56,-157,98,249,-188,989,' + '-245,661;350,-136,-54,728,-834,-245,716,-165;788,319,-680,-21,-563,661,-165,-625]', + '[771,-671,-414,135,-676,-505,-283,-540;-671,228,755,322,-429,-87,-218,-102;-414,755,678,120,-281,' + '-41,62,-28;135,322,120,-69,-160,158,73,-533;-676,-429,-281,-160,677,-133,-518,821;-505,-87,-41,158,' + '-133,-701,87,164;-283,-218,62,73,-518,87,-494,-727;-540,-102,-28,-533,821,164,-727,8]', + '[7,-57,-530,89,212,72,221,-397;-57,-984,-288,-134,-115,-237,16,-609;-530,-288,-355,-75,487,-208,' + '320,48;89,-134,-75,-20,-223,-303,-62,-119;212,-115,487,-223,-657,-306,248,-290;72,-237,-208,-303,' + '-306,375,-375,154;221,16,320,-62,248,-375,-568,-201;-397,-609,48,-119,-290,154,-201,-626]', + '[-320,-26,261,617,-684,-155,-3,-251;-26,-683,-415,890,596,106,194,-555;261,-415,-11,184,106,611,' + '159,-57;617,890,184,122,-552,755,644,-332;-684,596,106,-552,164,-389,-260,-35;-155,106,611,755,' + '-389,90,442,196;-3,194,159,644,-260,442,7,83;-251,-555,-57,-332,-35,196,83,-862]', + '[-115,-242,247,-150,-239,-13,340,-158;-242,889,-712,172,-772,48,37,172;247,-712,749,333,-221,-244,' + '-206,-474;-150,172,333,36,389,374,-73,-204;-239,-772,-221,389,599,-311,36,-293;-13,48,-244,374,' + '-311,-985,-43,-149;340,37,-206,-73,36,-43,-949,633;-158,172,-474,-204,-293,-149,633,-202]', + '[185,390,-301,-518,11,382,285,112;390,166,-418,66,-113,-163,-552,-874;-301,-418,-736,317,-216,713,' + '-36,-508;-518,66,317,-191,865,108,964,218;11,-113,-216,865,-994,-528,234,-54;382,-163,713,108,-528,' + '-481,509,742;285,-552,-36,964,234,509,-181,-354;112,-874,-508,218,-54,742,-354,606]', + '[225,-41,-323,-325,857,2,-111,852;-41,-296,-186,181,-1,77,-152,-513;-323,-186,-964,372,-599,-264,' + '24,-232;-325,181,372,-285,22,225,-502,-88;857,-1,-599,22,-500,354,352,114;2,77,-264,225,354,247,77,' + '-245;-111,-152,24,-502,352,77,823,272;852,-513,-232,-88,114,-245,272,-640]', + '[-882,182,-721,-2,708,658,-128,-405;182,-600,-779,-15,-33,-307,3,500;-721,-779,726,14,816,30,79,' + '-513;-2,-15,14,-937,-385,-212,106,-673;708,-33,816,-385,652,857,125,-490;658,-307,30,-212,857,327,' + '478,-519;-128,3,79,106,125,478,604,348;-405,500,-513,-673,-490,-519,348,-49]', + '[-247,279,-233,300,-596,536,107,119;279,-955,-57,-108,-312,-241,-470,-649;-233,-57,968,-576,-494,' + '160,-80,254;300,-108,-576,-275,258,-208,-187,-574;-596,-312,-494,258,312,301,262,202;536,-241,160,' + '-208,301,-13,-220,-389;107,-470,-80,-187,262,-220,292,412;119,-649,254,-574,202,-389,412,428]', + '[-992,-65,97,-390,110,-593,65,469;-65,849,100,813,302,-85,1,445;97,100,-914,841,-808,149,-604,' + '-588;-390,813,841,-444,-129,338,276,-397;110,302,-808,-129,672,316,-197,88;-593,-85,149,338,316,' + '350,-83,-642;65,1,-604,276,-197,-83,-872,249;469,445,-588,-397,88,-642,249,900]', + '[-518,-140,218,137,-57,-375,618,614;-140,-544,255,156,-208,424,45,-306;218,255,851,-169,-208,100,' + '432,-277;137,156,-169,276,-540,435,-567,591;-57,-208,-208,-540,-706,360,79,-168;-375,424,100,435,' + '360,-959,-542,39;618,45,432,-567,79,-542,243,-547;614,-306,-277,591,-168,39,-547,985]', + '[659,-3,124,177,-179,-29,764,-387;-3,-481,302,172,-11,23,30,-255;124,302,-722,255,-99,496,247,' + '-661;177,172,255,-551,584,364,27,83;-179,-11,-99,584,-849,-119,-627,91;-29,23,496,364,-119,-189,' + '195,-173;764,30,247,27,-627,195,-196,-547;-387,-255,-661,83,91,-173,-547,558]', + '[-467,572,-60,174,-365,155,-386,-903;572,-724,298,97,302,-434,-77,173;-60,298,-941,-511,178,212,' + '434,191;174,97,-511,-928,831,-352,584,114;-365,302,178,831,-165,-25,-308,-87;155,-434,212,-352,-25,' + '-254,-314,-740;-386,-77,434,584,-308,-314,236,173;-903,173,191,114,-87,-740,173,-567]', + '[584,220,-533,423,173,214,-377,623;220,662,-31,912,-94,45,606,512;-533,-31,-451,-122,-411,65,393,' + '855;423,912,-122,-142,348,-541,449,368;173,-94,-411,348,934,376,213,-579;214,45,65,-541,376,700,' + '116,432;-377,606,393,449,213,116,-404,-43;623,512,855,368,-579,432,-43,-804]', + '[542,64,-578,858,-678,-686,373,-98;64,314,-421,610,-603,-73,414,-411;-578,-421,-644,-311,-172,136,' + '198,-320;858,610,-311,639,941,-22,142,397;-678,-603,-172,941,-831,304,-262,-155;-686,-73,136,-22,' + '304,463,-216,-88;373,414,198,142,-262,-216,236,-381;-98,-411,-320,397,-155,-88,-381,-264]', + '[773,-819,-786,105,-88,-614,-700,-859;-819,-558,-403,725,-163,-168,-124,-35;-786,-403,-618,-257,' + '-685,369,357,471;105,725,-257,430,-530,473,-178,347;-88,-163,-685,-530,-794,197,144,708;-614,-168,' + '369,473,197,-255,282,237;-700,-124,357,-178,144,282,757,451;-859,-35,471,347,708,237,451,134]', + '[-829,21,-560,-575,193,-236,-375,-315;21,-125,31,-537,-127,-577,-390,-607;-560,31,801,-352,13,-126,' + '-42,169;-575,-537,-352,509,231,25,-174,122;193,-127,13,231,201,550,134,419;-236,-577,-126,25,550,' + '-591,-149,-534;-375,-390,-42,-174,134,-149,-158,-290;-315,-607,169,122,419,-534,-290,412]', + '[311,371,379,404,213,474,314,-104;371,683,-450,107,66,-27,35,37;379,-450,-232,17,-94,115,603,' + '-1;404,107,17,-500,768,634,-765,14;213,66,-94,768,-80,62,-318,-243;474,-27,115,634,62,486,-331,' + '594;314,35,603,-765,-318,-331,910,-389;-104,37,-1,14,-243,594,-389,-788]', + '[-796,156,607,220,-460,23,-736,-365;156,620,-547,-507,-226,418,40,-217;607,-547,-238,283,-676,-375,' + '77,263;220,-507,283,-262,-30,46,130,-325;-460,-226,-676,-30,-83,7,434,-307;23,418,-375,46,7,-664,' + '756,-274;-736,40,77,130,434,756,601,65;-365,-217,263,-325,-307,-274,65,867]', + '[332,-160,-560,30,-455,505,-16,-30;-160,227,293,157,-68,-201,-32,341;-560,293,-676,682,392,85,60,' + '385;30,157,682,350,585,-1,-314,-117;-455,-68,392,585,571,224,-112,720;505,-201,85,-1,224,-69,-83,' + '-237;-16,-32,60,-314,-112,-83,-20,333;-30,341,385,-117,720,-237,333,-638]', + '[-257,400,-726,473,104,-420,-104,-332;400,-219,-591,389,-249,-163,230,-100;-726,-591,-491,-311,' + '-280,605,-699,89;473,389,-311,-729,203,-358,451,-77;104,-249,-280,203,-113,-682,544,330;-420,-163,' + '605,-358,-682,551,609,-65;-104,230,-699,451,544,609,921,-452;-332,-100,89,-77,330,-65,-452,575]', + '[-172,-171,-32,549,-113,328,-33,-219;-171,-630,843,-273,-135,-17,-395,-30;-32,843,-249,-309,50,' + '-250,481,525;549,-273,-309,-945,521,766,134,488;-113,-135,50,521,808,-341,311,485;328,-17,-250,766,' + '-341,-684,846,-132;-33,-395,481,134,311,846,-536,-541;-219,-30,525,488,485,-132,-541,-235]', + '[-7,-168,267,44,525,215,739,74;-168,-792,105,575,643,-374,-272,613;267,105,911,841,-72,316,-390,' + '-109;44,575,841,-348,142,53,-49,-176;525,643,-72,142,369,463,269,-86;215,-374,316,53,463,-217,197,' + '-37;739,-272,-390,-49,269,197,-922,32;74,613,-109,-176,-86,-37,32,595]', + '[-211,856,-146,-570,-229,-636,-109,282;856,-94,-63,409,-620,234,498,641;-146,-63,134,90,533,93,156,' + '-454;-570,409,90,-568,-617,-89,33,-511;-229,-620,533,-617,396,-278,526,-220;-636,234,93,-89,-278,' + '456,-308,700;-109,498,156,33,526,-308,-456,-540;282,641,-454,-511,-220,700,-540,-886]', + '[143,-192,-28,-357,370,50,359,143;-192,-232,729,-314,767,55,108,-599;-28,729,-278,12,-316,803,-842,' + '869;-357,-314,12,-420,552,-467,634,388;370,767,-316,552,-500,-42,212,-277;50,55,803,-467,-42,392,' + '885,98;359,108,-842,634,212,885,-183,-117;143,-599,869,388,-277,98,-117,938]', + '[-801,780,-373,306,688,-182,573,-120;780,-749,424,-128,-456,584,116,-312;-373,424,-407,-389,-408,' + '153,-533,48;306,-128,-389,571,-142,687,-170,-137;688,-456,-408,-142,17,-236,-234,507;-182,584,153,' + '687,-236,-819,-447,865;573,116,-533,-170,-234,-447,-451,-411;-120,-312,48,-137,507,865,-411,459]', + '[-157,-171,263,17,-728,-193,762,257;-171,-413,-239,-868,431,364,-566,-172;263,-239,-37,-585,311,' + '362,-186,715;17,-868,-585,797,-416,-674,138,-520;-728,431,311,-416,-918,-227,-483,483;-193,364,362,' + '-674,-227,-581,-508,923;762,-566,-186,138,-483,-508,42,-343;257,-172,715,-520,483,923,-343,-720]', + '[367,329,361,-44,320,-128,349,580;329,-827,370,37,412,-234,358,399;361,370,-232,231,-103,-208,778,' + '-174;-44,37,231,471,-605,450,-70,-310;320,412,-103,-605,416,229,143,-225;-128,-234,-208,450,229,' + '-617,561,771;349,358,778,-70,143,561,-742,6;580,399,-174,-310,-225,771,6,-852]', + '[-229,-391,772,601,-348,-207,312,952;-391,-368,-245,265,170,252,694,109;772,-245,893,-441,156,235,' + '-210,-620;601,265,-441,838,585,-262,753,-32;-348,170,156,585,465,476,-52,-421;-207,252,235,-262,' + '476,986,-370,-203;312,694,-210,753,-52,-370,-897,521;952,109,-620,-32,-421,-203,521,506]', + '[-895,-403,690,-490,130,-670,-27,837;-403,-392,384,-401,932,195,-213,-813;690,384,658,205,448,-825,' + '182,-445;-490,-401,205,-742,-179,-657,-368,36;130,932,448,-179,-606,717,-29,176;-670,195,-825,-657,' + '717,-861,271,-35;-27,-213,182,-368,-29,271,541,369;837,-813,-445,36,176,-35,369,-628]', + '[-208,-129,8,142,-466,103,11,-558;-129,136,84,631,198,715,-292,-724;8,84,-917,-178,-648,-243,868,' + '-444;142,631,-178,-893,-614,792,146,-291;-466,198,-648,-614,22,83,-180,245;103,715,-243,792,83,' + '-465,22,413;11,-292,868,146,-180,22,-818,895;-558,-724,-444,-291,245,413,895,617]', + '[-749,13,400,364,-214,-750,632,-364;13,-929,664,398,-182,30,80,115;400,664,-703,58,84,472,-419,' + '-60;364,398,58,-487,162,-686,-466,-577;-214,-182,84,162,138,504,674,759;-750,30,472,-686,504,439,' + '770,311;632,80,-419,-466,674,770,859,393;-364,115,-60,-577,759,311,393,787]', + '[-780,366,-190,-207,963,-465,-393,-877;366,-624,-844,-177,571,-282,-3,430;-190,-844,-927,753,440,' + '-517,-286,378;-207,-177,753,-189,540,-9,322,889;963,571,440,540,-286,141,272,219;-465,-282,-517,-9,' + '141,411,268,-27;-393,-3,-286,322,272,268,-738,-192;-877,430,378,889,219,-27,-192,462]', + '[-969,275,-875,-677,-65,29,-457,281;275,-833,262,116,-111,-162,-803,262;-875,262,773,56,-424,277,' + '613,-156;-677,116,56,-825,187,-17,-92,-595;-65,-111,-424,187,401,49,-206,235;29,-162,277,-17,49,4,' + '-2,-491;-457,-803,613,-92,-206,-2,87,-117;281,262,-156,-595,235,-491,-117,746]', + '[662,-401,-344,169,-494,-266,58,-462;-401,282,-394,-578,583,-777,129,-408;-344,-394,130,-422,-675,' + '-224,-202,844;169,-578,-422,-772,46,-336,285,193;-494,583,-675,46,257,519,-626,361;-266,-777,-224,' + '-336,519,-710,-395,-567;58,129,-202,285,-626,-395,197,-529;-462,-408,844,193,361,-567,-529,825]', + '[771,-245,-364,456,818,466,-355,418;-245,683,63,841,-615,-647,-229,-571;-364,63,-904,-357,-173,248,' + '-72,-122;456,841,-357,551,-822,-150,-466,-277;818,-615,-173,-822,26,-44,590,-105;466,-647,248,-150,' + '-44,697,-201,462;-355,-229,-72,-466,590,-201,200,-273;418,-571,-122,-277,-105,462,-273,-389]', + '[965,-217,305,-118,-647,45,-167,309;-217,400,-58,-466,871,47,24,-351;305,-58,600,440,81,-628,392,' + '-551;-118,-466,440,821,30,408,-66,334;-647,871,81,30,372,-576,599,-252;45,47,-628,408,-576,-48,120,' + '-643;-167,24,392,-66,599,120,376,-424;309,-351,-551,334,-252,-643,-424,353]', + '[-551,-129,218,172,224,294,-114,759;-129,786,-11,-40,-258,-180,216,-302;218,-11,-593,339,-345,464,' + '297,-39;172,-40,339,918,403,-652,524,-436;224,-258,-345,403,304,-88,731,-248;294,-180,464,-652,-88,' + '-967,180,-17;-114,216,297,524,731,180,-709,369;759,-302,-39,-436,-248,-17,369,671]', + '[751,511,288,32,-487,-406,560,-452;511,694,174,-578,-261,78,740,-114;288,174,-655,-159,93,-592,171,' + '-450;32,-578,-159,-300,-98,-871,-337,414;-487,-261,93,-98,-360,130,114,734;-406,78,-592,-871,130,' + '-107,-67,-138;560,740,171,-337,114,-67,-524,-192;-452,-114,-450,414,734,-138,-192,-172]', + '[-409,-70,-354,16,302,674,-392,37;-70,812,-82,-106,-660,443,52,-681;-354,-82,-971,-380,676,0,78,' + '-649;16,-106,-380,209,826,238,-415,-588;302,-660,676,826,691,-912,-414,392;674,443,0,238,-912,271,' + '-704,-648;-392,52,78,-415,-414,-704,-564,238;37,-681,-649,-588,392,-648,238,143]', + '[49,-361,-254,183,596,77,-489,223;-361,690,-97,731,-794,321,218,-377;-254,-97,-213,-178,50,-583,' + '-87,-61;183,731,-178,-75,478,-828,194,635;596,-794,50,478,443,-66,-569,482;77,321,-583,-828,-66,' + '-710,-145,152;-489,218,-87,194,-569,-145,-186,76;223,-377,-61,635,482,152,76,280]', + '[12,-62,256,-318,-301,163,517,676;-62,140,-179,192,722,422,-51,460;256,-179,865,256,-222,223,512,' + '-360;-318,192,256,-693,-478,-147,-717,-12;-301,722,-222,-478,356,-483,-401,58;163,422,223,-147,' + '-483,615,-348,208;517,-51,512,-717,-401,-348,-94,658;676,460,-360,-12,58,208,658,774]', + '[-482,-99,101,290,699,779,444,4;-99,-530,-619,805,-731,303,494,432;101,-619,35,-658,283,-201,776,' + '133;290,805,-658,149,-429,40,117,-153;699,-731,283,-429,501,-178,-100,457;779,303,-201,40,-178,795,' + '7,151;444,494,776,117,-100,7,790,-32;4,432,133,-153,457,151,-32,450]', + '[-102,-121,606,747,-445,650,-248,-322;-121,-324,623,449,-222,79,-5,284;606,623,638,-378,-312,306,' + '-624,223;747,449,-378,426,317,-322,-254,789;-445,-222,-312,317,80,-69,-729,-560;650,79,306,-322,' + '-69,-4,19,290;-248,-5,-624,-254,-729,19,-786,717;-322,284,223,789,-560,290,717,536]', + '[769,728,83,-893,-123,303,-727,73;728,2,44,-400,-118,-698,-106,462;83,44,611,395,-65,253,-311,' + '-104;-893,-400,395,-888,-445,221,-342,454;-123,-118,-65,-445,-498,-643,-461,396;303,-698,253,221,' + '-643,-309,-84,-275;-727,-106,-311,-342,-461,-84,-77,-83;73,462,-104,454,396,-275,-83,-915]', + '[-264,-34,-773,-380,-165,-238,-451,233;-34,411,276,-418,-599,-411,-329,-122;-773,276,-527,-522,' + '-863,-540,-534,-267;-380,-418,-522,-922,143,-219,-640,719;-165,-599,-863,143,-8,-426,-780,688;-238,' + '-411,-540,-219,-426,956,578,525;-451,-329,-534,-640,-780,578,-482,611;233,-122,-267,719,688,525,' + '611,-91]', + '[-727,-204,-407,561,715,523,97,403;-204,321,6,-311,-835,-57,-320,-651;-407,6,-734,328,-513,-315,' + '-684,467;561,-311,328,472,389,-406,158,144;715,-835,-513,389,-670,293,-288,243;523,-57,-315,-406,' + '293,-126,-424,3;97,-320,-684,158,-288,-424,-20,-409;403,-651,467,144,243,3,-409,-404]', + '[585,-649,-20,-788,-492,233,-3,-459;-649,592,-444,-52,108,-208,60,-471;-20,-444,-670,-284,112,-614,' + '437,-51;-788,-52,-284,-851,-380,-418,-83,313;-492,108,112,-380,659,484,-148,-851;233,-208,-614,' + '-418,484,-878,-229,-51;-3,60,437,-83,-148,-229,856,-48;-459,-471,-51,313,-851,-51,-48,-736]', + '[-632,792,-88,-409,-516,253,57,7;792,-950,26,-138,-687,-384,-321,221;-88,26,395,-111,124,78,-866,' + '9;-409,-138,-111,485,-381,-61,-227,-21;-516,-687,124,-381,-621,-608,-847,-447;253,-384,78,-61,-608,' + '-807,-31,289;57,-321,-866,-227,-847,-31,-293,1;7,221,9,-21,-447,289,1,537]', + '[-809,-182,-507,-173,66,-252,384,362;-182,973,76,-203,132,-386,-237,-167;-507,76,768,580,-290,-558,' + '479,-341;-173,-203,580,561,346,469,-259,55;66,132,-290,346,-992,-268,-890,-687;-252,-386,-558,469,' + '-268,770,382,-15;384,-237,479,-259,-890,382,735,-448;362,-167,-341,55,-687,-15,-448,-161]', + '[862,-108,755,-38,-596,137,-448,-350;-108,763,-551,-180,-255,-748,-630,298;755,-551,543,495,442,' + '833,91,-214;-38,-180,495,24,-157,-970,-101,-680;-596,-255,442,-157,468,-23,830,-133;137,-748,833,' + '-970,-23,-377,-425,67;-448,-630,91,-101,830,-425,-360,-172;-350,298,-214,-680,-133,67,-172,-555]', + '[445,-67,205,766,-107,-244,645,-225;-67,-335,16,578,-516,561,37,159;205,16,566,-155,79,35,336,' + '12;766,578,-155,-980,-589,-244,278,-707;-107,-516,79,-589,604,149,-175,487;-244,561,35,-244,149,' + '996,333,-445;645,37,336,278,-175,333,552,167;-225,159,12,-707,487,-445,167,-196]', + '[719,465,663,-460,488,254,289,543;465,696,-397,462,-45,-60,-52,-414;663,-397,-498,-795,-1,85,-641,' + '542;-460,462,-795,448,149,-162,-191,103;488,-45,-1,149,846,-310,151,-451;254,-60,85,-162,-310,-209,' + '329,-401;289,-52,-641,-191,151,329,523,-535;543,-414,542,103,-451,-401,-535,-482]', + '[686,168,490,158,-28,-255,-603,-335;168,81,80,586,-518,-173,-347,-52;490,80,681,-523,-47,726,175,' + '-173;158,586,-523,-623,633,-510,-341,240;-28,-518,-47,633,-244,6,163,680;-255,-173,726,-510,6,-38,' + '-308,536;-603,-347,175,-341,163,-308,373,-285;-335,-52,-173,240,680,536,-285,928]', + '[-645,493,252,544,490,-55,678,489;493,300,175,264,592,-118,-149,162;252,175,506,-71,-783,476,-311,' + '-383;544,264,-71,807,15,310,5,-54;490,592,-783,15,-208,-24,24,602;-55,-118,476,310,-24,-661,-438,' + '622;678,-149,-311,5,24,-438,-191,-717;489,162,-383,-54,602,622,-717,633]', + '[-649,492,-617,-501,436,492,68,420;492,-527,158,451,-751,-511,-27,362;-617,158,47,-742,287,-440,' + '-207,-633;-501,451,-742,60,3,591,-272,576;436,-751,287,3,987,171,-341,216;492,-511,-440,591,171,' + '754,-589,72;68,-27,-207,-272,-341,-589,-457,-540;420,362,-633,576,216,72,-540,-671]', + '[-987,-794,-212,262,437,361,75,10;-794,-864,54,258,-749,196,-740,559;-212,54,-981,347,117,-94,-148,' + '270;262,258,347,-102,186,251,-199,617;437,-749,117,186,308,-212,244,-56;361,196,-94,251,-212,630,' + '404,-369;75,-740,-148,-199,244,404,-236,-387;10,559,270,617,-56,-369,-387,216]', + '[460,-64,-595,-579,468,780,626,353;-64,-439,223,-29,-324,286,748,-228;-595,223,727,867,481,106,670,' + '90;-579,-29,867,120,-139,-151,35,144;468,-324,481,-139,-673,229,347,552;780,286,106,-151,229,319,' + '273,210;626,748,670,35,347,273,646,-330;353,-228,90,144,552,210,-330,-173]']] + + res = ['[2, 42762409]', '[3, 3617]', '[4, 5]', '[5, 43]', '[6, 31]', '[9, 5]', '[11, 7]', '[12, 3]', + '[13, 17]', '[14, 19]', '[15, 73]', '[16, 79]', '[17, 38287]', '[18, 3774601]', '[19, 7]', + '[20, 3]', '[21, 61]', '[22, 3]', '[23, 229]', '[24, 7]', '[25, 3]', '[27, 68196433]', + '[28, 2393]', '[29, 13]', '[30, 145963897]', '[31, 71]', '[33, 433]', '[34, 3]', '[35, 409]', + '[36, 3]', '[37, -1]', '[38, 11483]', '[41, 11]', '[44, -1]', '[45, 281]', '[46, 4363]', + '[47, -1]', '[48, 7]', '[49, 41]', '[52, 5965507]', '[53, 13]', '[56, 135319]', '[57, 2473301]', + '[58, 141613]', '[59, -1]', '[60, 109]', '[61, 3]', '[62, -1]', '[65, 5]', '[66, 13]', '[67, 11]', + '[68, 271]', '[69, 7]', '[70, 642419]', '[73, 29]', '[74, 1951]', '[76, 3]', '[77, -1]', '[78, 107]', + '[79, -1]', '[80, 48199741]', '[81, 89]', '[82, 11]', '[83, 157]', '[84, 197]', '[85, 5]', '[86, -1]', + '[87, -1]', '[88, 11]', '[89, 29]', '[90, 7]', '[91, -1]', '[92, 3]', '[93, 17]', '[94, 7]', + '[95, 3]', '[98, 31]', '[99, 19]', '[20, 2]', '[71, 2]', '[81, 2]', '[96, 2]', '[100, 2]'] + + def test(deb=0, fin=6): + k=0 + for i in range(deb, fin): + for j in range(0, 100): + Q = M[i][j]; + s = pari.qfsolve(Q); + if pari.type(s) == '"t_INT"': + self.assertEquals('[%d, %s]' % (j + 1, str(s)), res[k]) + k += 1 + test() + + G = '[1,0,0;0,1,0;0,0,-34]'; + self.assertEquals(pari.qfparam(G, pari.qfsolve(G)), '[-3, -10, 3; 5, -6, -5; -1, 0, -1]') + self.assertEquals(pari.qfparam(G, pari.qfsolve(G), 1), '[-3, 2, 11; 5, -26, 27; -1, 4, -5]') + self.assertEquals(pari.qfparam(G, pari.qfsolve(G), 2), '[-3, -16, -10; 5, 4, -6; -1, -2, -2]') + + self.assertEquals(pari.qfsolve(pari.Mat(0)), '[1]~') + self.assertEquals(pari.qfsolve(pari.Mat(1)), '-1') + self.assertEquals(pari.qfsolve('[1,2;2,1]'), '-2') + self.assertEquals(pari.qfsolve('[0,1;1,1]'), '[1, 0]~') + self.assertEquals(pari.qfsolve('[35, 46; 46, 60]'), '[-42, 35]~') + + self.assertEquals(pari.qfparam(pari.matdiagonal([1, 1, -1]), [1, 0, 1]), '[-1, 0, 1; 0, 2, 0; 1, 0, 1]') + self.assertEquals(pari.qfsolve(pari.matdiagonal([1, 1, -25])), '[0, 5, -1]~') + + self.assertEquals(pari.qfsolve('[1,0,0;0,3,0;0,0,-2]'), '3') + self.assertEquals(pari.qfparam('[0,0,-12;0,-12,0;-12,0,-1]', '[1,0,0]~', 3), '[-12, 0, -1; 0, 24, 0; 0, 0, 24]') + q = '[-1,-4,-8;-4,-15,-31;-8,-31,-62]/4'; + self.assertEquals(pari.qfparam(q, pari.qfsolve(q)), '[310, -62, 3; -62, 16, -1; -18, 2, 0]') + + # #1661 + with self.assertRaises(PariError) as context: + pari.qfsolve('[1,0,0;0,1,1;0,0,1]'); + self.assertTrue('incorrect type in qfsolve [not symmetric] (t_MAT)' in str(context.exception)) + + # #1725 + self.assertEquals(pari.qfsolve(pari.matdiagonal([1, 1, 1, 1, 1, 1, -7])), '[1, 1, -1, -2, 0, 0, -1]~') + +"""**** Original expected results **** + +dim=3 +[2, 42762409] +[3, 3617] +[4, 5] +[5, 43] +[6, 31] +[9, 5] +[11, 7] +[12, 3] +[13, 17] +[14, 19] +[15, 73] +[16, 79] +[17, 38287] +[18, 3774601] +[19, 7] +[20, 3] +[21, 61] +[22, 3] +[23, 229] +[24, 7] +[25, 3] +[27, 68196433] +[28, 2393] +[29, 13] +[30, 145963897] +[31, 71] +[33, 433] +[34, 3] +[35, 409] +[36, 3] +[37, -1] +[38, 11483] +[41, 11] +[44, -1] +[45, 281] +[46, 4363] +[47, -1] +[48, 7] +[49, 41] +[52, 5965507] +[53, 13] +[56, 135319] +[57, 2473301] +[58, 141613] +[59, -1] +[60, 109] +[61, 3] +[62, -1] +[65, 5] +[66, 13] +[67, 11] +[68, 271] +[69, 7] +[70, 642419] +[73, 29] +[74, 1951] +[76, 3] +[77, -1] +[78, 107] +[79, -1] +[80, 48199741] +[81, 89] +[82, 11] +[83, 157] +[84, 197] +[85, 5] +[86, -1] +[87, -1] +[88, 11] +[89, 29] +[90, 7] +[91, -1] +[92, 3] +[93, 17] +[94, 7] +[95, 3] +[98, 31] +[99, 19] +dim=4 +[20, 2] +[71, 2] +[81, 2] +[96, 2] +[100, 2] +dim=5 +dim=6 +dim=7 +dim=8 + +[-3 -10 3] + +[ 5 -6 -5] + +[-1 0 -1] + + +[-3 2 11] + +[ 5 -26 27] + +[-1 4 -5] + + +[-3 -16 -10] + +[ 5 4 -6] + +[-1 -2 -2] + +[1]~ +-1 +-2 +[1, 0]~ +[-42, 35]~ + +[-1 0 1] + +[ 0 2 0] + +[ 1 0 1] + +[0, 5, -1]~ +3 + +[-12 0 -1] + +[ 0 24 0] + +[ 0 0 24] + + +[310 -62 3] + +[-62 16 -1] + +[-18 2 0] + + *** at top-level: qfsolve([1,0,0;0,1,1 + *** ^-------------------- + *** qfsolve: incorrect type in qfsolve [not symmetric] (t_MAT). +[1, 1, -1, -2, 0, 0, -1]~ + +""" diff --git a/tests/unittests/quadray.py b/tests/unittests/quadray.py new file mode 100644 index 0000000..2a02632 --- /dev/null +++ b/tests/unittests/quadray.py @@ -0,0 +1,2219 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file quadray : +default(realprecision,38); +\\ all quad imaginary whose class group has exponent 2 +v=[-15,-35,-51,-91,-115,-123,-187,-195,-235,-267,-403,-427,-435,-483,-555,-595,-627,-715,-795,-1155,-1435,-1995, +-3003,-3315,-20,-24,-40,-52,-84,-88,-120,-132,-148,-168,-228,-232,-280,-312,-340,-372,-408,-420,-520,-532,-660,-708, +-760,-840,-1012,-1092,-1320,-1380,-1428,-1540,-1848,-5460]; +for(i=1, #v, print(v[i]": "quadhilbert(v[i]))) + +quadhilbert(-4036) +quadhilbert(-300003) +quadhilbert(-3628843) + +Q(D,f) = lift(quadray(D,f)); +Q(-4,31) +Q(-11,2) +Q(-15,3) +Q(-179,2) +Q(-2276,2) +Q(-251,2) +Q(-35,2) +Q(-4,31) +Q(-51,3) +Q(8-48*3,2) +Q(1-48*3,3) +Q(1-48*3,4) +Q(40-48*3,6) +Q(-7,7) + +K = bnfinit(y^2+5); +P5=idealprimedec(K,5)[1]; +Q(K,P5) + +K = bnfinit(y^2+5*12); +P2=idealprimedec(K,2)[1]; +P5=idealprimedec(K,5)[1]; +Q(K,idealmul(K,P2,P5)) + +\\#1633 +quadray(-11,3) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestQuadray(unittest.TestCase): + + def setUp(self): + pari.set_real_precision(38) + + def tearDown(self): + pari.set_real_precision(15) + + def test_quadhilbert(self): + # all quad imaginary whose class group has exponent 2 + v = [-15, -35, -51, -91, -115, -123, -187, -195, -235, -267, -403, -427, -435, -483, -555, -595, -627, -715, + -795, -1155, -1435, -1995, -3003, -3315, -20, -24, -40, -52, -84, -88, -120, -132, -148, -168, -228, -232, + -280, -312, -340, -372, -408, -420, -520, -532, -660, -708, -760, -840, -1012, -1092, -1320, -1380, -1428, + -1540, -1848, -5460]; + + res = ['-15: x^2 - x + 1', '-35: x^2 - x - 1', '-51: x^2 - x + 1', '-91: x^2 - x + 2', '-115: x^2 - x - 1', + '-123: x^2 - x + 1', '-187: x^2 - x + 3', '-195: x^4 - x^3 + 2*x^2 + x + 1', '-235: x^2 - x - 1', + '-267: x^2 - x + 1', '-403: x^2 - x - 3', '-427: x^2 - x + 2', '-435: x^4 - x^3 + 2*x^2 + x + 1', + '-483: x^4 - x^3 - x^2 - 2*x + 4', '-555: x^4 - x^3 + 2*x^2 + x + 1', + '-595: x^4 - x^3 + 5*x^2 + 2*x + 4', '-627: x^4 - x^3 - 2*x^2 - 3*x + 9', + '-715: x^4 - x^3 + 8*x^2 + 3*x + 9', '-795: x^4 - x^3 + 2*x^2 + x + 1', + '-1155: x^8 + 15*x^6 + 32*x^4 + 15*x^2 + 1', '-1435: x^4 - x^3 + 5*x^2 + 2*x + 4', + '-1995: x^8 + 15*x^6 + 32*x^4 + 15*x^2 + 1', '-3003: x^8 - 9*x^6 + 80*x^4 - 9*x^2 + 1', + '-3315: x^8 + 9*x^6 + 77*x^4 + 36*x^2 + 16', '-20: x^2 + 1', '-24: x^2 - 2', '-40: x^2 + 2', + '-52: x^2 + 1', '-84: x^4 - x^2 + 1', '-88: x^2 - 2', '-120: x^4 + 2*x^2 + 4', '-132: x^4 - x^2 + 1', + '-148: x^2 + 1', '-168: x^4 - 2*x^3 + x^2 + 6*x + 3', '-228: x^4 - x^2 + 1', '-232: x^2 + 2', + '-280: x^4 - 2*x^3 - 5*x^2 + 6*x - 1', '-312: x^4 + 2*x^2 + 4', '-340: x^4 + 3*x^2 + 1', + '-372: x^4 - x^2 + 1', '-408: x^4 + 2*x^2 + 4', '-420: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1', + '-520: x^4 + 6*x^2 + 4', '-532: x^4 - 3*x^2 + 4', '-660: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1', + '-708: x^4 - x^2 + 1', '-760: x^4 - 2*x^3 - 5*x^2 + 6*x - 1', + '-840: x^8 - 4*x^7 - 2*x^6 + 20*x^5 - 3*x^4 - 32*x^3 + 64*x^2 - 44*x + 19', '-1012: x^4 - 5*x^2 + 9', + '-1092: x^8 + 3*x^6 + 5*x^4 + 12*x^2 + 16', + '-1320: x^8 - 4*x^7 - 2*x^6 + 20*x^5 - 3*x^4 - 32*x^3 + 64*x^2 - 44*x + 19', + '-1380: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1', '-1428: x^8 + 3*x^6 + 5*x^4 + 12*x^2 + 16', + '-1540: x^8 - 4*x^7 + 20*x^6 - 46*x^5 + 93*x^4 - 114*x^3 + 92*x^2 - 42*x + 9', + '-1848: x^8 - 2*x^7 + 3*x^6 - 14*x^5 + 65*x^4 - 64*x^3 + 46*x^2 + 24*x + 4', + '-5460: x^16 + 9*x^14 + 44*x^12 + 261*x^10 + 1029*x^8 + 1044*x^6 + 704*x^4 + 576*x^2 + 256'] + + for i in range(0, len(v)): + self.assertEquals("%d: %s" % (v[i], str(pari.quadhilbert(v[i]))), res[i]) + + self.assertEquals(pari.quadhilbert(-4036), + 'x^20 + 27*x^19 + 601*x^18 - 4014*x^17 + 9878*x^16 - 12222*x^15 + 8299*x^14 + 513*x^13 - ' + '12221*x^12 + 18036*x^11 - 17652*x^10 + 18036*x^9 - 12221*x^8 + 513*x^7 + 8299*x^6 - ' + '12222*x^5 + 9878*x^4 - 4014*x^3 + 601*x^2 + 27*x + 1') + self.assertEquals(pari.quadhilbert(-300003), + 'x^88 - 40020669926358941160*x^87 + 24818793423306608856949584839454391158484*x^86 - ' + '451973748435231895940407803697160552367624*x^85 + ' + '121004331374769746054948634032289469332999202*x^84 + ' + '10059034519705811655247252004833057160111397504*x^83 + ' + '351284965440856373689297063590147136894509846260*x^82 + ' + '7076787287183022340559185242964779073439110772112*x^81 + ' + '74248642221523801590984436783829317747047323123243*x^80 + ' + '30166690492982121753760926852522076770892257842640*x^79 - ' + '8503049963424563714394067134889147531482230019127096*x^78 - ' + '6465786499366041070602916523486769538280412443510592*x^77 + ' + '4215064044607823828889410160434091263108115351306399268*x^76 + ' + '119525498598846149476451596656291689313170011135603889064*x^75 + ' + '2071860433925692542602963337465946582420808944831769026648*x^74 + ' + '27044235010859245155886182817332705345839764731121161439752*x^73 + ' + '285289444253762620585561596576563633155859094294552566693317*x^72 + ' + '2511360320483460798105377398519192324398612242438706127652544*x^71 + ' + '18767162620094934148004508464072766541604227783326918296860524*x^70 + ' + '120423236654140529086575067911655764408706511359484732574173280*x^69 + ' + '669881737151097381424117880193907743151768744395737304965311638*x^68 + ' + '3260304883724581257592451461949148632593587481718123636435123040*x^67 + ' + '14012181744323597034445628272252822116949974099153581386829916444*x^66 + ' + '53675674441854876609489208131197694348596313231643993076280314304*x^65 + ' + '184958607344821493362485971605260396892443743494472396759635803315*x^64 + ' + '578456213592452525292885126678569328965911834184953238551507495512*x^63 + ' + '1655681703347654445227821014576515450466671643615335188802513429760*x^62 + ' + '4368788406187872397696253062497812500894047454768846457782824580152*x^61 + ' + '10689014728609577470291601910791767817886254017900185293235705392064*x^60 + ' + '24343515731554312300763001600607496079487124511808873652848483412160*x^59 + ' + '51692913516558114572724264591367158576380942435990299052219843612304*x^58 + ' + '102299833075028113525891123945574251052215437006684583051817380710576*x^57 + ' + '188216797464058241448403558395102741401235865324690992824034126437157*x^56 + ' + '320604903257057655562250252261154391117300969466803557524988405580272*x^55 + ' + '502625712033018630870239698213303008551061011852403188260952091908532*x^54 + ' + '719344126023656757735145641575616692987264009491520118662670217955328*x^53 + ' + '928638160219283330700409020325566534550048821651703177989079236808666*x^52 + ' + '1060255920795694954480037612092276836813066528658822564102146651872808*x^51 + ' + '1030158921568551185533700012926850740762293883499745887488519869745108*x^50 + ' + '771562428494427189300153767022260995609490878443644218508155682351496*x^49 + ' + '273465978073331113489250648988966144580871198921998690911757680224167*x^48 - ' + '392300511978594197023702549831167038133623220261146198494006317061248*x^47 - ' + '1075315660772763567397744183394797701786847214693166357365831146616968*x^46 - ' + '1589451619928021606930471659130946568147974811578111348229080651241920*x^45 - ' + '1780728558455357793403089789263493950243261264268279117584476244784076*x^44 - ' + '1589451619928021606930471659130946568147974811578111348229080651241920*x^43 - ' + '1075315660772763567397744183394797701786847214693166357365831146616968*x^42 - ' + '392300511978594197023702549831167038133623220261146198494006317061248*x^41 + ' + '273465978073331113489250648988966144580871198921998690911757680224167*x^40 + ' + '771562428494427189300153767022260995609490878443644218508155682351496*x^39 + ' + '1030158921568551185533700012926850740762293883499745887488519869745108*x^38 + ' + '1060255920795694954480037612092276836813066528658822564102146651872808*x^37 + ' + '928638160219283330700409020325566534550048821651703177989079236808666*x^36 + ' + '719344126023656757735145641575616692987264009491520118662670217955328*x^35 + ' + '502625712033018630870239698213303008551061011852403188260952091908532*x^34 + ' + '320604903257057655562250252261154391117300969466803557524988405580272*x^33 + ' + '188216797464058241448403558395102741401235865324690992824034126437157*x^32 + ' + '102299833075028113525891123945574251052215437006684583051817380710576*x^31 + ' + '51692913516558114572724264591367158576380942435990299052219843612304*x^30 + ' + '24343515731554312300763001600607496079487124511808873652848483412160*x^29 + ' + '10689014728609577470291601910791767817886254017900185293235705392064*x^28 + ' + '4368788406187872397696253062497812500894047454768846457782824580152*x^27 + ' + '1655681703347654445227821014576515450466671643615335188802513429760*x^26 + ' + '578456213592452525292885126678569328965911834184953238551507495512*x^25 + ' + '184958607344821493362485971605260396892443743494472396759635803315*x^24 + ' + '53675674441854876609489208131197694348596313231643993076280314304*x^23 + ' + '14012181744323597034445628272252822116949974099153581386829916444*x^22 + ' + '3260304883724581257592451461949148632593587481718123636435123040*x^21 + ' + '669881737151097381424117880193907743151768744395737304965311638*x^20 + ' + '120423236654140529086575067911655764408706511359484732574173280*x^19 + ' + '18767162620094934148004508464072766541604227783326918296860524*x^18 + ' + '2511360320483460798105377398519192324398612242438706127652544*x^17 + ' + '285289444253762620585561596576563633155859094294552566693317*x^16 + ' + '27044235010859245155886182817332705345839764731121161439752*x^15 + ' + '2071860433925692542602963337465946582420808944831769026648*x^14 + ' + '119525498598846149476451596656291689313170011135603889064*x^13 + ' + '4215064044607823828889410160434091263108115351306399268*x^12 - ' + '6465786499366041070602916523486769538280412443510592*x^11 - ' + '8503049963424563714394067134889147531482230019127096*x^10 + ' + '30166690492982121753760926852522076770892257842640*x^9 + ' + '74248642221523801590984436783829317747047323123243*x^8 + ' + '7076787287183022340559185242964779073439110772112*x^7 + ' + '351284965440856373689297063590147136894509846260*x^6 + ' + '10059034519705811655247252004833057160111397504*x^5 + ' + '121004331374769746054948634032289469332999202*x^4 - ' + '451973748435231895940407803697160552367624*x^3 + ' + '24818793423306608856949584839454391158484*x^2 - 40020669926358941160*x + 1') + self.assertEquals(pari.quadhilbert(-3628843), + 'x^180 - 51943580593235209115083942712389400740668999369044471856895869572767632154790719' + + '027854950985687*x^179 + 2547067915519807589841747083394507454979001152704765378975382231' + + '0509943417124290253283094780925633779566003695241876256074642206756980781041312488539041' + + '15685519116107718359916443145223952387*x^178 + 85655320411540870157199561532055801425836' + + '8114267533599476048702248757890293199064738777403079498471755125850793975493242639458212' + + '28941841283820673569718022270291080598668993546776793532380154605306*x^177 + 76208050204' + + '9470459605610730457659988314295367866431312803463914686483313645385458348594743281778730' + + '9780316405557363093455779754923289560341458471739430940790778638046916838340664043983939' + + '99145427753183790*x^176 + 30895638763646696015321293816773247023116688803841722706690306' + + '4491469664464841619212321670236139534755552014956934619774127518218577390723469444090474' + + '70651675235147675440424833117756620892810879743135932320774*x^175 + 48840826629666655087' + + '6266596966764956978453838737444921031824468546499677022837850506165212536124471158220472' + + '9707795496142573176234783092771677458111505683044159569664292178132297884411168631004611' + + '840186992685967179*x^174 + 1240057512963777471437108925989820880369326742142684503704154' + + '2236588394867883751422682921563930587322023800866776334116548906703591687073852643697697' + + '71634896229758342146668333992396523446861599764973368284228647193399*x^173 + 77807342164' + + '2447925070552967910474570096831390766947550930281827860194252415153283906741350015821421' + + '7604880760978687846970230684361377176470035198102530788844464458277074023468487612291349' + + '8319164377230037354352780222249*x^172 - 266780829858115272388789250462200876445272313022' + + '9458822467054384295379499065005972497338635889603051515741573734931874924695776240830624' + + '574892617095865338408754338583352252844185648624921009766003486141241557823792412532*x^1' + + '71 + 14828387316468627026106844845255173547861518903858980498553897410830068279082086119' + + '1991101023068971076505863346789787263249012603070588113429175259599130772002329273816462' + + '4564498269365143236280388326494814603159167594322356*x^170 + 207271463025469452511301547' + + '0563866763470442289622005431908149562175074937534983815831470007001328441495857556306562' + + '9489929859046067396704298758192428085265010864076184580325469950195611900528695826173789' + + '8381117495750422003980*x^169 + 408279191365866825066950048755339668850856918564160819223' + + '9179402022231907134546562033748293990269539105395717958166111785640580545217576728755270' + + '122147606844109208571528880548539765523197876482624865506579220641586389147210551*x^168 ' + + '+ 25918908265304793393840999648343887547049043205616289992690167628330546413952017687984' + + '1374370584484171652371224698237130432347580881837999863417850984341421942163351457734024' + + '401203128996614247360365624068492442391061043753826375*x^167 + 1879533255028463945601845' + + '5766299939619922774191830896857155781644437858467387447729263235421421093239442057010359' + + '2891222145697906140096098002192358493430520998559970364061150923659276590113217049579865' + + '275822653265241753456459305677*x^166 - 9915213445331010597888861249891641758957210552260' + + '3788211580821293533752491951129117545101896722210096101308894624313777264446536224444928' + + '9299342835738733198847639642107862445603726950356560002044943147516502914989637844150139' + + '5456086*x^165 + 870693463207410936114722926699616258456056310070174066271951439226764821' + + '3754498248686363880077592953938815295745097173153881494887680426204688519814589792670887' + + '9854493196612672343274340176910775178567635481360192954408109761462192666*x^164 + 329126' + + '9524452623301119531480681600174871375032940729132937011163309205800336907034894612342659' + + '4086592059620504463833497832222752798945678653965532736640379616837610870910041078881143' + + '32138817034187287315453438080442501304279059153710266*x^163 - 48424697865100847085384804' + + '9302633937841710055009903257334888425404869825400256850368216570955809931099762277915963' + + '2947302543083592103973184476984040184063706178429518788857998006328077575074002632621344' + + '5261209232925320378956182578938287*x^162 + 236659655797827414747525596949802041692270215' + + '3951660811218931910650113398032807756856703811990539910072624737073791659677336884446347' + + '2189978353425224352092683872965220532855639893844358125373580233579396300331967493836532' + + '017339326648417*x^161 - 1786117002152727350652289985932216358955646217307235079098268964' + + '9038268799740362830643723969362443349590165531137151057640108919714216650854657781022747' + + '531810531359367179288752406620535700142801097476915172283884503644920276078920893715961*' + + 'x^160 + 54428865694162130728839491952070035616729751681833422007539166231352236561897735' + + '1536503454771579135051732246957859000664531476361357465221968827923591138659172463973059' + + '604218652821751160134239388400400287612441644522959559654240096950196384*x^159 - 1878459' + + '1944561923323443403812389538370992073242518317157665963817987346890603378811086853859511' + + '4584488231181453905560324154260960085054869261002833248663395080605671172589053299559751' + + '8093888779850319337022684143396368259434426190698508218580*x^158 - 184127686942437509991' + + '1682977301117955663562464265148547217904344728959181240974449884065092029207121963689896' + + '9097801966235466592457246648086083637230209961453625153292993135365454115585173733565794' + + '8991190630601809654864812836013412428233332508*x^157 + 627274533771428964278059773145144' + + '0214649776184728899306566105704002623998384634772568803482031749834965537790349722439019' + + '0783460776334008364647848917218509292774579507582801703470215614451182809842759120600950' + + '57054098527282956922223630676347544*x^156 - 13060449726788334974172743441897204816153610' + + '2040007979772040575444674674232960355098312210675279516213179933762412145661906540409844' + + '2047684342403483219640782130482104491066089970029539204229069505954201920366168890488132' + + '09519926849958791965413764*x^155 + 19392647894141536596820530391916502230151932745563014' + + '3663834027281436100078249122875790812671413557448312216090828906017332768865316251397616' + + '2542257999959114635645770848869066496229883200724281039999541182828857613242844117034223' + + '500903997780849964*x^154 - 2089740818515804351342583888534354748778120785097754268254968' + + '9561631642478447960323442191239518834708138540356262461766794170612666726815002322590819' + + '8816300820472000722481859827488891717051443056982529118511414369683957356587174149686533' + + '52018931248*x^153 + 16726466418820174491230008702941819854300761766363953593948968045530' + + '7948909314998339450215312030994224761215763294915115325960697513628674724029981734640823' + + '9753796627720037841404538619984615128342472905097168328653955912174273052746613900003371' + + '03156*x^152 - 11336714493365295420476716878286616778916616227898741966819659317216135015' + + '1363224665639827520548877905001507920274192410200096811676503284991805981968482979122155' + + '1667739765953276248859306767909175625527281202034750975189910458947747942582531447345892' + + '*x^151 + 9686019535728726397130721344019529061590234306774474243977568483913314292573821' + + '7830167297947427381690011105467748624943273307935251949965531278511638425579831074071240' + + '45733393614238847801073794953716312871037645627569348897599991117672316256550430096*x^15' + + '0 - 119041422102704367724958867098457501357876959518771350903901250601788826850635727322' + + '9685836102923546004288074231203712704038367025459784150851942453530296372505150600747245' + + '48258974287875801351389617602402488639578930420752407411968308213028222350043652*x^149 +' + + ' 139012312219226300551763729472511479283791955864842842045804673113892472659200893251349' + + '5230700512133349586477622659382430830580227004286576552217066462327575617168615769116046' + + '127120927944246516170867550604974904061166944942837594012909743669233042838778*x^148 - 1' + + '2355617672760404839249545405597763994014503311260818968588063469426319134171890936483322' + + '6610414204707108539398237402002063733385907199732687546442250415586621532467968769360415' + + '37325415712055287848699094590808089508684909536725801531454334504662219155298*x^147 + 78' + + '3388573214056722983337914730252820822685883998115176558789270644876608429607987213338588' + + '5377351843684550935440296918108559628783027245678129129584030825298526758499964573195767' + + '9014924167075059287317239791194977384286250565342370732550549861221973628014*x^146 - 337' + + '4295820526166964342476767733813903917055420548509812685321889562165936397719575630122778' + + '1033031405289508181701171026255806634894861047352747650017243235019037703269391120793396' + + '6365985588343500355068020592838333693543614719695933939552850201760137124456*x^145 + 126' + + '7022512449095517765635963857489440320956185849532448394191453064873093377283326533700392' + + '8417799194535821386624283453961529673399508105934582815314275613767863821942606944495384' + + '02376863382264434438107547454079981595409252310957914375045407870857103723132*x^144 - 15' + + '3719609646143637199240438779331521362833031099802285618952009014965538370060716502819704' + + '6414621578662674582267335714866655998331041679656464326243140403108570867049851413187917' + + '2395315308884725086995597751964859239544450069420287019254955379338574827976392*x^143 + ' + + '2752630473030549230951961180329787356710099537940382001402721757277246999726996317480093' + + '3499033033245674070755714623926429378341959406334701280151275325564888817651709058422638' + + '2448332343741276856590710765250075976268484026303268470337380600828996170962184046*x^142' + + ' - 3552309515782831333713946259135170281657716573143323431788455634749585422775719036317' + + '4499214513563023473509504110270823451072736365474101510708342773893392493005386523413398' + + '71040322822838485719858336476359261521139254885461283464480406069617193177086233150446*x' + + '^141 + 344658035549892464892757694547640229100351421351827480590692520449336404784117307' + + '4204168858308061107651714893324213121302115744578855158079577011771255876661225789242989' + + '6407970226952977125727065334346005607660813917854532265984271205078552129981020849945722' + + '662*x^140 - 2683737225161158395810730710084949190456447093682830001175926782807962713700' + + '0832711687386515408763301405334867356212670696857859739463338404796759488859624213038265' + + '8465725080645154791059956333436847011768914542767112707721040710586854450242752202162514' + + '502517912*x^139 + 1742444297891369493991077844263622734267621349666334184372478600323885' + + '9274274057411635646353155281298451648136704209002938845039923935043096379256494572178617' + + '7563429720654144039386133241554831725367065310144005542392522004164573773389413209463932' + + '3829473024157820*x^138 - 963039078892037951990470202746814269069659583041968061883126627' + + '3162745223389393610063433083213953579433149814915110781090875111324184920857033852183817' + + '9678717281819508263987198750195192482470099599676753469515874825778086427265666686153043' + + '22301287390305988300028*x^137 + 45744737624216083922286552321208151225120417276955454153' + + '6513601067533556875757151411210379160074536613917366414758841891936558857055575472010038' + + '0387991571208004231209540632005541320473220496426057337951511990255432188920461029857337' + + '1864198642424001195728006133182*x^136 - 186886057813652994911005666538436531742970264786' + + '5923884532083174762453088039579050264330873054622685850786797760199466038669915165632724' + + '2828342029961503563105432403558076696314924892635292347470913591761192303244237926059122' + + '9749107391665636207832174634098946284598*x^135 + 650930766688033291162528999671292641219' + + '5419508131658251738256220336229824442058592426074936635118330862929720868958836034224352' + + '2870910111386570744879615792041897647003539203014728725056852271334774934551704770874564' + + '5767806883427498415677547239236298519819304443846*x^134 - 188737857214948682414768736751' + + '1231259955360557324252646574814811972214651363818263080004881765201151009039934832304971' + + '7386130222854886605919808990597585617366670880266091842937662126151457793355558304191543' + + '21176614476225431341974175714575265820939899419742919508060*x^133 + 42953889394645520155' + + '7409655838948254975167613584775116826651538942451816286881091436166450578237021021126058' + + '7376408754507104013237607018922017023401049094197048725524392809860540776061068178741312' + + '168914092676961281988683451346980939322613643773108817289575967525206*x^132 - 6326172732' + + '8918865906350940397161109868277289808692349026207015730991196592142094811108152500708550' + + '7792610014228611379115265836635218591862448268530335248909968539052444135113205017957045' + + '2776530090912230189731431879125807895290459527651483474680605068851138729175634*x^131 - ' + + '1119917054839792275168890048605885705724336013260563577968638457421333926443835337621451' + + '6815220749891064364448374375377252006496924660040298690043694884815265937318132950430507' + + '8994688740647000779402755856689256783957036208034159102866400625978497921409668261262269' + + '2*x^130 + 427131422004946685256073833839324624512810532171083266005676807205793758031998' + + '1540501477952299826157540402130260426710231899734969840027495342743707520560577999976464' + + '4539342324945907217257015338807690270224780252688493775073451490812831750493851260007482' + + '523315136586*x^129 - 1480235901007106731418608864648162080286435090932830155336250065967' + + '6694697267415783980200503348765782212522356772330824651820513893406326947897903512259115' + + '9536438725785908614943188983682291413539553246441876994283071473752182291248178529493117' + + '079561875143739124185634*x^128 + 2461756416145658976796538485278045743286736401969417596' + + '6275458514450138575753439595259660114527770418601869322995580927692188758796260764328940' + + '7657987753382770716004973964128982846342663264119335560750008714258096212502569271025201' + + '095741906534219351860811124404494196*x^127 + 1990565893680671595442880060323376805411690' + + '8982420320234239133079106312028397798694740007864603898415855926572783576585034622967997' + + '5575446479539827712484639591071048813727255731760017261708300771575388890158591817638333' + + '201062459001177511936169630253047386566741135222*x^126 - 3016573234167548686525330843044' + + '1797191448447887193219597832133129727214089635223501342064521224438326191703259085520149' + + '6548201420356430642227248391186457171733887631493913310840727797524422777696065632512435' + + '5051502725255975073566061339620994099300340563608380613367050*x^125 + 125794814436296033' + + '3134666662231940352093525178726887316023131972692166583092196428964016422696026740138219' + + '5941050754678790203096370184903025817178707118551679807309549341318999724744130123636458' + + '246412550387700751891578989629129490134499746480541486417644003205338871882*x^124 - 3664' + + '7527126010505801731553608303394830636027063149652617096685333700696353823150401335975951' + + '7585684151976270223738380501428754257417253062108072762608015060889860062836269868824645' + + '9544729925465875848556894392587585369946240504832824795936818685295379822174025324728479' + + '2*x^123 + 847166740400182541685410295472670066112247306755245136353340233543806042517580' + + '5467559354137762254469896593139106830798735831123823275732509177781080628707431630216965' + + '5840667205157797595141889518050949723016737942549620483751941533243600758727975735045108' + + '792516939770864*x^122 - 1611469357174284617997847938011738534799737191324944707968337975' + + '1961340444008935754666780416238699732660665742711435647219232676062975775017270732119064' + + '5498819377245496716236524811771049606102487507016989267838733791065664530366349655384775' + + '511706599600386112512946557632*x^121 + 2522694849864480951479825412582961761101029175375' + + '0062990050323620295897587695065324670940000207944207812042399077482469097012869133985212' + + '6354595110186421998141347799854111539239085705015451817020704883026517132793698058647769' + + '011690212936405831828960609809154392310067086*x^120 - 3123954350950041465582224682058146' + + '6016766786100370771446195101114970617420873338985187231567399875364206176528467462373042' + + '9562551231647203516276142369010876697525206179883748370865834730988867057833796457914852' + + '097995716547367836013130298617785547855899873691057926811306*x^119 + 2609307345012843532' + + '2247521043157618871239206723903027929818592698185161383200388359536211219406343182592146' + + '9777713165902639697172972103293846309317995560069560008067067565135736757108179337687968' + + '541580428147949860084233825035556867616037181559579555206199159262851046258*x^118 - 5466' + + '2088841731030645691329700237358771258354132863645107344968862093509634579060272660594821' + + '9615697304857008627794014868256456846779843802852549787373412060095039379746983805031499' + + '6254429077961709963726138791862906553536781663415296571417609896418531671323802662549340' + + '*x^117 - 5018202172932723848612324641865970028936810684294735996033784923912076309299011' + + '5331307475563768776851277712661749540908097325081469303925458064884142328499816025881335' + + '3839212147718300729476653234198833090282154102884725904778754037483095258171403839074803' + + '113722901930619*x^116 + 1184061033368761585779174541867097405449294198484094378541103762' + + '3838485368610072441833481575794579330810980994347987985778741196393539613217121527222032' + + '6722407675369164351945267437588196190063225181878442213678933572194923238652257406338724' + + '9474397309298715042958501899245*x^115 - 176734272677759520180709847378647130652166835479' + + '0922710772327067981192822476939413912953115815829947318808933249885514336602487836197536' + + '9611127131928890515684844943744748937382837125994011164383657897820620204611774199772231' + + '48716322298719262705865767989172293892727336803*x^114 + 17753024853051994271617195180096' + + '5388948822797211110233322549229100349316200278964800334378539049137807103604832938442191' + + '8922891522117638503012421231548652255160959939943384670391834208434672810076000087641716' + + '214413857177876294347407269563098844605653811371200441716482612*x^113 - 6805580803942241' + + '5389652936779491502627000137416167108688643534238599366168143600213817710720422427390683' + + '2078455002177068865920164648302696976057624569611228684550845028525961920333227206075764' + + '665165228225992275397755618739608508043386038457848710886307936627814494090172*x^112 - 1' + + '7134585516899315397126185796595750959733583992327191799305914151591547485431128802404257' + + '5151000470170546561098255539115103462495893698791158298695666439760340532158299357619298' + + '1538366354538416065449072981604626649741228358475390951398611771434975819632467920927623' + + '648602*x^111 + 4755280354989431498567723580899120052471944522140383962676105128530062058' + + '7722433619265128807827867660253842829812945775112424974135372950240457723174510064115818' + + '0782938660497278340024396047755487444276112996589133828599729196840562852395386580009293' + + '3414124830547621130787*x^110 - 672428453981276033467643787358630417913935967603492325560' + + '3133878329081616256829860709938088561919816893627337618874976711707752413017492294772666' + + '8956608701940248392100508197963897501107885069331081963929674153546422780993129544541729' + + '43987260326378638622142759365186532673*x^109 + 55277967193070494108505087891929956655236' + + '8896876578268175977451438771610569912425740087266827286735858716699401268464277514456005' + + '1393232906738794805715412356740750890873873435323228244674952180988795091974844777831874' + + '994317609349719963129292674653332785827444869904448205*x^108 - 4161315914958260303700782' + + '1378021268206873842361757130321500129691291418451571447235232841374436360724745406285376' + + '5212695133675510221970937823367502714872526486917915543619099980370791896548285890991567' + + '929454475829428616802918715542674704594105656661109974298786084926216*x^107 - 6496855052' + + '0798695907403393041609584497177075677977387790836546826483076679272105467045939763911899' + + '8550485476554326886588603892066038792890904401145368943002404700917067207281102757826361' + + '3814365800831534860425823304346541483988808631718250457924535357455148087384017967480*x^' + + '106 + 1098870430388589282631528397531121024272278388444966028211338270018737204610302817' + + '4037252313156286126163656212719411476129738075670842090383242374345071869120294985233601' + + '2283553302430973984067783168941238662779103359925207129688403124462673408375334246270651' + + '23680989778324*x^105 - 10377690813223954987282809287979304216731816367846519432326529872' + + '0037037998871007531542818801529571100342530668243165130093328378888288095757828135898395' + + '4316998750686918822781402097384869911886550329315695833395559508114697511481921636949333' + + '4147767991300084429910831005417*x^104 + 698101866165819192934087787107108500858284600224' + + '7498545365034160553809386307776740323457684451079032740625501338477163577149719360331436' + + '8376111896927918312613660921244314336123841173727343108316374825964917374812406255193704' + + '15275231858412571456668503155908009579048097943*x^103 - 62618742936856051264116083169826' + + '9917762052785386210430790988069604384137878194361389699073225403863192706786752381073990' + + '4629809810678656127043145873535279223707645117591581849318483810783264428888878968101286' + + '898381392510682070079334990623735577742545874102235967038827767*x^102 + 8854771357713674' + + '7022744956480711506392268841458610902634308115200722800139381186371312709284888845303124' + + '9274119846056297769374759830206187529701190385641706923794555206972925920329373615467878' + + '5007420066778201855082685563641521979888163226986534911148352808279115809917358*x^101 - ' + + '4630158507380629238809331579153339113748480666810903470310745062885874214341010279973693' + + '3423690707497806772282673113820748775676920348192505254434973153766593145137560564910827' + + '8576436024400724045415341073044774340899126940121480972810775541169317239501263434110744' + + '8006498*x^100 - 198710643033628650225509663362197577826927493881160107853598678016947857' + + '1202782217427771679102488973287412379699901711653267226575231356112272871163670631271576' + + '7986161922405459911607294156345100185524317796050855692880590850929919374908662413690455' + + '670795224105490516738430*x^99 + 61161114864798684234619638515241969274900947726541371092' + + '8182024096556013358628686098937442753126225466775993244832015197487928804402237838654698' + + '1429567519154074102099915969249245522681842536878963413722812765223261014692404361511452' + + '9192462392320461821295874662972625510705*x^98 - 8585434072028582480876325305001979394403' + + '6802688174526254977465503397184149378268902368096758090513332370728027354524452052318746' + + '5238775079003930067906702538862010077151654142173689494119764321155798594114038476768325' + + '93424896146959490497405782950778627016658691250674749383*x^97 + 490657445429729269017920' + + '9687546883016620517611911217595219014813015157155188541123765870476789021829481317185682' + + '2346556428383215072814614042291152340886085128841976463982340477579191182175549956025163' + + '180298168574988817375881331870052016910321408923741313322367680681136483*x^96 + 58848035' + + '6039113348615320015128938548650997950279831325677040107085175877137589019325717560517114' + + '4175873327958813862484089151772708967824509071038232508873595271965775853620263242569539' + + '7040762304230638936597396706141037241892685559313526162149365318736429347633086308123732' + + '*x^95 - 17860801079269145558108858839465800861694899301727979464445269231194082523845268' + + '3644231985542836056355374630947740336929500805905936814782276246158348108920450307640490' + + '5279594814683042875309442804282180084144874679203484065337627335018821329076109362209930' + + '92559868115464848*x^94 + 208069889894993443875528674241467447097665069734682372239388187' + + '7584898564578710270984963067042166792938707718390759663409167550410773690988587940908229' + + '8810629516372158817839495918687295082228007905992804249154207283659484732476414136221785' + + '4738459946888011176892625701864148*x^93 - 8558642180093085759446360247311113597751122552' + + '0453134502272629591233109506642760602939655259317866169111674033411886153395302866756775' + + '2698318841217454487996891181376075586164380997562134304875334824868353460756829039238807' + + '66231253716972279618549611306311532332784130069552*x^92 - 136808840532983525733371616856' + + '9159837832704105092114010195321026892585608760869527424128221769318567475482882108641281' + + '2285087254525711762649195488713090158567261995935441375507973903437038954795573527871968' + + '5417161263340979324636115855437833626026464694567238228672113384692*x^91 + 3083618181674' + + '8862986568981166117178805224503007958449196073139881830099761716540415100166992970870487' + + '3373126707079788137630463247890473378063608477167239399012803238136948080412031233026613' + + '982019674842362996126760918598660881958154075853487234166732468962725982670350394704*x^9' + + '0 - 289813403115309877208771459417444034084104076525942453959151517396192830308839300938' + + '0304940043691096832523560373895822112785580806605470306384081427336961791157445910134361' + + '6657558236169574623914019563015278033757596207115604274416404619873976763726230361176862' + + '4103749962308*x^89 + 7261351663096262596547306421752519967664944352757042657548177074004' + + '3888677964659193629574783185110493910165175834232355443264530112794558163538094276674245' + + '6353777250207079910504846550724505962349124489646241318514590194031456960538083858615515' + + '96378474452839548918080875392*x^88 + 200713757916795743907199117219275583409438205206481' + + '7231942053479639672483761457404441185343078367224200214631098353066851895330784411098417' + + '9847059123493476869255490681758812078835010353226169335124724927063671787833803437569881' + + '8803110365779071391744233368892636267232901060*x^87 - 3415835276908504387639264828603304' + + '4774187543053163607988075369013939388738693955206826175246197239322189971974495529977902' + + '7964187271967842736546188163848500234007974342522989286125308388161626419574193744111685' + + '493591811397803624718762999077541037470623557200013418602943344*x^86 + 26018106816532769' + + '8245150891897217833740746455695910711621558284030232272450337410678138897855399057733160' + + '1290080284009751576485218063690521326598794386401757044711814737218799723053160173284842' + + '74431327228359292699165843454191912138368855662104946473338105764358284022377572*x^85 - ' + + '2856874975370233084322274278589877961032877493803575239781590446839383349838850110790540' + + '3648812210524131836405185194224569727115488819662642038492004860753207681555806490132240' + + '8777764393214575140844637199884061193474482510361153824419358509002112742441715082401720' + + '03554579*x^84 - 185573110599032244389576804101570527084348132767052973645572485911757964' + + '2729259313496498283495085435901054470028253519696177221666303588429341287116612944063277' + + '9930980074617184610893507366878734777801369439906065231112116255739189374932436800793331' + + '5027120013043270445299679*x^83 + 2505011717146723089065441083408757861755953848955478128' + + '1579315788118551389826559214390772170359816807605857234817507196713740188637976508883215' + + '5441207099939550265092616835796851183324429280208778387235792345466196695362647033860816' + + '591741894381954763538781291764410558313991*x^82 - 15662408051664865744305515416400268585' + + '8707005140734768431358693116067906764627153578291105594938316236476559924652536087221474' + + '7327428481537736097991348864523245930040968256420145471648072565808514922141517073790169' + + '54878586353260655456252800749153240368998676635038282783458*x^81 - 110122232113858116972' + + '1507332419217626139533538741568371707640584772284575411425487193490324697965695782353672' + + '6804651562314202917926303802799123092128511979632608781197616175423659408318430631980819' + + '40752141163524039580073927919234758170275433510727185538480748046492479002*x^80 + 111235' + + '6515565991619059989006694815879078560296078423847058721145611490097096177499329308286485' + + '9800983772015536955812993006164292522896328548114223502627261314995818846022537138353738' + + '2936471043674943875733948393580977308270455034395646105894483336815886915572733813700662' + + '098*x^79 - 12379020348161516025309044646747619580648761934003227421750700116671436042176' + + '9234916272072233533611217288217765756191391217561297135624913793687875324800704812356647' + + '6086580476470670309837456621193106958657582668447487991539286833570311349881787995504922' + + '66664939630915472321*x^78 + 644986875872857655262996287035726007280561305135592527328969' + + '1398310869281737114462536081840128975833012618005509907715818362445645383627908121382917' + + '0321954905360807167962624432083484022020100490514519446370251109469392581989219468104703' + + '815994294606723175356042055357536463*x^77 + 63235839859267049809559199735563111107772959' + + '0643279065161516476872358216246745464869001220997003579220969566678295926927380724469318' + + '0820646061252655605452155405279302221601675097138808481289458149019187488153428597505906' + + '544272968607176655503312813518126744417345713254937*x^76 - 44078594647751444164879473961' + + '6736767172580397703350036227284055841189462241423478207587609486288669494296553877901566' + + '6176696560512375877158819330911417133740272652713240509201629349247928261484764761607535' + + '7271699600397835695683804000368513801138734053137773265487620770740*x^75 + 4163724596067' + + '8029633714502640461515756555508490810389744160372165422901258844664633638080420838509725' + + '4183825084031238242659920649469803095136363601325670641983841752318619899012223863450049' + + '44369160662855082815945811862019931040144524924817805931389170550354597821348040080*x^74' + + ' - 1841618640811270401511432175617831231253958593984003709177376821791781406937773897678' + + '4965616639009339271691384715292287905120635576312602740572720848588646957621039854850944' + + '2271057810666957208785506157563444775542320444667725428466886116029471586504634731571639' + + '99798684880*x^73 - 294578669269207164351858864041819495442047310529305439637416055593898' + + '7162766090787137613214756965908109965354836546249973970248312691190106013609009604757153' + + '5265598414402965513205463264379299412109566296535132357163168956324179721078597937978114' + + '90919775354115913639814509*x^72 + 116883470301786694794010591992879058407629571150024093' + + '9987022716541425069544597244574520104343084383104865011959724834839983162277825538270746' + + '3446772861932339155184508820869149212080432712368832105052715439208219455860107443735640' + + '964550120659951748548591269958013706855735*x^71 - 96233761756284375166851705637988765498' + + '4035360777533599924501238654019753472075770114475997500703712345636146933048481913156972' + + '8222282643435839625366619931870580375861356912492503081505744917112845601154976973694850' + + '812401604169633188754326586393031543351085785683934150011*x^70 + 37267526278532141730147' + + '9191315018709879694200950624463483534818687462182483196524893477069492199183695934342797' + + '9443422541400774200071792159898119676377645076117186837758856316037294986738729314820403' + + '721251876970586201378729901384977948736920393075869570682078658147246402*x^69 + 66642651' + + '0972147250271674030285069053867664571435989654117857022519140952074877015468046625019973' + + '6611736393102501735086158169777441544677276373221138134247693297469341782443037607433520' + + '29769119406856393323456137797429785528262266490880097793589266781529161410379918516384*x' + + '^68 - 2071555886582548648202364839293338433538502314782709935428769719703150188593756759' + + '8754776341070959559300033350049099637806096997987389425073233030518177133541278388985086' + + '9677900862255541990737579183726492903476789901947898423219398782945711055270770359481994' + + '5405714241304*x^67 + 1533378023324702195795907021652744267401738630185227412509325644190' + + '9317029060634416164456507736338956677716876820335111092883359676091733924360756222980274' + + '7370137957394804745995747839571913841959663322372004062970960303273926632557205330806272' + + '2007360886556152476819257995*x^66 - 5448017961352466895430876138677711451586142556869905' + + '0923629567132295720176133619693154821070667944641266645518897058051151574185925738097096' + + '4727783399666659463150181605583241877853317021881869642804656561081278038800895125315270' + + '990349472650330347825776795872045310257331*x^65 - 78282421232046072085247087260513054476' + + '2708527084437003056042757425879840311742564964306395494649198588136505247411015510613617' + + '4626341971660657174623635643361033447842931974752694105386561563527872379266026890354875' + + '8991779230812111021711115289261014249648789576891768349*x^64 + 2418346331507395736897573' + + '1685948955785280205832899561229060484737296889625174282028447265005271786499423067709898' + + '2383233013445921259592253155244901132311176213343245514384663220466022004662645372736932' + + '980342522547214216764952766269941267448422272698762518675998018630028*x^63 - 16663393527' + + '3057052036394074533228174051713767874841092049487380884240739808770868074829519386018865' + + '1033998690460694765201373162084931956959579021291104734490414034641765919862359175005557' + + '76980880906162338772064438815695697212726685067553375670752590808120744985654078946*x^62' + + ' + 5704492208044898871301938876854561565186231725938262332193484731157547462002602737462' + + '8326609599969839661227441248222824316513410409807491982186685917971756931992668327222699' + + '3124978375915590166093644975322115153886997250434245039161542480933535080758204601595606' + + '73674726*x^61 + 379845061301619031112865499569621029871812941926085546779444789597593099' + + '2185392685054292994780700584857914762885227739218300244363323904098764703684336132560431' + + '3463057739669057343485520202139735014463468397975802705055082320020672357668103919450487' + + '46973605012517899250*x^60 - 179994905002158006799826158124801226676759820818759151640774' + + '6996243019260988129520947344375845837479437547362213685858458636627876349240778913114811' + + '5802682216654123834671962143534932353646239716399699703995056735350754413864198251245974' + + '003144472609691094329488186488560*x^59 + 11998226516599704445263680513536575275844740648' + + '8957084977949573347857695876784671990551742747300499572181058411486617608702328068732650' + + '5629115939022842470427461330036765855159497439548922287873385610065932336872210754766024' + + '3619913236809974787583082322603729616639857984*x^58 - 4144983433033950261622731813081470' + + '7770527336969337928516945498045682599969641411081917892253423829261056426615066350997839' + + '9625851001202727382175592869116981671084834588433023053079795144037278276800237512170953' + + '7071990233421247209452432417836264144119102122277397817768*x^57 + 1512962577111507743190' + + '8669956206219042935389498880634946383802509472558213849267308016796479509671033971998232' + + '6640743177967474759322127446620879544817657822412463189953968625409814688990486802544852' + + '254612284845621149784604770996714678404380352987098024383778212981782*x^56 + 77172024931' + + '6487501315793753308542413178191934850303677896300194979153932088946756095579709069441269' + + '0383553620325980615363453753714998257603589364289068081989344439616890875432673156016666' + + '54995598616739353151801167940120441305635456765616769010583292909919688853748166*x^55 - ' + + '5333622148132692571383637474154386631336646003027379100089536309803633081806433335487865' + + '3788348099478071550518684140405592181062300213393211342562869431261195244746405559760305' + + '5279266341016276936298547770626014341819185195774706572228813839188337921892972222814214' + + '310*x^54 + 19809672028428641640899800622402763302466107426065596161229438948311823788722' + + '3011979572958763434751014838641676318160514731028557415209691566304186906674973002537070' + + '5253261451722595574825909044347432563886626360892946154114244758083283534430074310561861' + + '53291193660236*x^53 - 329823673072531211210799718899973202178363530876433641298814641150' + + '6139710410216087290819607707745597629829922199887264959789083529199815629147904411567529' + + '1590786809778563763283465741573088038560353019519669822491564147416413441042710366926553' + + '820042101416886262527990*x^52 - 10144936578269964376020733137047632523382421876974915371' + + '4188811589368419548041234673526743288454740143266748440471090083438713064849263517696332' + + '4904941881888449477311134251646513648478804690358781404087817936978444236056065321755488' + + '9599843143417811189310391299541374*x^51 + 9970100278538009038108356598311736963964654105' + + '7307557839053560097762294189359089690849017771612857726107340562452641761999832823629243' + + '1508228988020877820835825693877180101374081950230530623295046637055944037920792732156011' + + '4457596629472924327212630999737789491694628*x^50 - 4001363641205954524277253466159627211' + + '5054612117982291646110008353550779551054529401065043117114065854192422518937652264386811' + + '6810035116560629578512302780859932290192913573475644905186402717704749806127538925050731' + + '5119821334579686622431730574757902251581738927743514*x^49 + 9180213565693093847510479570' + + '0293884995655962139940688297118935762169143151779122206282849955988804045093690808202777' + + '1911618936765072016334219087961215540705432215522135777876375064000492729289146413824719' + + '753030999530625757538495495631483556564886408485696916274754*x^48 - 50130121021546064268' + + '8466550524464459820491039666763299722186435065388308099847672242626060528662920871699108' + + '4876566352805637002187528368901275570021164484050246770934160569641699481951137621284112' + + '2712589602930316113642419950349056502832731819476610421210838732740*x^47 - 5494429814115' + + '8889585149685718733677961698895320275836546276877269868766134856004799808707502218250732' + + '7394751918448793828197188700366856746060661221362264501276195836539087931402219133901464' + + '02903001771434654731924912308476740943900732699364805260630537589779248726*x^46 + 266862' + + '4265977458183206062913290863407974410158458734261779314753074840748195499034379091977887' + + '7740724609637795099627410990033459320928466992859334584393263971082935971550878766944260' + + '143576637848761516728162978413410567270026180297395204928647366053260719567023642*x^45 -' + + ' 705248610717213520619487207440519095205097725919948620492539163799230109615663569690813' + + '2500152762925969931467667410093356104679329968273315005923088838866278149907674998592394' + + '117000761761120597925240350755933951486120638079133147944601048042610283120648681977182*' + + 'x^44 + 120948879881384317178483912956867036752286364563929428682928139939229340261144090' + + '9195672117689474922617967296235493962840791334950340419054279131563933305486551030416968' + + '3930331479144950467084540935124999738902799381400311390509062702196038645169336929497583' + + '19412*x^43 - 132493488612052453833911384927269989662957662727807923412036942065407705141' + + '7691131722604562201840504522929158651370739513572711063413085138434059101868053588204820' + + '3501768317607444088231087593813985100365809682458092656030031376932623184206777051738480' + + '7361785676*x^42 + 1335101451287203762576138569495941477971504274602183925641749849903459' + + '8980956043459656243655749784623012085862698394648682752166666768074310793807865722870739' + + '3173302010891133955653957891206671708545214887972884388815228324972354653982612030632649' + + '34026405622216*x^41 - 499475928130866741228480771978236745236018779224819801296446463957' + + '9785518460647882301447200199431775600694246107897807321342908506154719721626263588381290' + + '0592176275157168942165975268637294595701807663934675024895640533113998474098334592248256' + + '04519148808410998*x^40 + 212305592210660964298716639074790088269009582658150801718185411' + + '3269385593704800964985188474919595016094399856587285937724667194571366226231057182214817' + + '2939735392854797133864874593493381873393755597220292894779357870630711404684601224949311' + + '42480075599166922066*x^39 - 573560580971059872815795328424511214551077897223506554014689' + + '0908943885059425561173984064965243669475190847160447678969581341853994736689748774337791' + + '1115234455374082211964879328708992075827410179353346849333974996486585045121702984508121' + + '1351675478818348250014*x^38 + 1013236454785227694127708629554514948387008662851023057079' + + '5882796137303973594057278239365802606433320824140045284471619032650746240307864113277781' + + '9311878768393722371629720946216383399574613765135960868446031017264818726765755631590746' + + '592742117108410287162304*x^37 - 11582691707749694320983466811601420819483438159197492729' + + '3674609747819194978460832310429882055944418973561703899132956324878554694827218593251972' + + '0327331589579073374625050919799091874768764116278381338067763168272226788014070435497357' + + '3342854568112725548119716*x^36 + 8305639013155526915236550603371532656184411848547972540' + + '3465416008780582431421160189594698593377625798613038172701584227420667828126971332395384' + + '3252700015484543752538426082787722637328521354532797854400197712614233087564302182567125' + + '978130820395479367756272*x^35 - 72553146629985724022417545002782748038779254133970249404' + + '4488085609115659954701904593406318203275740015798664755712471063807666964274588808311489' + + '1044280939887931108038092178564939092718846931418812112435659600111538323529845502841633' + + '0896607528890361908254*x^34 + 1986079839481209649142506411886933188247493467902250137556' + + '0034921908640372898346258892520513212080051499164813732790533138610827050260461000934976' + + '4731007072157557818507156925710202232809466166773259146148711101276744037011180493410453' + + '92289086401193314942*x^33 - 450407363095728689969776524976799469088161769214155804237591' + + '4732816568654964463404246666107335114613523093289692400764726576487136630100597891085199' + + '5924693237589981416278060753619064370840973302978473470436916347279281264299024937590799' + + '59944869550465866*x^32 + 690709206596584805516907577372217703747616849501451851210472484' + + '6187373009932814178642755564658576569084215689177193658156790231574112156057258090256560' + + '6973769715665769510361215003464899280535977068967178978920510669896579783517231275747610' + + '5925970954316*x^31 - 9505054990887008075387059944852731534709761992249213459182019380991' + + '5101076472648920213965588681446816110662751219780692605034863184825513108322135455467480' + + '1992907089853579938446000527875760177484903309468036228859114620828283853746322958391777' + + '66961104*x^30 + 146871001034451764467214379577713350818960453105454365246878113141243396' + + '2615951663537883759634270986980824512323040156750516514483187596408739659469959898436647' + + '3798855873087478723052705650039925818705324797901096311128210246360020474709693712139627' + + '212*x^29 - 21967157682673292571077015450821069674087154459058705287572769215450467291564' + + '3984006806321437086319058849365052767208218014837751960157990288873082851420245228518414' + + '5954435822512134773040530752315307032862652438081839581459737476241460047819927741316*x^' + + '28 + 25868119256527924216571854756548104041695189769000727814033930137261023208980580205' + + '8986075080802457160498187922336808723533440768983858410495172453056173937212211989511173' + + '231680395022164755838763689599538740293650223698101726021253254970956445408416*x^27 - 24' + + '2805926801032191824481196408612926215648793221911620505040706493277915082684668384082820' + + '7907023221961357049402852741057462854239014222073718993142543903159834420446983839453837' + + '5777438560493927453239255655633758840387565176697754574091764000708652*x^26 + 2280449645' + + '8469216013154676504723662304868433632800693751036388423829721062171682054772991955704322' + + '9772128344339134213287693234598135052834517696989191885698386377361100330805052014322924' + + '6149018773191614239310593408598408683107352357568527200654044*x^25 - 2406358660663137122' + + '0332701849550116809043249774080226142747657499480137764390464906763369553397919412224096' + + '9253863977221653979298143342306176415578087339110574280678118160005286224756835902809740' + + '658092872319513670690482675603106255535345368222072*x^24 + 17662623687632442866313848276' + + '7405333184735625305686026085380981148726634500393960831149553262597329458902932994016704' + + '9161961677061802977969263820447192793617562366039417910781021352992596284460784056551089' + + '2584667589514772071439777359014056460388*x^23 - 1017233748361584303945573233303267710280' + + '8866261456706104325822118295706056417248083910297875201722536975247236509556834662193413' + + '7039403008509886158851525905826470428214804919613199486474955638039045153356770343743289' + + '1192535285335888731490497100*x^22 + 6962445663264990114203834350887614260930901314811371' + + '9161965752973745996685396900624298139454605902203508688010033667430170800362592329749063' + + '2324135942177919647575492583795796411578832042275118279766662730162066196362581674880927' + + '08330371586416*x^21 - 593549929747673542545773038959558612336307724423903906725887570276' + + '8982664645057963477934568594005464836637975042526453172368489524272612968427884799674433' + + '076029695429573035860757527137847022330944670730098884004709831827016377193151480549079*' + + 'x^20 - 992423127688763205526494500283585593161536192980641848880826077125233276374558493' + + '7936951893574980734291809056221635152403694833627530723796946949691147173318001467365819' + + '2117622228419150498922256734920743781356158658426818610320388361445943*x^19 - 2230349100' + + '4197698558726259984446018235224052374222124803112769365262229072348723149347181462577999' + + '9561250973151861274182445148950841643787474774181593565516305051313051359659036389359517' + + '81824035858082445936492127698502477328282539866049529*x^18 - 236643075076678358536974434' + + '1802373468130302112205763984922610425051584684774245106684856714329733460194522211899691' + + '2040305393397970675325560652665649968995125799175143049170891303055998502994776437035748' + + '4298669582284123292715096914727786*x^17 + 2542147127057127485965235153724151047113766830' + + '5008530095934057432271073053439213859505464662101818485064985498169276132525055092922810' + + '7659183430955698520972071635491614118402866501132808889569521209673251362824767097566557' + + '55991836417802*x^16 + 183111149787713493280210397619912322103096524787117977315403019542' + + '0556994309371058325110985700072545919333159157805938622401403735299805200331586731105061' + + '411992395088925553685276827911215509136424174340648729576596630358137790527045198*x^15 -' + + ' 449821041069912943789836264563259981897173155962115964878055569440904947559369552659858' + + '6098851324811318251934194570791615792795171303725257398708791891768203748059945364079420' + + '9186225479459166338434922942612532823032751347335799704869*x^14 - 2298291115194604147122' + + '8739834005426233991017384039136505288378975565222015046012084713248553875254551212370894' + + '2718290034883742571745239756760650243258733906349333521899975599619910693111772391894198' + + '334123224235975702158966025975889*x^13 + 42511674491028604176056825575822690623286438919' + + '8610106379016444756850106638828170836716190513979996775166447324309502316343643464457303' + + '4071544836908769671820523719962939869299988336933823914482320626610429276999595557594057' + + '384713*x^12 - 26347694152548849355786851346292613968732460712333882998302582836844072876' + + '1857082490449796652126507449958756889592429322438384205178238605888784292448997291893491' + + '64095467733178297936868563207641713754730703022219988903837976940*x^11 - 178196131047104' + + '4774947338789490919866800568219510808350360943838004052330411696017910506157765585633940' + + '0958610006887535231411384839284904674511256960034750139170510478764583267207761340591670' + + '1813265375481337031112649106926204*x^10 + 1825000405670995013845885918902187142186986666' + + '4824409338396462521386957836588377301330171147216240982523247505481312286617417272521511' + + '8638399348219471080155689525455946137646839420547370091703312293991788729921149119118525' + + '2*x^9 - 65201626996640512322761674559318066561117950070675294766316982476276989902435290' + + '9587195016688965354038529484926750838814982572946010197963711048936034917631232991978331' + + '662266000737962928009570448129947743171045016069129*x^8 - 143789114908399966242014434226' + + '3678250208894256538560561654893395196139124843140165315079877689148089528582386817468475' + + '1112400557598552798591861020111859826843145889273424219630446788436681492325879038241989' + + '148825558929*x^7 - 142828093036375825138496910105257266211087946680559575870445105279110' + + '3393358290266219966226305109762705525440125914454905218998171494860832439673707497269515' + + '2598687627144493996961826371180326564404038224536379451171*x^6 - 11708263721974590551778' + + '2060088197971006669344668565149881317599098107457621720311505150869324678944193921202206' + + '0006143232927993687388965568222471917250721254423939579010787041982434713954951800253409' + + '69870794174*x^5 - 1182231686757768433506342993065526680618649578262071030174998386344333' + + '1870511938326895267957986310266067435757183222780653285285515787535758717626382176202414' + + '16850427234233281589721441720700844787815627946*x^4 - 9530484570070082961795451881320794' + + '1848171999183509690245763272489068126300419773341516701735233419849726478663631547211301' + + '749427543946011643243124123502481796513891248511161398944690550172434214114*x^3 - 254706' + + '7915242561774721813182510419129507794390935955929617768730635253624759862293118182940797' + + '9543359023138212076788480275435953482850814143976192954552922164477294336146282655143613' + + '63667915*x^2 + 7114590568532928191072122754665584122789751912529693393245247725975835948' + + '7615527828928204048113*x - 1') + + def test_quadray(self): + def Q(d, f): + return pari.lift(pari.quadray(d, f)); + + self.assertEquals(Q(-4, 31), + 'x^240 + (-15*y - 36)*x^239 + (499*y + 430)*x^238 + (-6344*y - 983)*x^237 + (35389*y - 20' + + '411)*x^236 + (-40904*y + 178707)*x^235 + (-424808*y - 438197)*x^234 + (1415485*y - 63520' + + '8)*x^233 + (1438139*y + 2974605)*x^232 + (-5864817*y + 6566480)*x^231 + (-25462020*y - 1' + + '2961894)*x^230 + (19238389*y - 79956654)*x^229 + (247313433*y - 30224897)*x^228 + (29492' + + '7621*y + 801098945)*x^227 + (-2353679384*y + 1069498319)*x^226 + (-3266832488*y - 579346' + + '9739)*x^225 + (12761071756*y - 10152009124)*x^224 + (28891772141*y + 27706877778)*x^223 ' + + '+ (-56780498004*y + 70327470888)*x^222 + (-156989267296*y - 100643285180)*x^221 + (16318' + + '2970660*y - 341901790078)*x^220 + (692925090103*y + 282970748175)*x^219 + (-520851483678' + + '*y + 1249500770581)*x^218 + (-2100987167651*y - 977806363155)*x^217 + (2144907137575*y -' + + ' 3501192827999)*x^216 + (5741131351957*y + 5368774573391)*x^215 + (-12949633488740*y + 9' + + '667592872104)*x^214 + (-18978818705192*y - 28988343801763)*x^213 + (61143701295650*y - 4' + + '2854297857883)*x^212 + (99522339968066*y + 118416217970085)*x^211 + (-203990291010201*y ' + + '+ 226088796680855)*x^210 + (-487486417978576*y - 306059642167156)*x^209 + (3714379876058' + + '61*y - 969565907346414)*x^208 + (1761877237395113*y + 250996844693464)*x^207 + (34758744' + + '8455796*y + 2909203449118066)*x^206 + (-4262623171412271*y + 1900082482875272)*x^205 + (' + + '-5112561845313059*y - 5258998337190094)*x^204 + (4703077156935772*y - 10817923562329066)' + + '*x^203 + (19596724151621886*y + 457971706716061)*x^202 + (10779811934500297*y + 31310302' + + '362591686)*x^201 + (-44471188376651271*y + 33091705261026148)*x^200 + (-7036772807394845' + + '3*y - 55368143890230595)*x^199 + (58047935399898944*y - 125056052810735004)*x^198 + (196' + + '220179915190037*y + 46078797156864550)*x^197 + (-15612945533449050*y + 27845280622065684' + + '6)*x^196 + (-364966710997667886*y + 30164046307811567)*x^195 + (-76920393658091100*y - 4' + + '55669527002677921)*x^194 + (569724473209147360*y - 104273935104641941)*x^193 + (10755448' + + '0539021407*y + 761016430421970356)*x^192 + (-1120756441763956820*y + 138805435659787599)' + + '*x^191 + (-367443684968762359*y - 1741313178847717412)*x^190 + (2626931562224608194*y - ' + + '1142827140366519672)*x^189 + (3001549496003468616*y + 3542726921147289593)*x^188 + (-381' + + '6304655625513057*y + 6563685064488706687)*x^187 + (-12280102244383760786*y - 21699560839' + + '18876046)*x^186 + (-3280308295039992672*y - 20013773166146345265)*x^185 + (2853496987167' + + '9714183*y - 14758677431499660732)*x^184 + (34205385277277312731*y + 35129207175233160758' + + ')*x^183 + (-35562575528916824663*y + 62321292808100809456)*x^182 + (-9752696811368934026' + + '6*y - 24577168539715006795)*x^181 + (-2924482708853224503*y - 135200656059538396115)*x^1' + + '80 + (167559880460473073606*y - 50231770182088582728)*x^179 + (117217186558944665294*y +' + + ' 184431316627662099968)*x^178 + (-175018700423712057769*y + 199325075624692888658)*x^177' + + ' + (-287672838056258651793*y - 130006789216819808906)*x^176 + (43313688758928043819*y - ' + + '370488386653834436323)*x^175 + (435685264104825475131*y - 87230951613648934063)*x^174 + ' + + '(260789110179489506909*y + 473346146286012258862)*x^173 + (-477453708065915165092*y + 47' + + '5828532275903297714)*x^172 + (-733125023480253537968*y - 445824632107486741239)*x^171 + ' + + '(377925441616168009977*y - 1037951764481934863694)*x^170 + (1401192440853964064557*y + 2' + + '71204181219921501426)*x^169 + (-116817470274758714683*y + 1837817520966021102844)*x^168 ' + + '+ (-2362860273074857968126*y + 103875680474127044027)*x^167 + (-421763202246558569481*y ' + + '- 2985437596461812106201)*x^166 + (3701454711020661872373*y - 878419497758685431399)*x^1' + + '65 + (1521006793930665203185*y + 4486769840934475059679)*x^164 + (-529241318603180042864' + + '8*y + 2393646591871321675898)*x^163 + (-3527560907713404811933*y - 604634284973707724102' + + '9)*x^162 + (6659475347960239461641*y - 4934471883467342725819)*x^161 + (6606218484397706' + + '362957*y + 7034633694928572084799)*x^160 + (-7071251229918632950519*y + 8522145413937837' + + '540988)*x^159 + (-10654172673396879304988*y - 6660938661086516468010)*x^158 + (567774155' + + '9220425296264*y - 12963319200223537566424)*x^157 + (15378684394800615926642*y + 39750426' + + '69473795569897)*x^156 + (-1409491575820818236069*y + 17768498236629148702410)*x^155 + (-' + + '19928654122136236656860*y + 2108177954625221499359)*x^154 + (-6549200784773657451762*y -' + + ' 21617243705895522615660)*x^153 + (22645379524677683996954*y - 11738628703873244299229)*' + + 'x^152 + (17408053637884918322314*y + 22982504260819896781381)*x^151 + (-2280963052257870' + + '1355929*y + 23340226072231874490562)*x^150 + (-29550558164952915082604*y - 2243923697761' + + '5542871417)*x^149 + (22094525765620020809639*y - 36386527353264595233550)*x^148 + (44442' + + '209345887020103552*y + 21630493829993114594971)*x^147 + (-20362621509381561401708*y + 54' + + '254830555411448139989)*x^146 + (-65913386979565369752671*y - 17161940478911028975987)*x^' + + '145 + (10842803083053018739937*y - 78798826823995559998884)*x^144 + (9167111465909433423' + + '0114*y + 699010605156960463896)*x^143 + (13121977610624125288643*y + 1031433173880272806' + + '63819)*x^142 + (-112336281183122778011108*y + 29666952173920616332098)*x^141 + (-4771339' + + '6391497944676658*y - 119352040791078382516354)*x^140 + (125222144899372880978343*y - 665' + + '35424263344578690303)*x^139 + (86443391588395703449231*y + 131288792905554584140170)*x^1' + + '38 + (-138308631379146285689943*y + 108711776444636401209940)*x^137 + (-1348368565280014' + + '66894586*y - 145826834678543169365085)*x^136 + (152261003156819774060466*y - 16552554507' + + '4570372890946)*x^135 + (200019883617103704090631*y + 155735524429003454571137)*x^134 + (' + + '-155214006426713875482591*y + 236255888142978579163439)*x^133 + (-2718432139372841283103' + + '12*y - 151199785544397594300869)*x^132 + (145501652264843306972923*y - 30532687550632110' + + '0258855)*x^131 + (336932852565943631529246*y + 140097781638111061499104)*x^130 + (-13577' + + '3050794564515416176*y + 368242715265481945864410)*x^129 + (-400908655930869378612741*y -' + + ' 131401561676926670933942)*x^128 + (124426493872813948801626*y - 43514571281432866679953' + + '9)*x^127 + (468998791431367083907400*y + 112351662733835870233203)*x^126 + (-94381628626' + + '117531492779*y + 498937937395927788353831)*x^125 + (-521540559152841029573809*y - 721883' + + '67562634255595303)*x^124 + (49231480359271694594387*y - 535280543629519838165745)*x^123 ' + + '+ (541321200409785903521904*y + 28961946371400127296768)*x^122 + (-129362297730888224368' + + '24*y + 542775176498979507958864)*x^121 - 542817871620722856854615*y*x^120 + (-1293622977' + + '3088822436824*y - 542775176498979507958864)*x^119 + (541321200409785903521904*y - 289619' + + '46371400127296768)*x^118 + (49231480359271694594387*y + 535280543629519838165745)*x^117 ' + + '+ (-521540559152841029573809*y + 72188367562634255595303)*x^116 + (-94381628626117531492' + + '779*y - 498937937395927788353831)*x^115 + (468998791431367083907400*y - 1123516627338358' + + '70233203)*x^114 + (124426493872813948801626*y + 435145712814328666799539)*x^113 + (-4009' + + '08655930869378612741*y + 131401561676926670933942)*x^112 + (-135773050794564515416176*y ' + + '- 368242715265481945864410)*x^111 + (336932852565943631529246*y - 1400977816381110614991' + + '04)*x^110 + (145501652264843306972923*y + 305326875506321100258855)*x^109 + (-2718432139' + + '37284128310312*y + 151199785544397594300869)*x^108 + (-155214006426713875482591*y - 2362' + + '55888142978579163439)*x^107 + (200019883617103704090631*y - 155735524429003454571137)*x^' + + '106 + (152261003156819774060466*y + 165525545074570372890946)*x^105 + (-1348368565280014' + + '66894586*y + 145826834678543169365085)*x^104 + (-138308631379146285689943*y - 1087117764' + + '44636401209940)*x^103 + (86443391588395703449231*y - 131288792905554584140170)*x^102 + (' + + '125222144899372880978343*y + 66535424263344578690303)*x^101 + (-47713396391497944676658*' + + 'y + 119352040791078382516354)*x^100 + (-112336281183122778011108*y - 2966695217392061633' + + '2098)*x^99 + (13121977610624125288643*y - 103143317388027280663819)*x^98 + (916711146590' + + '94334230114*y - 699010605156960463896)*x^97 + (10842803083053018739937*y + 7879882682399' + + '5559998884)*x^96 + (-65913386979565369752671*y + 17161940478911028975987)*x^95 + (-20362' + + '621509381561401708*y - 54254830555411448139989)*x^94 + (44442209345887020103552*y - 2163' + + '0493829993114594971)*x^93 + (22094525765620020809639*y + 36386527353264595233550)*x^92 +' + + ' (-29550558164952915082604*y + 22439236977615542871417)*x^91 + (-22809630522578701355929' + + '*y - 23340226072231874490562)*x^90 + (17408053637884918322314*y - 2298250426081989678138' + + '1)*x^89 + (22645379524677683996954*y + 11738628703873244299229)*x^88 + (-654920078477365' + + '7451762*y + 21617243705895522615660)*x^87 + (-19928654122136236656860*y - 21081779546252' + + '21499359)*x^86 + (-1409491575820818236069*y - 17768498236629148702410)*x^85 + (153786843' + + '94800615926642*y - 3975042669473795569897)*x^84 + (5677741559220425296264*y + 1296331920' + + '0223537566424)*x^83 + (-10654172673396879304988*y + 6660938661086516468010)*x^82 + (-707' + + '1251229918632950519*y - 8522145413937837540988)*x^81 + (6606218484397706362957*y - 70346' + + '33694928572084799)*x^80 + (6659475347960239461641*y + 4934471883467342725819)*x^79 + (-3' + + '527560907713404811933*y + 6046342849737077241029)*x^78 + (-5292413186031800428648*y - 23' + + '93646591871321675898)*x^77 + (1521006793930665203185*y - 4486769840934475059679)*x^76 + ' + + '(3701454711020661872373*y + 878419497758685431399)*x^75 + (-421763202246558569481*y + 29' + + '85437596461812106201)*x^74 + (-2362860273074857968126*y - 103875680474127044027)*x^73 + ' + + '(-116817470274758714683*y - 1837817520966021102844)*x^72 + (1401192440853964064557*y - 2' + + '71204181219921501426)*x^71 + (377925441616168009977*y + 1037951764481934863694)*x^70 + (' + + '-733125023480253537968*y + 445824632107486741239)*x^69 + (-477453708065915165092*y - 475' + + '828532275903297714)*x^68 + (260789110179489506909*y - 473346146286012258862)*x^67 + (435' + + '685264104825475131*y + 87230951613648934063)*x^66 + (43313688758928043819*y + 3704883866' + + '53834436323)*x^65 + (-287672838056258651793*y + 130006789216819808906)*x^64 + (-17501870' + + '0423712057769*y - 199325075624692888658)*x^63 + (117217186558944665294*y - 1844313166276' + + '62099968)*x^62 + (167559880460473073606*y + 50231770182088582728)*x^61 + (-2924482708853' + + '224503*y + 135200656059538396115)*x^60 + (-97526968113689340266*y + 24577168539715006795' + + ')*x^59 + (-35562575528916824663*y - 62321292808100809456)*x^58 + (34205385277277312731*y' + + ' - 35129207175233160758)*x^57 + (28534969871679714183*y + 14758677431499660732)*x^56 + (' + + '-3280308295039992672*y + 20013773166146345265)*x^55 + (-12280102244383760786*y + 2169956' + + '083918876046)*x^54 + (-3816304655625513057*y - 6563685064488706687)*x^53 + (300154949600' + + '3468616*y - 3542726921147289593)*x^52 + (2626931562224608194*y + 1142827140366519672)*x^' + + '51 + (-367443684968762359*y + 1741313178847717412)*x^50 + (-1120756441763956820*y - 1388' + + '05435659787599)*x^49 + (107554480539021407*y - 761016430421970356)*x^48 + (5697244732091' + + '47360*y + 104273935104641941)*x^47 + (-76920393658091100*y + 455669527002677921)*x^46 + ' + + '(-364966710997667886*y - 30164046307811567)*x^45 + (-15612945533449050*y - 2784528062206' + + '56846)*x^44 + (196220179915190037*y - 46078797156864550)*x^43 + (58047935399898944*y + 1' + + '25056052810735004)*x^42 + (-70367728073948453*y + 55368143890230595)*x^41 + (-4447118837' + + '6651271*y - 33091705261026148)*x^40 + (10779811934500297*y - 31310302362591686)*x^39 + (' + + '19596724151621886*y - 457971706716061)*x^38 + (4703077156935772*y + 10817923562329066)*x' + + '^37 + (-5112561845313059*y + 5258998337190094)*x^36 + (-4262623171412271*y - 19000824828' + + '75272)*x^35 + (347587448455796*y - 2909203449118066)*x^34 + (1761877237395113*y - 250996' + + '844693464)*x^33 + (371437987605861*y + 969565907346414)*x^32 + (-487486417978576*y + 306' + + '059642167156)*x^31 + (-203990291010201*y - 226088796680855)*x^30 + (99522339968066*y - 1' + + '18416217970085)*x^29 + (61143701295650*y + 42854297857883)*x^28 + (-18978818705192*y + 2' + + '8988343801763)*x^27 + (-12949633488740*y - 9667592872104)*x^26 + (5741131351957*y - 5368' + + '774573391)*x^25 + (2144907137575*y + 3501192827999)*x^24 + (-2100987167651*y + 977806363' + + '155)*x^23 + (-520851483678*y - 1249500770581)*x^22 + (692925090103*y - 282970748175)*x^2' + + '1 + (163182970660*y + 341901790078)*x^20 + (-156989267296*y + 100643285180)*x^19 + (-567' + + '80498004*y - 70327470888)*x^18 + (28891772141*y - 27706877778)*x^17 + (12761071756*y + 1' + + '0152009124)*x^16 + (-3266832488*y + 5793469739)*x^15 + (-2353679384*y - 1069498319)*x^14' + + ' + (294927621*y - 801098945)*x^13 + (247313433*y + 30224897)*x^12 + (19238389*y + 799566' + + '54)*x^11 + (-25462020*y + 12961894)*x^10 + (-5864817*y - 6566480)*x^9 + (1438139*y - 297' + + '4605)*x^8 + (1415485*y + 635208)*x^7 + (-424808*y + 438197)*x^6 + (-40904*y - 178707)*x^' + + '5 + (35389*y + 20411)*x^4 + (-6344*y + 983)*x^3 + (499*y - 430)*x^2 + (-15*y + 36)*x - 1') + self.assertEquals(Q(-11, 2), 'x^3 + (-y - 1)*x^2 + (y - 2)*x + 1') + self.assertEquals(Q(-15, 3), 'x^6 + (-y - 1)*x^5 + (y - 2)*x^4 + 5*x^3 + (-y - 1)*x^2 + (y - 2)*x + 1') + self.assertEquals(Q(-179, 2), + 'x^15 + (-13*y - 28)*x^14 + (-35*y + 71)*x^13 + (-96*y + 193)*x^12 + (-5*y - 196)*x^11 + (' + '-239*y - 365)*x^10 + (120*y + 1489)*x^9 + (-261*y - 2084)*x^8 + (-261*y + 2345)*x^7 + (' + '120*y - 1609)*x^6 + (-239*y + 604)*x^5 + (-5*y + 201)*x^4 + (-96*y - 97)*x^3 + (-35*y - ' + '36)*x^2 + (-13*y + 41)*x - 1') + self.assertEquals(Q(-2276, 2), + 'x^64 - 2869316*y*x^63 - 14321320456*x^62 + 157634598028*y*x^61 - 202841207529344*x^60 - ' + + '187341502817748*y*x^59 + 42513677421330536*x^58 + 8965927758542748*y*x^57 - 581758105735' + + '037800*x^56 - 22856296353162116*y*x^55 - 1745294559156518504*x^54 - 264489521649865972*y' + + '*x^53 + 3806496834205999360*x^52 - 748148105793479444*y*x^51 + 34464709754552397448*x^50' + + ' - 807085220707689700*y*x^49 + 112558678351798157916*x^48 + 885683152130937644*y*x^47 + ' + + '306385339881668417048*x^46 + 13203419547826420924*y*x^45 + 419863456051485069824*x^44 + ' + + '34343465258453402972*y*x^43 + 465608689069031605064*x^42 + 80309592889200941068*y*x^41 -' + + ' 360175722030581287640*x^40 + 110486596140091600940*y*x^39 - 1490512424563931678536*x^38' + + ' + 143957811491089032572*y*x^37 - 3739364774219046032256*x^36 + 100323919847689168220*y*' + + 'x^35 - 4985975135633301110936*x^34 + 54816113881156185292*y*x^33 - 613500838305160199583' + + '4*x^32 - 54816113881156185292*y*x^31 - 4985975135633301110936*x^30 - 1003239198476891682' + + '20*y*x^29 - 3739364774219046032256*x^28 - 143957811491089032572*y*x^27 - 149051242456393' + + '1678536*x^26 - 110486596140091600940*y*x^25 - 360175722030581287640*x^24 - 8030959288920' + + '0941068*y*x^23 + 465608689069031605064*x^22 - 34343465258453402972*y*x^21 + 419863456051' + + '485069824*x^20 - 13203419547826420924*y*x^19 + 306385339881668417048*x^18 - 885683152130' + + '937644*y*x^17 + 112558678351798157916*x^16 + 807085220707689700*y*x^15 + 344647097545523' + + '97448*x^14 + 748148105793479444*y*x^13 + 3806496834205999360*x^12 + 264489521649865972*y' + + '*x^11 - 1745294559156518504*x^10 + 22856296353162116*y*x^9 - 581758105735037800*x^8 - 89' + + '65927758542748*y*x^7 + 42513677421330536*x^6 + 187341502817748*y*x^5 - 202841207529344*x' + + '^4 - 157634598028*y*x^3 - 14321320456*x^2 + 2869316*y*x + 1') + self.assertEquals(Q(-251, 2), + 'x^21 + (-13*y - 229)*x^20 + (234*y - 100)*x^19 + (-480*y + 8370)*x^18 + (-1735*y - 16719' + + ')*x^17 + (4913*y - 7834)*x^16 + (-2688*y + 51064)*x^15 + (-3960*y - 34104)*x^14 + (1782*' + + 'y - 32956)*x^13 + (8448*y + 5262)*x^12 + (-6380*y + 97204)*x^11 + (-6380*y - 90824)*x^10' + + ' + (8448*y - 13710)*x^9 + (1782*y + 31174)*x^8 + (-3960*y + 38064)*x^7 + (-2688*y - 4837' + + '6)*x^6 + (4913*y + 2921)*x^5 + (-1735*y + 18454)*x^4 + (-480*y - 7890)*x^3 + (234*y - 13' + + '4)*x^2 + (-13*y + 242)*x - 1') + self.assertEquals(Q(-35, 2), 'x^6 - 2*y*x^5 + (-y - 7)*x^4 - 4*x^3 + (y - 8)*x^2 + (2*y - 2)*x + 1') + self.assertEquals(Q(-4, 31), + 'x^240 + (-15*y - 36)*x^239 + (499*y + 430)*x^238 + (-6344*y - 983)*x^237 + (35389*y - 20' + + '411)*x^236 + (-40904*y + 178707)*x^235 + (-424808*y - 438197)*x^234 + (1415485*y - 63520' + + '8)*x^233 + (1438139*y + 2974605)*x^232 + (-5864817*y + 6566480)*x^231 + (-25462020*y - 1' + + '2961894)*x^230 + (19238389*y - 79956654)*x^229 + (247313433*y - 30224897)*x^228 + (29492' + + '7621*y + 801098945)*x^227 + (-2353679384*y + 1069498319)*x^226 + (-3266832488*y - 579346' + + '9739)*x^225 + (12761071756*y - 10152009124)*x^224 + (28891772141*y + 27706877778)*x^223 ' + + '+ (-56780498004*y + 70327470888)*x^222 + (-156989267296*y - 100643285180)*x^221 + (16318' + + '2970660*y - 341901790078)*x^220 + (692925090103*y + 282970748175)*x^219 + (-520851483678' + + '*y + 1249500770581)*x^218 + (-2100987167651*y - 977806363155)*x^217 + (2144907137575*y -' + + ' 3501192827999)*x^216 + (5741131351957*y + 5368774573391)*x^215 + (-12949633488740*y + 9' + + '667592872104)*x^214 + (-18978818705192*y - 28988343801763)*x^213 + (61143701295650*y - 4' + + '2854297857883)*x^212 + (99522339968066*y + 118416217970085)*x^211 + (-203990291010201*y ' + + '+ 226088796680855)*x^210 + (-487486417978576*y - 306059642167156)*x^209 + (3714379876058' + + '61*y - 969565907346414)*x^208 + (1761877237395113*y + 250996844693464)*x^207 + (34758744' + + '8455796*y + 2909203449118066)*x^206 + (-4262623171412271*y + 1900082482875272)*x^205 + (' + + '-5112561845313059*y - 5258998337190094)*x^204 + (4703077156935772*y - 10817923562329066)' + + '*x^203 + (19596724151621886*y + 457971706716061)*x^202 + (10779811934500297*y + 31310302' + + '362591686)*x^201 + (-44471188376651271*y + 33091705261026148)*x^200 + (-7036772807394845' + + '3*y - 55368143890230595)*x^199 + (58047935399898944*y - 125056052810735004)*x^198 + (196' + + '220179915190037*y + 46078797156864550)*x^197 + (-15612945533449050*y + 27845280622065684' + + '6)*x^196 + (-364966710997667886*y + 30164046307811567)*x^195 + (-76920393658091100*y - 4' + + '55669527002677921)*x^194 + (569724473209147360*y - 104273935104641941)*x^193 + (10755448' + + '0539021407*y + 761016430421970356)*x^192 + (-1120756441763956820*y + 138805435659787599)' + + '*x^191 + (-367443684968762359*y - 1741313178847717412)*x^190 + (2626931562224608194*y - ' + + '1142827140366519672)*x^189 + (3001549496003468616*y + 3542726921147289593)*x^188 + (-381' + + '6304655625513057*y + 6563685064488706687)*x^187 + (-12280102244383760786*y - 21699560839' + + '18876046)*x^186 + (-3280308295039992672*y - 20013773166146345265)*x^185 + (2853496987167' + + '9714183*y - 14758677431499660732)*x^184 + (34205385277277312731*y + 35129207175233160758' + + ')*x^183 + (-35562575528916824663*y + 62321292808100809456)*x^182 + (-9752696811368934026' + + '6*y - 24577168539715006795)*x^181 + (-2924482708853224503*y - 135200656059538396115)*x^1' + + '80 + (167559880460473073606*y - 50231770182088582728)*x^179 + (117217186558944665294*y +' + + ' 184431316627662099968)*x^178 + (-175018700423712057769*y + 199325075624692888658)*x^177' + + ' + (-287672838056258651793*y - 130006789216819808906)*x^176 + (43313688758928043819*y - ' + + '370488386653834436323)*x^175 + (435685264104825475131*y - 87230951613648934063)*x^174 + ' + + '(260789110179489506909*y + 473346146286012258862)*x^173 + (-477453708065915165092*y + 47' + + '5828532275903297714)*x^172 + (-733125023480253537968*y - 445824632107486741239)*x^171 + ' + + '(377925441616168009977*y - 1037951764481934863694)*x^170 + (1401192440853964064557*y + 2' + + '71204181219921501426)*x^169 + (-116817470274758714683*y + 1837817520966021102844)*x^168 ' + + '+ (-2362860273074857968126*y + 103875680474127044027)*x^167 + (-421763202246558569481*y ' + + '- 2985437596461812106201)*x^166 + (3701454711020661872373*y - 878419497758685431399)*x^1' + + '65 + (1521006793930665203185*y + 4486769840934475059679)*x^164 + (-529241318603180042864' + + '8*y + 2393646591871321675898)*x^163 + (-3527560907713404811933*y - 604634284973707724102' + + '9)*x^162 + (6659475347960239461641*y - 4934471883467342725819)*x^161 + (6606218484397706' + + '362957*y + 7034633694928572084799)*x^160 + (-7071251229918632950519*y + 8522145413937837' + + '540988)*x^159 + (-10654172673396879304988*y - 6660938661086516468010)*x^158 + (567774155' + + '9220425296264*y - 12963319200223537566424)*x^157 + (15378684394800615926642*y + 39750426' + + '69473795569897)*x^156 + (-1409491575820818236069*y + 17768498236629148702410)*x^155 + (-' + + '19928654122136236656860*y + 2108177954625221499359)*x^154 + (-6549200784773657451762*y -' + + ' 21617243705895522615660)*x^153 + (22645379524677683996954*y - 11738628703873244299229)*' + + 'x^152 + (17408053637884918322314*y + 22982504260819896781381)*x^151 + (-2280963052257870' + + '1355929*y + 23340226072231874490562)*x^150 + (-29550558164952915082604*y - 2243923697761' + + '5542871417)*x^149 + (22094525765620020809639*y - 36386527353264595233550)*x^148 + (44442' + + '209345887020103552*y + 21630493829993114594971)*x^147 + (-20362621509381561401708*y + 54' + + '254830555411448139989)*x^146 + (-65913386979565369752671*y - 17161940478911028975987)*x^' + + '145 + (10842803083053018739937*y - 78798826823995559998884)*x^144 + (9167111465909433423' + + '0114*y + 699010605156960463896)*x^143 + (13121977610624125288643*y + 1031433173880272806' + + '63819)*x^142 + (-112336281183122778011108*y + 29666952173920616332098)*x^141 + (-4771339' + + '6391497944676658*y - 119352040791078382516354)*x^140 + (125222144899372880978343*y - 665' + + '35424263344578690303)*x^139 + (86443391588395703449231*y + 131288792905554584140170)*x^1' + + '38 + (-138308631379146285689943*y + 108711776444636401209940)*x^137 + (-1348368565280014' + + '66894586*y - 145826834678543169365085)*x^136 + (152261003156819774060466*y - 16552554507' + + '4570372890946)*x^135 + (200019883617103704090631*y + 155735524429003454571137)*x^134 + (' + + '-155214006426713875482591*y + 236255888142978579163439)*x^133 + (-2718432139372841283103' + + '12*y - 151199785544397594300869)*x^132 + (145501652264843306972923*y - 30532687550632110' + + '0258855)*x^131 + (336932852565943631529246*y + 140097781638111061499104)*x^130 + (-13577' + + '3050794564515416176*y + 368242715265481945864410)*x^129 + (-400908655930869378612741*y -' + + ' 131401561676926670933942)*x^128 + (124426493872813948801626*y - 43514571281432866679953' + + '9)*x^127 + (468998791431367083907400*y + 112351662733835870233203)*x^126 + (-94381628626' + + '117531492779*y + 498937937395927788353831)*x^125 + (-521540559152841029573809*y - 721883' + + '67562634255595303)*x^124 + (49231480359271694594387*y - 535280543629519838165745)*x^123 ' + + '+ (541321200409785903521904*y + 28961946371400127296768)*x^122 + (-129362297730888224368' + + '24*y + 542775176498979507958864)*x^121 - 542817871620722856854615*y*x^120 + (-1293622977' + + '3088822436824*y - 542775176498979507958864)*x^119 + (541321200409785903521904*y - 289619' + + '46371400127296768)*x^118 + (49231480359271694594387*y + 535280543629519838165745)*x^117 ' + + '+ (-521540559152841029573809*y + 72188367562634255595303)*x^116 + (-94381628626117531492' + + '779*y - 498937937395927788353831)*x^115 + (468998791431367083907400*y - 1123516627338358' + + '70233203)*x^114 + (124426493872813948801626*y + 435145712814328666799539)*x^113 + (-4009' + + '08655930869378612741*y + 131401561676926670933942)*x^112 + (-135773050794564515416176*y ' + + '- 368242715265481945864410)*x^111 + (336932852565943631529246*y - 1400977816381110614991' + + '04)*x^110 + (145501652264843306972923*y + 305326875506321100258855)*x^109 + (-2718432139' + + '37284128310312*y + 151199785544397594300869)*x^108 + (-155214006426713875482591*y - 2362' + + '55888142978579163439)*x^107 + (200019883617103704090631*y - 155735524429003454571137)*x^' + + '106 + (152261003156819774060466*y + 165525545074570372890946)*x^105 + (-1348368565280014' + + '66894586*y + 145826834678543169365085)*x^104 + (-138308631379146285689943*y - 1087117764' + + '44636401209940)*x^103 + (86443391588395703449231*y - 131288792905554584140170)*x^102 + (' + + '125222144899372880978343*y + 66535424263344578690303)*x^101 + (-47713396391497944676658*' + + 'y + 119352040791078382516354)*x^100 + (-112336281183122778011108*y - 2966695217392061633' + + '2098)*x^99 + (13121977610624125288643*y - 103143317388027280663819)*x^98 + (916711146590' + + '94334230114*y - 699010605156960463896)*x^97 + (10842803083053018739937*y + 7879882682399' + + '5559998884)*x^96 + (-65913386979565369752671*y + 17161940478911028975987)*x^95 + (-20362' + + '621509381561401708*y - 54254830555411448139989)*x^94 + (44442209345887020103552*y - 2163' + + '0493829993114594971)*x^93 + (22094525765620020809639*y + 36386527353264595233550)*x^92 +' + + ' (-29550558164952915082604*y + 22439236977615542871417)*x^91 + (-22809630522578701355929' + + '*y - 23340226072231874490562)*x^90 + (17408053637884918322314*y - 2298250426081989678138' + + '1)*x^89 + (22645379524677683996954*y + 11738628703873244299229)*x^88 + (-654920078477365' + + '7451762*y + 21617243705895522615660)*x^87 + (-19928654122136236656860*y - 21081779546252' + + '21499359)*x^86 + (-1409491575820818236069*y - 17768498236629148702410)*x^85 + (153786843' + + '94800615926642*y - 3975042669473795569897)*x^84 + (5677741559220425296264*y + 1296331920' + + '0223537566424)*x^83 + (-10654172673396879304988*y + 6660938661086516468010)*x^82 + (-707' + + '1251229918632950519*y - 8522145413937837540988)*x^81 + (6606218484397706362957*y - 70346' + + '33694928572084799)*x^80 + (6659475347960239461641*y + 4934471883467342725819)*x^79 + (-3' + + '527560907713404811933*y + 6046342849737077241029)*x^78 + (-5292413186031800428648*y - 23' + + '93646591871321675898)*x^77 + (1521006793930665203185*y - 4486769840934475059679)*x^76 + ' + + '(3701454711020661872373*y + 878419497758685431399)*x^75 + (-421763202246558569481*y + 29' + + '85437596461812106201)*x^74 + (-2362860273074857968126*y - 103875680474127044027)*x^73 + ' + + '(-116817470274758714683*y - 1837817520966021102844)*x^72 + (1401192440853964064557*y - 2' + + '71204181219921501426)*x^71 + (377925441616168009977*y + 1037951764481934863694)*x^70 + (' + + '-733125023480253537968*y + 445824632107486741239)*x^69 + (-477453708065915165092*y - 475' + + '828532275903297714)*x^68 + (260789110179489506909*y - 473346146286012258862)*x^67 + (435' + + '685264104825475131*y + 87230951613648934063)*x^66 + (43313688758928043819*y + 3704883866' + + '53834436323)*x^65 + (-287672838056258651793*y + 130006789216819808906)*x^64 + (-17501870' + + '0423712057769*y - 199325075624692888658)*x^63 + (117217186558944665294*y - 1844313166276' + + '62099968)*x^62 + (167559880460473073606*y + 50231770182088582728)*x^61 + (-2924482708853' + + '224503*y + 135200656059538396115)*x^60 + (-97526968113689340266*y + 24577168539715006795' + + ')*x^59 + (-35562575528916824663*y - 62321292808100809456)*x^58 + (34205385277277312731*y' + + ' - 35129207175233160758)*x^57 + (28534969871679714183*y + 14758677431499660732)*x^56 + (' + + '-3280308295039992672*y + 20013773166146345265)*x^55 + (-12280102244383760786*y + 2169956' + + '083918876046)*x^54 + (-3816304655625513057*y - 6563685064488706687)*x^53 + (300154949600' + + '3468616*y - 3542726921147289593)*x^52 + (2626931562224608194*y + 1142827140366519672)*x^' + + '51 + (-367443684968762359*y + 1741313178847717412)*x^50 + (-1120756441763956820*y - 1388' + + '05435659787599)*x^49 + (107554480539021407*y - 761016430421970356)*x^48 + (5697244732091' + + '47360*y + 104273935104641941)*x^47 + (-76920393658091100*y + 455669527002677921)*x^46 + ' + + '(-364966710997667886*y - 30164046307811567)*x^45 + (-15612945533449050*y - 2784528062206' + + '56846)*x^44 + (196220179915190037*y - 46078797156864550)*x^43 + (58047935399898944*y + 1' + + '25056052810735004)*x^42 + (-70367728073948453*y + 55368143890230595)*x^41 + (-4447118837' + + '6651271*y - 33091705261026148)*x^40 + (10779811934500297*y - 31310302362591686)*x^39 + (' + + '19596724151621886*y - 457971706716061)*x^38 + (4703077156935772*y + 10817923562329066)*x' + + '^37 + (-5112561845313059*y + 5258998337190094)*x^36 + (-4262623171412271*y - 19000824828' + + '75272)*x^35 + (347587448455796*y - 2909203449118066)*x^34 + (1761877237395113*y - 250996' + + '844693464)*x^33 + (371437987605861*y + 969565907346414)*x^32 + (-487486417978576*y + 306' + + '059642167156)*x^31 + (-203990291010201*y - 226088796680855)*x^30 + (99522339968066*y - 1' + + '18416217970085)*x^29 + (61143701295650*y + 42854297857883)*x^28 + (-18978818705192*y + 2' + + '8988343801763)*x^27 + (-12949633488740*y - 9667592872104)*x^26 + (5741131351957*y - 5368' + + '774573391)*x^25 + (2144907137575*y + 3501192827999)*x^24 + (-2100987167651*y + 977806363' + + '155)*x^23 + (-520851483678*y - 1249500770581)*x^22 + (692925090103*y - 282970748175)*x^2' + + '1 + (163182970660*y + 341901790078)*x^20 + (-156989267296*y + 100643285180)*x^19 + (-567' + + '80498004*y - 70327470888)*x^18 + (28891772141*y - 27706877778)*x^17 + (12761071756*y + 1' + + '0152009124)*x^16 + (-3266832488*y + 5793469739)*x^15 + (-2353679384*y - 1069498319)*x^14' + + ' + (294927621*y - 801098945)*x^13 + (247313433*y + 30224897)*x^12 + (19238389*y + 799566' + + '54)*x^11 + (-25462020*y + 12961894)*x^10 + (-5864817*y - 6566480)*x^9 + (1438139*y - 297' + + '4605)*x^8 + (1415485*y + 635208)*x^7 + (-424808*y + 438197)*x^6 + (-40904*y - 178707)*x^' + + '5 + (35389*y + 20411)*x^4 + (-6344*y + 983)*x^3 + (499*y - 430)*x^2 + (-15*y + 36)*x - 1') + + self.assertEquals(Q(-51, 3), + 'x^6 + (-2*y - 2)*x^5 + (2*y - 4)*x^4 + 14*x^3 + (-2*y - 2)*x^2 + (2*y - 4)*x + 1') + + self.assertEquals(Q(8 - 48 * 3, 2), 'x^8 + 9*x^6 - 16*x^4 + 9*x^2 + 1') + self.assertEquals(Q(1 - 48 * 3, 3), + 'x^20 + 6*x^19 + 24*x^18 + 46*x^17 + 57*x^16 + 51*x^15 + 37*x^14 + 21*x^13 + 12*x^12 + 3*' + + 'x^11 - 11*x^10 - 3*x^9 + 15*x^8 + 14*x^7 + 9*x^6 + 15*x^5 + 15*x^4 + 6*x^3 + 3*x^2 + 3*x' + + ' + 1') + self.assertEquals(Q(1 - 48 * 3, 4), + 'x^20 + 12*x^18 + 6*x^16 - 5*x^14 - 9*x^12 + 17*x^10 - 9*x^8 + 6*x^4 - 3*x^2 + 1') + self.assertEquals(Q(40 - 48 * 3, 6), + 'x^24 + 4*x^22 + 8*x^20 + 20*x^18 + 32*x^16 - 12*x^14 - 42*x^12 - 12*x^10 + 32*x^8 + 20*x' + + '^6 + 8*x^4 + 4*x^2 + 1') + self.assertEquals(Q(-7, 7), + 'x^21 - 7*x^20 + (3*y + 16)*x^19 + (-22*y - 3)*x^18 + (64*y - 46)*x^17 + (-80*y + 89)*x^1' + + '6 + (14*y - 133)*x^15 + (57*y + 244)*x^14 + (-56*y - 259)*x^13 + (132*y - 3)*x^12 + (-31' + + '7*y + 204)*x^11 + (317*y - 113)*x^10 + (-132*y + 129)*x^9 + (56*y - 315)*x^8 + (-57*y + ' + + '301)*x^7 + (-14*y - 119)*x^6 + (80*y + 9)*x^5 + (-64*y + 18)*x^4 + (22*y - 25)*x^3 + (-3' + + '*y + 19)*x^2 - 7*x + 1') + + K = pari.bnfinit('y^2+5'); + P5 = pari.idealprimedec(K, 5)[0]; + self.assertEquals(Q(K, P5), 'x^4 - y*x^3 - 3*x^2 + y*x + 1') + + K = pari.bnfinit('y^2+5*12'); + P2 = pari.idealprimedec(K, 2)[0]; + P5 = pari.idealprimedec(K, 5)[0]; + self.assertEquals(Q(K, pari.idealmul(K, P2, P5)), 'x^4 + (-1/4*y + 1/2)*x^3 - 2*x^2 + (1/4*y + 1/2)*x + 1') + + # #1633 + self.assertEquals(pari.quadray(-11, 3), 'x^2 - x + 1') + + +"""**** Original expected results **** + +-15: x^2 - x + 1 +-35: x^2 - x - 1 +-51: x^2 - x + 1 +-91: x^2 - x + 2 +-115: x^2 - x - 1 +-123: x^2 - x + 1 +-187: x^2 - x + 3 +-195: x^4 - x^3 + 2*x^2 + x + 1 +-235: x^2 - x - 1 +-267: x^2 - x + 1 +-403: x^2 - x - 3 +-427: x^2 - x + 2 +-435: x^4 - x^3 + 2*x^2 + x + 1 +-483: x^4 - x^3 - x^2 - 2*x + 4 +-555: x^4 - x^3 + 2*x^2 + x + 1 +-595: x^4 - x^3 + 5*x^2 + 2*x + 4 +-627: x^4 - x^3 - 2*x^2 - 3*x + 9 +-715: x^4 - x^3 + 8*x^2 + 3*x + 9 +-795: x^4 - x^3 + 2*x^2 + x + 1 +-1155: x^8 + 15*x^6 + 32*x^4 + 15*x^2 + 1 +-1435: x^4 - x^3 + 5*x^2 + 2*x + 4 +-1995: x^8 + 15*x^6 + 32*x^4 + 15*x^2 + 1 +-3003: x^8 - 9*x^6 + 80*x^4 - 9*x^2 + 1 +-3315: x^8 + 9*x^6 + 77*x^4 + 36*x^2 + 16 +-20: x^2 + 1 +-24: x^2 - 2 +-40: x^2 + 2 +-52: x^2 + 1 +-84: x^4 - x^2 + 1 +-88: x^2 - 2 +-120: x^4 + 2*x^2 + 4 +-132: x^4 - x^2 + 1 +-148: x^2 + 1 +-168: x^4 - 2*x^3 + x^2 + 6*x + 3 +-228: x^4 - x^2 + 1 +-232: x^2 + 2 +-280: x^4 - 2*x^3 - 5*x^2 + 6*x - 1 +-312: x^4 + 2*x^2 + 4 +-340: x^4 + 3*x^2 + 1 +-372: x^4 - x^2 + 1 +-408: x^4 + 2*x^2 + 4 +-420: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1 +-520: x^4 + 6*x^2 + 4 +-532: x^4 - 3*x^2 + 4 +-660: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1 +-708: x^4 - x^2 + 1 +-760: x^4 - 2*x^3 - 5*x^2 + 6*x - 1 +-840: x^8 - 4*x^7 - 2*x^6 + 20*x^5 - 3*x^4 - 32*x^3 + 64*x^2 - 44*x + 19 +-1012: x^4 - 5*x^2 + 9 +-1092: x^8 + 3*x^6 + 5*x^4 + 12*x^2 + 16 +-1320: x^8 - 4*x^7 - 2*x^6 + 20*x^5 - 3*x^4 - 32*x^3 + 64*x^2 - 44*x + 19 +-1380: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1 +-1428: x^8 + 3*x^6 + 5*x^4 + 12*x^2 + 16 +-1540: x^8 - 4*x^7 + 20*x^6 - 46*x^5 + 93*x^4 - 114*x^3 + 92*x^2 - 42*x + 9 +-1848: x^8 - 2*x^7 + 3*x^6 - 14*x^5 + 65*x^4 - 64*x^3 + 46*x^2 + 24*x + 4 +-5460: x^16 + 9*x^14 + 44*x^12 + 261*x^10 + 1029*x^8 + 1044*x^6 + 704*x^4 + 576*x^2 + 256 +x^20 + 27*x^19 + 601*x^18 - 4014*x^17 + 9878*x^16 - 12222*x^15 + 8299*x^14 + + 513*x^13 - 12221*x^12 + 18036*x^11 - 17652*x^10 + 18036*x^9 - 12221*x^8 + 5 +13*x^7 + 8299*x^6 - 12222*x^5 + 9878*x^4 - 4014*x^3 + 601*x^2 + 27*x + 1 +x^88 - 40020669926358941160*x^87 + 24818793423306608856949584839454391158484 +*x^86 - 451973748435231895940407803697160552367624*x^85 + 121004331374769746 +054948634032289469332999202*x^84 + 10059034519705811655247252004833057160111 +397504*x^83 + 351284965440856373689297063590147136894509846260*x^82 + 707678 +7287183022340559185242964779073439110772112*x^81 + 7424864222152380159098443 +6783829317747047323123243*x^80 + 3016669049298212175376092685252207677089225 +7842640*x^79 - 8503049963424563714394067134889147531482230019127096*x^78 - 6 +465786499366041070602916523486769538280412443510592*x^77 + 42150640446078238 +28889410160434091263108115351306399268*x^76 + 119525498598846149476451596656 +291689313170011135603889064*x^75 + 20718604339256925426029633374659465824208 +08944831769026648*x^74 + 270442350108592451558861828173327053458397647311211 +61439752*x^73 + 285289444253762620585561596576563633155859094294552566693317 +*x^72 + 2511360320483460798105377398519192324398612242438706127652544*x^71 + + 18767162620094934148004508464072766541604227783326918296860524*x^70 + 12042 +3236654140529086575067911655764408706511359484732574173280*x^69 + 6698817371 +51097381424117880193907743151768744395737304965311638*x^68 + 326030488372458 +1257592451461949148632593587481718123636435123040*x^67 + 1401218174432359703 +4445628272252822116949974099153581386829916444*x^66 + 5367567444185487660948 +9208131197694348596313231643993076280314304*x^65 + 1849586073448214933624859 +71605260396892443743494472396759635803315*x^64 + 578456213592452525292885126 +678569328965911834184953238551507495512*x^63 + 16556817033476544452278210145 +76515450466671643615335188802513429760*x^62 + 436878840618787239769625306249 +7812500894047454768846457782824580152*x^61 + 1068901472860957747029160191079 +1767817886254017900185293235705392064*x^60 + 2434351573155431230076300160060 +7496079487124511808873652848483412160*x^59 + 5169291351655811457272426459136 +7158576380942435990299052219843612304*x^58 + 1022998330750281135258911239455 +74251052215437006684583051817380710576*x^57 + 188216797464058241448403558395 +102741401235865324690992824034126437157*x^56 + 32060490325705765556225025226 +1154391117300969466803557524988405580272*x^55 + 5026257120330186308702396982 +13303008551061011852403188260952091908532*x^54 + 719344126023656757735145641 +575616692987264009491520118662670217955328*x^53 + 92863816021928333070040902 +0325566534550048821651703177989079236808666*x^52 + 1060255920795694954480037 +612092276836813066528658822564102146651872808*x^51 + 10301589215685511855337 +00012926850740762293883499745887488519869745108*x^50 + 771562428494427189300 +153767022260995609490878443644218508155682351496*x^49 + 27346597807333111348 +9250648988966144580871198921998690911757680224167*x^48 - 3923005119785941970 +23702549831167038133623220261146198494006317061248*x^47 - 107531566077276356 +7397744183394797701786847214693166357365831146616968*x^46 - 1589451619928021 +606930471659130946568147974811578111348229080651241920*x^45 - 17807285584553 +57793403089789263493950243261264268279117584476244784076*x^44 - 158945161992 +8021606930471659130946568147974811578111348229080651241920*x^43 - 1075315660 +772763567397744183394797701786847214693166357365831146616968*x^42 - 39230051 +1978594197023702549831167038133623220261146198494006317061248*x^41 + 2734659 +78073331113489250648988966144580871198921998690911757680224167*x^40 + 771562 +428494427189300153767022260995609490878443644218508155682351496*x^39 + 10301 +58921568551185533700012926850740762293883499745887488519869745108*x^38 + 106 +0255920795694954480037612092276836813066528658822564102146651872808*x^37 + 9 +28638160219283330700409020325566534550048821651703177989079236808666*x^36 + +719344126023656757735145641575616692987264009491520118662670217955328*x^35 + + 502625712033018630870239698213303008551061011852403188260952091908532*x^34 ++ 320604903257057655562250252261154391117300969466803557524988405580272*x^33 + + 188216797464058241448403558395102741401235865324690992824034126437157*x^3 +2 + 102299833075028113525891123945574251052215437006684583051817380710576*x^ +31 + 51692913516558114572724264591367158576380942435990299052219843612304*x^ +30 + 24343515731554312300763001600607496079487124511808873652848483412160*x^ +29 + 10689014728609577470291601910791767817886254017900185293235705392064*x^ +28 + 4368788406187872397696253062497812500894047454768846457782824580152*x^2 +7 + 1655681703347654445227821014576515450466671643615335188802513429760*x^26 + + 578456213592452525292885126678569328965911834184953238551507495512*x^25 + + 184958607344821493362485971605260396892443743494472396759635803315*x^24 + 5 +3675674441854876609489208131197694348596313231643993076280314304*x^23 + 1401 +2181744323597034445628272252822116949974099153581386829916444*x^22 + 3260304 +883724581257592451461949148632593587481718123636435123040*x^21 + 66988173715 +1097381424117880193907743151768744395737304965311638*x^20 + 1204232366541405 +29086575067911655764408706511359484732574173280*x^19 + 187671626200949341480 +04508464072766541604227783326918296860524*x^18 + 251136032048346079810537739 +8519192324398612242438706127652544*x^17 + 2852894442537626205855615965765636 +33155859094294552566693317*x^16 + 270442350108592451558861828173327053458397 +64731121161439752*x^15 + 207186043392569254260296333746594658242080894483176 +9026648*x^14 + 119525498598846149476451596656291689313170011135603889064*x^1 +3 + 4215064044607823828889410160434091263108115351306399268*x^12 - 646578649 +9366041070602916523486769538280412443510592*x^11 - 8503049963424563714394067 +134889147531482230019127096*x^10 + 30166690492982121753760926852522076770892 +257842640*x^9 + 74248642221523801590984436783829317747047323123243*x^8 + 707 +6787287183022340559185242964779073439110772112*x^7 + 35128496544085637368929 +7063590147136894509846260*x^6 + 10059034519705811655247252004833057160111397 +504*x^5 + 121004331374769746054948634032289469332999202*x^4 - 45197374843523 +1895940407803697160552367624*x^3 + 24818793423306608856949584839454391158484 +*x^2 - 40020669926358941160*x + 1 +x^180 - 51943580593235209115083942712389400740668999369044471856895869572767 +632154790719027854950985687*x^179 + 2547067915519807589841747083394507454979 +0011527047653789753822310509943417124290253283094780925633779566003695241876 +25607464220675698078104131248853904115685519116107718359916443145223952387*x +^178 + 856553204115408701571995615320558014258368114267533599476048702248757 +8902931990647387774030794984717551258507939754932426394582122894184128382067 +3569718022270291080598668993546776793532380154605306*x^177 + 762080502049470 +4596056107304576599883142953678664313128034639146864833136453854583485947432 +8177873097803164055573630934557797549232895603414584717394309407907786380469 +1683834066404398393999145427753183790*x^176 + 308956387636466960153212938167 +7324702311668880384172270669030644914696644648416192123216702361395347555520 +1495693461977412751821857739072346944409047470651675235147675440424833117756 +620892810879743135932320774*x^175 + 4884082662966665508762665969667649569784 +5383873744492103182446854649967702283785050616521253612447115822047297077954 +9614257317623478309277167745811150568304415956966429217813229788441116863100 +4611840186992685967179*x^174 + 124005751296377747143710892598982088036932674 +2142684503704154223658839486788375142268292156393058732202380086677633411654 +8906703591687073852643697697716348962297583421466683339923965234468615997649 +73368284228647193399*x^173 + 77807342164244792507055296791047457009683139076 +6947550930281827860194252415153283906741350015821421760488076097868784697023 +0684361377176470035198102530788844464458277074023468487612291349831916437723 +0037354352780222249*x^172 - 266780829858115272388789250462200876445272313022 +9458822467054384295379499065005972497338635889603051515741573734931874924695 +7762408306245748926170958653384087543385833522528441856486249210097660034861 +41241557823792412532*x^171 + 14828387316468627026106844845255173547861518903 +8589804985538974108300682790820861191991101023068971076505863346789787263249 +0126030705881134291752595991307720023292738164624564498269365143236280388326 +494814603159167594322356*x^170 + 2072714630254694525113015470563866763470442 +2896220054319081495621750749375349838158314700070013284414958575563065629489 +9298590460673967042987581924280852650108640761845803254699501956119005286958 +261737898381117495750422003980*x^169 + 4082791913658668250669500487553396688 +5085691856416081922391794020222319071345465620337482939902695391053957179581 +6611178564058054521757672875527012214760684410920857152888054853976552319787 +6482624865506579220641586389147210551*x^168 + 259189082653047933938409996483 +4388754704904320561628999269016762833054641395201768798413743705844841716523 +7122469823713043234758088183799986341785098434142194216335145773402440120312 +8996614247360365624068492442391061043753826375*x^167 + 187953325502846394560 +1845576629993961992277419183089685715578164443785846738744772926323542142109 +3239442057010359289122214569790614009609800219235849343052099855997036406115 +0923659276590113217049579865275822653265241753456459305677*x^166 - 991521344 +5331010597888861249891641758957210552260378821158082129353375249195112911754 +5101896722210096101308894624313777264446536224444928929934283573873319884763 +96421078624456037269503565600020449431475165029149896378441501395456086*x^16 +5 + 870693463207410936114722926699616258456056310070174066271951439226764821 +3754498248686363880077592953938815295745097173153881494887680426204688519814 +5897926708879854493196612672343274340176910775178567635481360192954408109761 +462192666*x^164 + 3291269524452623301119531480681600174871375032940729132937 +0111633092058003369070348946123426594086592059620504463833497832222752798945 +6786539655327366403796168376108709100410788811433213881703418728731545343808 +0442501304279059153710266*x^163 - 484246978651008470853848049302633937841710 +0550099032573348884254048698254002568503682165709558099310997622779159632947 +3025430835921039731844769840401840637061784295187888579980063280775750740026 +326213445261209232925320378956182578938287*x^162 + 2366596557978274147475255 +9694980204169227021539516608112189319106501133980328077568567038119905399100 +7262473707379165967733688444634721899783534252243520926838729652205328556398 +93844358125373580233579396300331967493836532017339326648417*x^161 - 17861170 +0215272735065228998593221635895564621730723507909826896490382687997403628306 +4372396936244334959016553113715105764010891971421665085465778102274753181053 +1359367179288752406620535700142801097476915172283884503644920276078920893715 +961*x^160 + 5442886569416213072883949195207003561672975168183342200753916623 +1352236561897735153650345477157913505173224695785900066453147636135746522196 +8827923591138659172463973059604218652821751160134239388400400287612441644522 +959559654240096950196384*x^159 - 1878459194456192332344340381238953837099207 +3242518317157665963817987346890603378811086853859511458448823118145390556032 +4154260960085054869261002833248663395080605671172589053299559751809388877985 +0319337022684143396368259434426190698508218580*x^158 - 184127686942437509991 +1682977301117955663562464265148547217904344728959181240974449884065092029207 +1219636898969097801966235466592457246648086083637230209961453625153292993135 +3654541155851737335657948991190630601809654864812836013412428233332508*x^157 + + 6272745337714289642780597731451440214649776184728899306566105704002623998 +3846347725688034820317498349655377903497224390190783460776334008364647848917 +2185092927745795075828017034702156144511828098427591206009505705409852728295 +6922223630676347544*x^156 - 130604497267883349741727434418972048161536102040 +0079797720405754446746742329603550983122106752795162131799337624121456619065 +4040984420476843424034832196407821304821044910660899700295392042290695059542 +0192036616889048813209519926849958791965413764*x^155 + 193926478941415365968 +2053039191650223015193274556301436638340272814361000782491228757908126714135 +5744831221609082890601733276886531625139761625422579999591146356457708488690 +66496229883200724281039999541182828857613242844117034223500903997780849964*x +^154 - 208974081851580435134258388853435474877812078509775426825496895616316 +4247844796032344219123951883470813854035626246176679417061266672681500232259 +0819881630082047200072248185982748889171705144305698252911851141436968395735 +658717414968653352018931248*x^153 + 1672646641882017449123000870294181985430 +0761766363953593948968045530794890931499833945021531203099422476121576329491 +5115325960697513628674724029981734640823975379662772003784140453861998461512 +834247290509716832865395591217427305274661390000337103156*x^152 - 1133671449 +3365295420476716878286616778916616227898741966819659317216135015136322466563 +9827520548877905001507920274192410200096811676503284991805981968482979122155 +1667739765953276248859306767909175625527281202034750975189910458947747942582 +531447345892*x^151 + 9686019535728726397130721344019529061590234306774474243 +9775684839133142925738217830167297947427381690011105467748624943273307935251 +9499655312785116384255798310740712404573339361423884780107379495371631287103 +7645627569348897599991117672316256550430096*x^150 - 119041422102704367724958 +8670984575013578769595187713509039012506017888268506357273229685836102923546 +0042880742312037127040383670254597841508519424535302963725051506007472454825 +8974287875801351389617602402488639578930420752407411968308213028222350043652 +*x^149 + 1390123122192263005517637294725114792837919558648428420458046731138 +9247265920089325134952307005121333495864776226593824308305802270042865765522 +1706646232757561716861576911604612712092794424651617086755060497490406116694 +4942837594012909743669233042838778*x^148 - 123556176727604048392495454055977 +6399401450331126081896858806346942631913417189093648332266104142047071085393 +9823740200206373338590719973268754644225041558662153246796876936041537325415 +712055287848699094590808089508684909536725801531454334504662219155298*x^147 ++ 78338857321405672298333791473025282082268588399811517655878927064487660842 +9607987213338588537735184368455093544029691810855962878302724567812912958403 +0825298526758499964573195767901492416707505928731723979119497738428625056534 +2370732550549861221973628014*x^146 - 337429582052616696434247676773381390391 +7055420548509812685321889562165936397719575630122778103303140528950818170117 +1026255806634894861047352747650017243235019037703269391120793396636598558834 +3500355068020592838333693543614719695933939552850201760137124456*x^145 + 126 +7022512449095517765635963857489440320956185849532448394191453064873093377283 +3265337003928417799194535821386624283453961529673399508105934582815314275613 +7678638219426069444953840237686338226443443810754745407998159540925231095791 +4375045407870857103723132*x^144 - 153719609646143637199240438779331521362833 +0310998022856189520090149655383700607165028197046414621578662674582267335714 +8666559983310416796564643262431404031085708670498514131879172395315308884725 +086995597751964859239544450069420287019254955379338574827976392*x^143 + 2752 +6304730305492309519611803297873567100995379403820014027217572772469997269963 +1748009334990330332456740707557146239264293783419594063347012801512753255648 +8881765170905842263824483323437412768565907107652500759762684840263032684703 +37380600828996170962184046*x^142 - 35523095157828313337139462591351702816577 +1657314332343178845563474958542277571903631744992145135630234735095041102708 +2345107273636547410151070834277389339249300538652341339871040322822838485719 +858336476359261521139254885461283464480406069617193177086233150446*x^141 + 3 +4465803554989246489275769454764022910035142135182748059069252044933640478411 +7307420416885830806110765171489332421312130211574457885515807957701177125587 +6661225789242989640797022695297712572706533434600560766081391785453226598427 +1205078552129981020849945722662*x^140 - 268373722516115839581073071008494919 +0456447093682830001175926782807962713700083271168738651540876330140533486735 +6212670696857859739463338404796759488859624213038265846572508064515479105995 +6333436847011768914542767112707721040710586854450242752202162514502517912*x^ +139 + 1742444297891369493991077844263622734267621349666334184372478600323885 +9274274057411635646353155281298451648136704209002938845039923935043096379256 +4945721786177563429720654144039386133241554831725367065310144005542392522004 +1645737733894132094639323829473024157820*x^138 - 963039078892037951990470202 +7468142690696595830419680618831266273162745223389393610063433083213953579433 +1498149151107810908751113241849208570338521838179678717281819508263987198750 +1951924824700995996767534695158748257780864272656666861530432230128739030598 +8300028*x^137 + 457447376242160839222865523212081512251204172769554541536513 +6010675335568757571514112103791600745366139173664147588418919365588570555754 +7201003803879915712080042312095406320055413204732204964260573379515119902554 +321889204610298573371864198642424001195728006133182*x^136 - 1868860578136529 +9491100566653843653174297026478659238845320831747624530880395790502643308730 +5462268585078679776019946603866991516563272428283420299615035631054324035580 +7669631492489263529234747091359176119230324423792605912297491073916656362078 +32174634098946284598*x^135 + 65093076668803329116252899967129264121954195081 +3165825173825622033622982444205859242607493663511833086292972086895883603422 +4352287091011138657074487961579204189764700353920301472872505685227133477493 +45517047708745645767806883427498415677547239236298519819304443846*x^134 - 18 +8737857214948682414768736751123125995536055732425264657481481197221465136381 +8263080004881765201151009039934832304971738613022285488660591980899059758561 +7366670880266091842937662126151457793355558304191543211766144762254313419741 +75714575265820939899419742919508060*x^133 + 42953889394645520155740965583894 +8254975167613584775116826651538942451816286881091436166450578237021021126058 +7376408754507104013237607018922017023401049094197048725524392809860540776061 +0681787413121689140926769612819886834513469809393226136437731088172895759675 +25206*x^132 - 63261727328918865906350940397161109868277289808692349026207015 +7309911965921420948111081525007085507792610014228611379115265836635218591862 +4482685303352489099685390524441351132050179570452776530090912230189731431879 +125807895290459527651483474680605068851138729175634*x^131 - 1119917054839792 +2751688900486058857057243360132605635779686384574213339264438353376214516815 +2207498910643644483743753772520064969246600402986900436948848152659373181329 +5043050789946887406470007794027558566892567839570362080341591028664006259784 +979214096682612622692*x^130 + 4271314220049466852560738338393246245128105321 +7108326600567680720579375803199815405014779522998261575404021302604267102318 +9973496984002749534274370752056057799997646445393423249459072172570153388076 +90270224780252688493775073451490812831750493851260007482523315136586*x^129 - + 148023590100710673141860886464816208028643509093283015533625006596766946972 +6741578398020050334876578221252235677233082465182051389340632694789790351225 +9115953643872578590861494318898368229141353955324644187699428307147375218229 +1248178529493117079561875143739124185634*x^128 + 246175641614565897679653848 +5278045743286736401969417596627545851445013857575343959525966011452777041860 +1869322995580927692188758796260764328940765798775338277071600497396412898284 +6342663264119335560750008714258096212502569271025201095741906534219351860811 +124404494196*x^127 + 1990565893680671595442880060323376805411690898242032023 +4239133079106312028397798694740007864603898415855926572783576585034622967997 +5575446479539827712484639591071048813727255731760017261708300771575388890158 +591817638333201062459001177511936169630253047386566741135222*x^126 - 3016573 +2341675486865253308430441797191448447887193219597832133129727214089635223501 +3420645212244383261917032590855201496548201420356430642227248391186457171733 +8876314939133108407277975244227776960656325124355051502725255975073566061339 +620994099300340563608380613367050*x^125 + 1257948144362960333134666662231940 +3520935251787268873160231319726921665830921964289640164226960267401382195941 +0507546787902030963701849030258171787071185516798073095493413189997247441301 +2363645824641255038770075189157898962912949013449974648054148641764400320533 +8871882*x^124 - 366475271260105058017315536083033948306360270631496526170966 +8533370069635382315040133597595175856841519762702237383805014287542574172530 +6210807276260801506088986006283626986882464595447299254658758485568943925875 +853699462405048328247959368186852953798221740253247284792*x^123 + 8471667404 +0018254168541029547267006611224730675524513635334023354380604251758054675593 +5413776225446989659313910683079873583112382327573250917778108062870743163021 +6965584066720515779759514188951805094972301673794254962048375194153324360075 +8727975735045108792516939770864*x^122 - 161146935717428461799784793801173853 +4799737191324944707968337975196134044400893575466678041623869973266066574271 +1435647219232676062975775017270732119064549881937724549671623652481177104960 +6102487507016989267838733791065664530366349655384775511706599600386112512946 +557632*x^121 + 2522694849864480951479825412582961761101029175375006299005032 +3620295897587695065324670940000207944207812042399077482469097012869133985212 +6354595110186421998141347799854111539239085705015451817020704883026517132793 +698058647769011690212936405831828960609809154392310067086*x^120 - 3123954350 +9500414655822246820581466016766786100370771446195101114970617420873338985187 +2315673998753642061765284674623730429562551231647203516276142369010876697525 +2061798837483708658347309888670578337964579148520979957165473678360131302986 +17785547855899873691057926811306*x^119 + 26093073450128435322247521043157618 +8712392067239030279298185926981851613832003883595362112194063431825921469777 +7131659026396971729721032938463093179955600695600080670675651357367571081793 +3768796854158042814794986008423382503555686761603718155957955520619915926285 +1046258*x^118 - 546620888417310306456913297002373587712583541328636451073449 +6886209350963457906027266059482196156973048570086277940148682564568467798438 +0285254978737341206009503937974698380503149962544290779617099637261387918629 +06553536781663415296571417609896418531671323802662549340*x^117 - 50182021729 +3272384861232464186597002893681068429473599603378492391207630929901153313074 +7556376877685127771266174954090809732508146930392545806488414232849981602588 +1335383921214771830072947665323419883309028215410288472590477875403748309525 +8171403839074803113722901930619*x^116 + 118406103336876158577917454186709740 +5449294198484094378541103762383848536861007244183348157579457933081098099434 +7987985778741196393539613217121527222032672240767536916435194526743758819619 +0063225181878442213678933572194923238652257406338724947439730929871504295850 +1899245*x^115 - 176734272677759520180709847378647130652166835479092271077232 +7067981192822476939413912953115815829947318808933249885514336602487836197536 +9611127131928890515684844943744748937382837125994011164383657897820620204611 +77419977223148716322298719262705865767989172293892727336803*x^114 + 17753024 +8530519942716171951800965388948822797211110233322549229100349316200278964800 +3343785390491378071036048329384421918922891522117638503012421231548652255160 +9599399433846703918342084346728100760000876417162144138571778762943474072695 +63098844605653811371200441716482612*x^113 - 68055808039422415389652936779491 +5026270001374161671086886435342385993661681436002138177107204224273906832078 +4550021770688659201646483026969760576245696112286845508450285259619203332272 +0607576466516522822599227539775561873960850804338603845784871088630793662781 +4494090172*x^112 - 171345855168993153971261857965957509597335839923271917993 +0591415159154748543112880240425751510004701705465610982555391151034624958936 +9879115829869566643976034053215829935761929815383663545384160654490729816046 +26649741228358475390951398611771434975819632467920927623648602*x^111 + 47552 +8035498943149856772358089912005247194452214038396267610512853006205877224336 +1926512880782786766025384282981294577511242497413537295024045772317451006411 +5818078293866049727834002439604775548744427611299658913382859972919684056285 +23953865800092933414124830547621130787*x^110 - 67242845398127603346764378735 +8630417913935967603492325560313387832908161625682986070993808856191981689362 +7337618874976711707752413017492294772666895660870194024839210050819796389750 +1107885069331081963929674153546422780993129544541729439872603263786386221427 +59365186532673*x^109 + 55277967193070494108505087891929956655236889687657826 +8175977451438771610569912425740087266827286735858716699401268464277514456005 +1393232906738794805715412356740750890873873435323228244674952180988795091974 +844777831874994317609349719963129292674653332785827444869904448205*x^108 - 4 +1613159149582603037007821378021268206873842361757130321500129691291418451571 +4472352328413744363607247454062853765212695133675510221970937823367502714872 +5264869179155436190999803707918965482858909915679294544758294286168029187155 +42674704594105656661109974298786084926216*x^107 - 64968550520798695907403393 +0416095844971770756779773877908365468264830766792721054670459397639118998550 +4854765543268865886038920660387928909044011453689430024047009170672072811027 +5782636138143658008315348604258233043465414839888086317182504579245353574551 +48087384017967480*x^106 + 10988704303885892826315283975311210242722783884449 +6602821133827001873720461030281740372523131562861261636562127194114761297380 +7567084209038324237434507186912029498523360122835533024309739840677831689412 +3866277910335992520712968840312446267340837533424627065123680989778324*x^105 + - 1037769081322395498728280928797930421673181636784651943232652987200370379 +9887100753154281880152957110034253066824316513009332837888828809575782813589 +8395431699875068691882278140209738486991188655032931569583339555950811469751 +14819216369493334147767991300084429910831005417*x^104 + 69810186616581919293 +4087787107108500858284600224749854536503416055380938630777674032345768445107 +9032740625501338477163577149719360331436837611189692791831261366092124431433 +6123841173727343108316374825964917374812406255193704152752318584125714566685 +03155908009579048097943*x^103 - 62618742936856051264116083169826991776205278 +5386210430790988069604384137878194361389699073225403863192706786752381073990 +4629809810678656127043145873535279223707645117591581849318483810783264428888 +878968101286898381392510682070079334990623735577742545874102235967038827767* +x^102 + 88547713577136747022744956480711506392268841458610902634308115200722 +8001393811863713127092848888453031249274119846056297769374759830206187529701 +1903856417069237945552069729259203293736154678785007420066778201855082685563 +641521979888163226986534911148352808279115809917358*x^101 - 4630158507380629 +2388093315791533391137484806668109034703107450628858742143410102799736933423 +6907074978067722826731138207487756769203481925052544349731537665931451375605 +6491082785764360244007240454153410730447743408991269401214809728107755411693 +172395012634341107448006498*x^100 - 1987106430336286502255096633621975778269 +2749388116010785359867801694785712027822174277716791024889732874123796999017 +1165326722657523135611227287116367063127157679861619224054599116072941563451 +0018552431779605085569288059085092991937490866241369045567079522410549051673 +8430*x^99 + 6116111486479868423461963851524196927490094772654137109281820240 +9655601335862868609893744275312622546677599324483201519748792880440223783865 +4698142956751915407410209991596924924552268184253687896341372281276522326101 +46924043615114529192462392320461821295874662972625510705*x^98 - 858543407202 +8582480876325305001979394403680268817452625497746550339718414937826890236809 +6758090513332370728027354524452052318746523877507900393006790670253886201007 +7151654142173689494119764321155798594114038476768325934248961469594904974057 +82950778627016658691250674749383*x^97 + 490657445429729269017920968754688301 +6620517611911217595219014813015157155188541123765870476789021829481317185682 +2346556428383215072814614042291152340886085128841976463982340477579191182175 +5499560251631802981685749888173758813318700520169103214089237413133223676806 +81136483*x^96 + 588480356039113348615320015128938548650997950279831325677040 +1070851758771375890193257175605171144175873327958813862484089151772708967824 +5090710382325088735952719657758536202632425695397040762304230638936597396706 +141037241892685559313526162149365318736429347633086308123732*x^95 - 17860801 +0792691455581088588394658008616948993017279794644452692311940825238452683644 +2319855428360563553746309477403369295008059059368147822762461583481089204503 +0764049052795948146830428753094428042821800841448746792034840653376273350188 +2132907610936220993092559868115464848*x^94 + 2080698898949934438755286742414 +6744709766506973468237223938818775848985645787102709849630670421667929387077 +1839075966340916755041077369098858794090822988106295163721588178394959186872 +9508222800790599280424915420728365948473247641413622178547384599468880111768 +92625701864148*x^93 - 855864218009308575944636024731111359775112255204531345 +0227262959123310950664276060293965525931786616911167403341188615339530286675 +6775269831884121745448799689118137607558616438099756213430487533482486835346 +075682903923880766231253716972279618549611306311532332784130069552*x^92 - 13 +6808840532983525733371616856915983783270410509211401019532102689258560876086 +9527424128221769318567475482882108641281228508725452571176264919548871309015 +8567261995935441375507973903437038954795573527871968541716126334097932463611 +5855437833626026464694567238228672113384692*x^91 + 3083618181674886298656898 +1166117178805224503007958449196073139881830099761716540415100166992970870487 +3373126707079788137630463247890473378063608477167239399012803238136948080412 +0312330266139820196748423629961267609185986608819581540758534872341667324689 +62725982670350394704*x^90 - 289813403115309877208771459417444034084104076525 +9424539591515173961928303088393009380304940043691096832523560373895822112785 +5808066054703063840814273369617911574459101343616657558236169574623914019563 +0152780337575962071156042744164046198739767637262303611768624103749962308*x^ +89 + 72613516630962625965473064217525199676649443527570426575481770740043888 +6779646591936295747831851104939101651758342323554432645301127945581635380942 +7667424563537772502070799105048465507245059623491244896462413185145901940314 +5696053808385861551596378474452839548918080875392*x^88 + 2007137579167957439 +0719911721927558340943820520648172319420534796396724837614574044411853430783 +6722420021463109835306685189533078441109841798470591234934768692554906817588 +1207883501035322616933512472492706367178783380343756988188031103657790713917 +44233368892636267232901060*x^87 - 341583527690850438763926482860330447741875 +4305316360798807536901393938873869395520682617524619723932218997197449552997 +7902796418727196784273654618816384850023400797434252298928612530838816162641 +9574193744111685493591811397803624718762999077541037470623557200013418602943 +344*x^86 + 26018106816532769824515089189721783374074645569591071162155828403 +0232272450337410678138897855399057733160129008028400975157648521806369052132 +6598794386401757044711814737218799723053160173284842744313272283592926991658 +43454191912138368855662104946473338105764358284022377572*x^85 - 285687497537 +0233084322274278589877961032877493803575239781590446839383349838850110790540 +3648812210524131836405185194224569727115488819662642038492004860753207681555 +8064901322408777764393214575140844637199884061193474482510361153824419358509 +00211274244171508240172003554579*x^84 - 185573110599032244389576804101570527 +0843481327670529736455724859117579642729259313496498283495085435901054470028 +2535196961772216663035884293412871166129440632779930980074617184610893507366 +8787347778013694399060652311121162557391893749324368007933315027120013043270 +445299679*x^83 + 25050117171467230890654410834087578617559538489554781281579 +3157881185513898265592143907721703598168076058572348175071967137401886379765 +0888321554412070999395502650926168357968511833244292802087783872357923454661 +96695362647033860816591741894381954763538781291764410558313991*x^82 - 156624 +0805166486574430551541640026858587070051407347684313586931160679067646271535 +7829110559493831623647655992465253608722147473274284815377360979913488645232 +4593004096825642014547164807256580851492214151707379016954878586353260655456 +252800749153240368998676635038282783458*x^81 - 11012223211385811697215073324 +1921762613953353874156837170764058477228457541142548719349032469796569578235 +3672680465156231420291792630380279912309212851197963260878119761617542365940 +8318430631980819407521411635240395800739279192347581702754335107271855384807 +48046492479002*x^80 + 111235651556599161905998900669481587907856029607842384 +7058721145611490097096177499329308286485980098377201553695581299300616429252 +2896328548114223502627261314995818846022537138353738293647104367494387573394 +8393580977308270455034395646105894483336815886915572733813700662098*x^79 - 1 +2379020348161516025309044646747619580648761934003227421750700116671436042176 +9234916272072233533611217288217765756191391217561297135624913793687875324800 +7048123566476086580476470670309837456621193106958657582668447487991539286833 +57031134988178799550492266664939630915472321*x^78 + 644986875872857655262996 +2870357260072805613051355925273289691398310869281737114462536081840128975833 +0126180055099077158183624456453836279081213829170321954905360807167962624432 +0834840220201004905145194463702511094693925819892194681047038159942946067231 +75356042055357536463*x^77 + 632358398592670498095591997355631111077729590643 +2790651615164768723582162467454648690012209970035792209695666782959269273807 +2446931808206460612526556054521554052793022216016750971388084812894581490191 +87488153428597505906544272968607176655503312813518126744417345713254937*x^76 + - 4407859464775144416487947396167367671725803977033500362272840558411894622 +4142347820758760948628866949429655387790156661766965605123758771588193309114 +1713374027265271324050920162934924792826148476476160753572716996003978356956 +83804000368513801138734053137773265487620770740*x^75 + 416372459606780296337 +1450264046151575655550849081038974416037216542290125884466463363808042083850 +9725418382508403123824265992064946980309513636360132567064198384175231861989 +9012223863450049443691606628550828159458118620199310401445249248178059313891 +70550354597821348040080*x^74 - 184161864081127040151143217561783123125395859 +3984003709177376821791781406937773897678496561663900933927169138471529228790 +5120635576312602740572720848588646957621039854850944227105781066695720878550 +615756344477554232044466772542846688611602947158650463473157163999798684880* +x^73 - 294578669269207164351858864041819495442047310529305439637416055593898 +7162766090787137613214756965908109965354836546249973970248312691190106013609 +0096047571535265598414402965513205463264379299412109566296535132357163168956 +32417972107859793797811490919775354115913639814509*x^72 + 116883470301786694 +7940105919928790584076295711500240939987022716541425069544597244574520104343 +0843831048650119597248348399831622778255382707463446772861932339155184508820 +8691492120804327123688321050527154392082194558601074437356409645501206599517 +48548591269958013706855735*x^71 - 962337617562843751668517056379887654984035 +3607775335999245012386540197534720757701144759975007037123456361469330484819 +1315697282222826434358396253666199318705803758613569124925030815057449171128 +4560115497697369485081240160416963318875432658639303154335108578568393415001 +1*x^70 + 3726752627853214173014791913150187098796942009506244634835348186874 +6218248319652489347706949219918369593434279794434225414007742000717921598981 +1967637764507611718683775885631603729498673872931482040372125187697058620137 +8729901384977948736920393075869570682078658147246402*x^69 + 6664265109721472 +5027167403028506905386766457143598965411785702251914095207487701546804662501 +9973661173639310250173508615816977744154467727637322113813424769329746934178 +2443037607433520297691194068563933234561377974297855282622664908800977935892 +66781529161410379918516384*x^68 - 207155588658254864820236483929333843353850 +2314782709935428769719703150188593756759875477634107095955930003335004909963 +7806096997987389425073233030518177133541278388985086967790086225554199073757 +9183726492903476789901947898423219398782945711055270770359481994540571424130 +4*x^67 + 1533378023324702195795907021652744267401738630185227412509325644190 +9317029060634416164456507736338956677716876820335111092883359676091733924360 +7562229802747370137957394804745995747839571913841959663322372004062970960303 +2739266325572053308062722007360886556152476819257995*x^66 - 5448017961352466 +8954308761386777114515861425568699050923629567132295720176133619693154821070 +6679446412666455188970580511515741859257380970964727783399666659463150181605 +5832418778533170218818696428046565610812780388008951253152709903494726503303 +47825776795872045310257331*x^65 - 782824212320460720852470872605130544762708 +5270844370030560427574258798403117425649643063954946491985881365052474110155 +1061361746263419716606571746236356433610334478429319747526941053865615635278 +723792660268903548758991779230812111021711115289261014249648789576891768349* +x^64 + 241834633150739573689757316859489557852802058328995612290604847372968 +8962517428202844726500527178649942306770989823832330134459212595922531552449 +0113231117621334324551438466322046602200466264537273693298034252254721421676 +4952766269941267448422272698762518675998018630028*x^63 - 1666339352730570520 +3639407453322817405171376787484109204948738088424073980877086807482951938601 +8865103399869046069476520137316208493195695957902129110473449041403464176591 +9862359175005557769808809061623387720644388156956972127266850675533756707525 +90808120744985654078946*x^62 + 570449220804489887130193887685456156518623172 +5938262332193484731157547462002602737462832660959996983966122744124822282431 +6513410409807491982186685917971756931992668327222699312497837591559016609364 +497532211515388699725043424503916154248093353508075820460159560673674726*x^6 +1 + 379845061301619031112865499569621029871812941926085546779444789597593099 +2185392685054292994780700584857914762885227739218300244363323904098764703684 +3361325604313463057739669057343485520202139735014463468397975802705055082320 +02067235766810391945048746973605012517899250*x^60 - 179994905002158006799826 +1581248012266767598208187591516407746996243019260988129520947344375845837479 +4375473622136858584586366278763492407789131148115802682216654123834671962143 +5349323536462397163996997039950567353507544138641982512459740031444726096910 +94329488186488560*x^59 + 119982265165997044452636805135365752758447406488957 +0849779495733478576958767846719905517427473004995721810584114866176087023280 +6873265056291159390228424704274613300367658551594974395489222878733856100659 +323368722107547660243619913236809974787583082322603729616639857984*x^58 - 41 +4498343303395026162273181308147077705273369693379285169454980456825999696414 +1108191789225342382926105642661506635099783996258510012027273821755928691169 +8167108483458843302305307979514403727827680023751217095370719902334212472094 +52432417836264144119102122277397817768*x^57 + 151296257711150774319086699562 +0621904293538949888063494638380250947255821384926730801679647950967103397199 +8232664074317796747475932212744662087954481765782241246318995396862540981468 +8990486802544852254612284845621149784604770996714678404380352987098024383778 +212981782*x^56 + 77172024931648750131579375330854241317819193485030367789630 +0194979153932088946756095579709069441269038355362032598061536345375371499825 +7603589364289068081989344439616890875432673156016666549955986167393531518011 +67940120441305635456765616769010583292909919688853748166*x^55 - 533362214813 +2692571383637474154386631336646003027379100089536309803633081806433335487865 +3788348099478071550518684140405592181062300213393211342562869431261195244746 +4055597603055279266341016276936298547770626014341819185195774706572228813839 +188337921892972222814214310*x^54 + 19809672028428641640899800622402763302466 +1074260655961612294389483118237887223011979572958763434751014838641676318160 +5147310285574152096915663041869066749730025370705253261451722595574825909044 +34743256388662636089294615411424475808328353443007431056186153291193660236*x +^53 - 3298236730725312112107997188999732021783635308764336412988146411506139 +7104102160872908196077077455976298299221998872649597890835291998156291479044 +1156752915907868097785637632834657415730880385603530195196698224915641474164 +13441042710366926553820042101416886262527990*x^52 - 101449365782699643760207 +3313704763252338242187697491537141888115893684195480412346735267432884547401 +4326674844047109008343871306484926351769633249049418818884494773111342516465 +1364847880469035878140408781793697844423605606532175548895998431434178111893 +10391299541374*x^51 + 997010027853800903810835659831173696396465410573075578 +3905356009776229418935908969084901777161285772610734056245264176199983282362 +9243150822898802087782083582569387718010137408195023053062329504663705594403 +79207927321560114457596629472924327212630999737789491694628*x^50 - 400136364 +1205954524277253466159627211505461211798229164611000835355077955105452940106 +5043117114065854192422518937652264386811681003511656062957851230278085993229 +0192913573475644905186402717704749806127538925050731511982133457968662243173 +0574757902251581738927743514*x^49 + 9180213565693093847510479570029388499565 +5962139940688297118935762169143151779122206282849955988804045093690808202777 +1911618936765072016334219087961215540705432215522135777876375064000492729289 +146413824719753030999530625757538495495631483556564886408485696916274754*x^4 +8 - 501301210215460642688466550524464459820491039666763299722186435065388308 +0998476722426260605286629208716991084876566352805637002187528368901275570021 +1644840502467709341605696416994819511376212841122712589602930316113642419950 +349056502832731819476610421210838732740*x^47 - 54944298141158889585149685718 +7336779616988953202758365462768772698687661348560047998087075022182507327394 +7519184487938281971887003668567460606612213622645012761958365390879314022191 +3390146402903001771434654731924912308476740943900732699364805260630537589779 +248726*x^46 + 26686242659774581832060629132908634079744101584587342617793147 +5307484074819549903437909197788777407246096377950996274109900334593209284669 +9285933458439326397108293597155087876694426014357663784876151672816297841341 +0567270026180297395204928647366053260719567023642*x^45 - 7052486107172135206 +1948720744051909520509772591994862049253916379923010961566356969081325001527 +6292596993146766741009335610467932996827331500592308883886627814990767499859 +2394117000761761120597925240350755933951486120638079133147944601048042610283 +120648681977182*x^44 + 12094887988138431717848391295686703675228636456392942 +8682928139939229340261144090919567211768947492261796729623549396284079133495 +0340419054279131563933305486551030416968393033147914495046708454093512499973 +890279938140031139050906270219603864516933692949758319412*x^43 - 13249348861 +2052453833911384927269989662957662727807923412036942065407705141769113172260 +4562201840504522929158651370739513572711063413085138434059101868053588204820 +3501768317607444088231087593813985100365809682458092656030031376932623184206 +7770517384807361785676*x^42 + 1335101451287203762576138569495941477971504274 +6021839256417498499034598980956043459656243655749784623012085862698394648682 +7521666667680743107938078657228707393173302010891133955653957891206671708545 +21488797288438881522832497235465398261203063264934026405622216*x^41 - 499475 +9281308667412284807719782367452360187792248198012964464639579785518460647882 +3014472001994317756006942461078978073213429085061547197216262635883812900592 +1762751571689421659752686372945957018076639346750248956405331139984740983345 +9224825604519148808410998*x^40 + 2123055922106609642987166390747900882690095 +8265815080171818541132693855937048009649851884749195950160943998565872859377 +2466719457136622623105718221481729397353928547971338648745934933818733937555 +9722029289477935787063071140468460122494931142480075599166922066*x^39 - 5735 +6058097105987281579532842451121455107789722350655401468909089438850594255611 +7398406496524366947519084716044767896958134185399473668974877433779111152344 +5537408221196487932870899207582741017935334684933397499648658504512170298450 +81211351675478818348250014*x^38 + 101323645478522769412770862955451494838700 +8662851023057079588279613730397359405727823936580260643332082414004528447161 +9032650746240307864113277781931187876839372237162972094621638339957461376513 +5960868446031017264818726765755631590746592742117108410287162304*x^37 - 1158 +2691707749694320983466811601420819483438159197492729367460974781919497846083 +2310429882055944418973561703899132956324878554694827218593251972032733158957 +9073374625050919799091874768764116278381338067763168272226788014070435497357 +3342854568112725548119716*x^36 + 8305639013155526915236550603371532656184411 +8485479725403465416008780582431421160189594698593377625798613038172701584227 +4206678281269713323953843252700015484543752538426082787722637328521354532797 +854400197712614233087564302182567125978130820395479367756272*x^35 - 72553146 +6299857240224175450027827480387792541339702494044488085609115659954701904593 +4063182032757400157986647557124710638076669642745888083114891044280939887931 +1080380921785649390927188469314188121124356596001115383235298455028416330896 +607528890361908254*x^34 + 19860798394812096491425064118869331882474934679022 +5013755600349219086403728983462588925205132120800514991648137327905331386108 +2705026046100093497647310070721575578185071569257102022328094661667732591461 +4871110127674403701118049341045392289086401193314942*x^33 - 4504073630957286 +8996977652497679946908816176921415580423759147328165686549644634042466661073 +3511461352309328969240076472657648713663010059789108519959246932375899814162 +7806075361906437084097330297847347043691634727928126429902493759079959944869 +550465866*x^32 + 69070920659658480551690757737221770374761684950145185121047 +2484618737300993281417864275556465857656908421568917719365815679023157411215 +6057258090256560697376971566576951036121500346489928053597706896717897892051 +06698965797835172312757476105925970954316*x^31 - 950505499088700807538705994 +4852731534709761992249213459182019380991510107647264892021396558868144681611 +0662751219780692605034863184825513108322135455467480199290708985357993844600 +052787576017748490330946803622885911462082828385374632295839177766961104*x^3 +0 + 146871001034451764467214379577713350818960453105454365246878113141243396 +2615951663537883759634270986980824512323040156750516514483187596408739659469 +9598984366473798855873087478723052705650039925818705324797901096311128210246 +360020474709693712139627212*x^29 - 21967157682673292571077015450821069674087 +1544590587052875727692154504672915643984006806321437086319058849365052767208 +2180148377519601579902888730828514202452285184145954435822512134773040530752 +315307032862652438081839581459737476241460047819927741316*x^28 + 25868119256 +5279242165718547565481040416951897690007278140339301372610232089805802058986 +0750808024571604981879223368087235334407689838584104951724530561739372122119 +8951117323168039502216475583876368959953874029365022369810172602125325497095 +6445408416*x^27 - 2428059268010321918244811964086129262156487932219116205050 +4070649327791508268466838408282079070232219613570494028527410574628542390142 +2207371899314254390315983442044698383945383757774385604939274532392556556337 +58840387565176697754574091764000708652*x^26 + 228044964584692160131546765047 +2366230486843363280069375103638842382972106217168205477299195570432297721283 +4433913421328769323459813505283451769698919188569838637736110033080505201432 +29246149018773191614239310593408598408683107352357568527200654044*x^25 - 240 +6358660663137122033270184955011680904324977408022614274765749948013776439046 +4906763369553397919412224096925386397722165397929814334230617641557808733911 +0574280678118160005286224756835902809740658092872319513670690482675603106255 +535345368222072*x^24 + 17662623687632442866313848276740533318473562530568602 +6085380981148726634500393960831149553262597329458902932994016704916196167706 +1802977969263820447192793617562366039417910781021352992596284460784056551089 +2584667589514772071439777359014056460388*x^23 - 1017233748361584303945573233 +3032677102808866261456706104325822118295706056417248083910297875201722536975 +2472365095568346621934137039403008509886158851525905826470428214804919613199 +4864749556380390451533567703437432891192535285335888731490497100*x^22 + 6962 +4456632649901142038343508876142609309013148113719161965752973745996685396900 +6242981394546059022035086880100336674301708003625923297490632324135942177919 +6475754925837957964115788320422751182797666627301620661963625816748809270833 +0371586416*x^21 - 5935499297476735425457730389595586123363077244239039067258 +8757027689826646450579634779345685940054648366379750425264531723684895242726 +1296842788479967443307602969542957303586075752713784702233094467073009888400 +4709831827016377193151480549079*x^20 - 9924231276887632055264945002835855931 +6153619298064184888082607712523327637455849379369518935749807342918090562216 +3515240369483362753072379694694969114717331800146736581921176222284191504989 +22256734920743781356158658426818610320388361445943*x^19 - 223034910041976985 +5872625998444601823522405237422212480311276936526222907234872314934718146257 +7999956125097315186127418244514895084164378747477418159356551630505131305135 +965903638935951781824035858082445936492127698502477328282539866049529*x^18 - + 236643075076678358536974434180237346813030211220576398492261042505158468477 +4245106684856714329733460194522211899691204030539339797067532556065266564996 +8995125799175143049170891303055998502994776437035748429866958228412329271509 +6914727786*x^17 + 2542147127057127485965235153724151047113766830500853009593 +4057432271073053439213859505464662101818485064985498169276132525055092922810 +7659183430955698520972071635491614118402866501132808889569521209673251362824 +76709756655755991836417802*x^16 + 183111149787713493280210397619912322103096 +5247871179773154030195420556994309371058325110985700072545919333159157805938 +6224014037352998052003315867311050614119923950889255536852768279112155091364 +24174340648729576596630358137790527045198*x^15 - 449821041069912943789836264 +5632599818971731559621159648780555694409049475593695526598586098851324811318 +2519341945707916157927951713037252573987087918917682037480599453640794209186 +225479459166338434922942612532823032751347335799704869*x^14 - 22982911151946 +0414712287398340054262339910173840391365052883789755652220150460120847132485 +5387525455121237089427182900348837425717452397567606502432587339063493335218 +99975599619910693111772391894198334123224235975702158966025975889*x^13 + 425 +1167449102860417605682557582269062328643891986101063790164447568501066388281 +7083671619051397999677516644732430950231634364346445730340715448369087696718 +20523719962939869299988336933823914482320626610429276999595557594057384713*x +^12 - 2634769415254884935578685134629261396873246071233388299830258283684407 +2876185708249044979665212650744995875688959242932243838420517823860588878429 +2448997291893491640954677331782979368685632076417137547307030222199889038379 +76940*x^11 - 178196131047104477494733878949091986680056821951080835036094383 +8004052330411696017910506157765585633940095861000688753523141138483928490467 +4511256960034750139170510478764583267207761340591670181326537548133703111264 +9106926204*x^10 + 1825000405670995013845885918902187142186986666482440933839 +6462521386957836588377301330171147216240982523247505481312286617417272521511 +8638399348219471080155689525455946137646839420547370091703312293991788729921 +1491191185252*x^9 - 65201626996640512322761674559318066561117950070675294766 +3169824762769899024352909587195016688965354038529484926750838814982572946010 +1979637110489360349176312329919783316622660007379629280095704481299477431710 +45016069129*x^8 - 1437891149083999662420144342263678250208894256538560561654 +8933951961391248431401653150798776891480895285823868174684751112400557598552 +7985918610201118598268431458892734242196304467884366814923258790382419891488 +25558929*x^7 - 1428280930363758251384969101052572662110879466805595758704451 +0527911033933582902662199662263051097627055254401259144549052189981714948608 +3243967370749726951525986876271444939969618263711803265644040382245363794511 +71*x^6 - 1170826372197459055177820600881979710066693446685651498813175990981 +0745762172031150515086932467894419392120220600061432329279936873889655682224 +7191725072125442393957901078704198243471395495180025340969870794174*x^5 - 11 +8223168675776843350634299306552668061864957826207103017499838634433318705119 +3832689526795798631026606743575718322278065328528551578753575871762638217620 +241416850427234233281589721441720700844787815627946*x^4 - 953048457007008296 +1795451881320794184817199918350969024576327248906812630041977334151670173523 +3419849726478663631547211301749427543946011643243124123502481796513891248511 +161398944690550172434214114*x^3 - 254706791524256177472181318251041912950779 +4390935955929617768730635253624759862293118182940797954335902313821207678848 +027543595348285081414397619295455292216447729433614628265514361363667915*x^2 + + 7114590568532928191072122754665584122789751912529693393245247725975835948 +7615527828928204048113*x - 1 +x^240 + (-15*y - 36)*x^239 + (499*y + 430)*x^238 + (-6344*y - 983)*x^237 + ( +35389*y - 20411)*x^236 + (-40904*y + 178707)*x^235 + (-424808*y - 438197)*x^ +234 + (1415485*y - 635208)*x^233 + (1438139*y + 2974605)*x^232 + (-5864817*y + + 6566480)*x^231 + (-25462020*y - 12961894)*x^230 + (19238389*y - 79956654) +*x^229 + (247313433*y - 30224897)*x^228 + (294927621*y + 801098945)*x^227 + +(-2353679384*y + 1069498319)*x^226 + (-3266832488*y - 5793469739)*x^225 + (1 +2761071756*y - 10152009124)*x^224 + (28891772141*y + 27706877778)*x^223 + (- +56780498004*y + 70327470888)*x^222 + (-156989267296*y - 100643285180)*x^221 ++ (163182970660*y - 341901790078)*x^220 + (692925090103*y + 282970748175)*x^ +219 + (-520851483678*y + 1249500770581)*x^218 + (-2100987167651*y - 97780636 +3155)*x^217 + (2144907137575*y - 3501192827999)*x^216 + (5741131351957*y + 5 +368774573391)*x^215 + (-12949633488740*y + 9667592872104)*x^214 + (-18978818 +705192*y - 28988343801763)*x^213 + (61143701295650*y - 42854297857883)*x^212 + + (99522339968066*y + 118416217970085)*x^211 + (-203990291010201*y + 226088 +796680855)*x^210 + (-487486417978576*y - 306059642167156)*x^209 + (371437987 +605861*y - 969565907346414)*x^208 + (1761877237395113*y + 250996844693464)*x +^207 + (347587448455796*y + 2909203449118066)*x^206 + (-4262623171412271*y + + 1900082482875272)*x^205 + (-5112561845313059*y - 5258998337190094)*x^204 + +(4703077156935772*y - 10817923562329066)*x^203 + (19596724151621886*y + 4579 +71706716061)*x^202 + (10779811934500297*y + 31310302362591686)*x^201 + (-444 +71188376651271*y + 33091705261026148)*x^200 + (-70367728073948453*y - 553681 +43890230595)*x^199 + (58047935399898944*y - 125056052810735004)*x^198 + (196 +220179915190037*y + 46078797156864550)*x^197 + (-15612945533449050*y + 27845 +2806220656846)*x^196 + (-364966710997667886*y + 30164046307811567)*x^195 + ( +-76920393658091100*y - 455669527002677921)*x^194 + (569724473209147360*y - 1 +04273935104641941)*x^193 + (107554480539021407*y + 761016430421970356)*x^192 + + (-1120756441763956820*y + 138805435659787599)*x^191 + (-36744368496876235 +9*y - 1741313178847717412)*x^190 + (2626931562224608194*y - 1142827140366519 +672)*x^189 + (3001549496003468616*y + 3542726921147289593)*x^188 + (-3816304 +655625513057*y + 6563685064488706687)*x^187 + (-12280102244383760786*y - 216 +9956083918876046)*x^186 + (-3280308295039992672*y - 20013773166146345265)*x^ +185 + (28534969871679714183*y - 14758677431499660732)*x^184 + (3420538527727 +7312731*y + 35129207175233160758)*x^183 + (-35562575528916824663*y + 6232129 +2808100809456)*x^182 + (-97526968113689340266*y - 24577168539715006795)*x^18 +1 + (-2924482708853224503*y - 135200656059538396115)*x^180 + (16755988046047 +3073606*y - 50231770182088582728)*x^179 + (117217186558944665294*y + 1844313 +16627662099968)*x^178 + (-175018700423712057769*y + 199325075624692888658)*x +^177 + (-287672838056258651793*y - 130006789216819808906)*x^176 + (433136887 +58928043819*y - 370488386653834436323)*x^175 + (435685264104825475131*y - 87 +230951613648934063)*x^174 + (260789110179489506909*y + 473346146286012258862 +)*x^173 + (-477453708065915165092*y + 475828532275903297714)*x^172 + (-73312 +5023480253537968*y - 445824632107486741239)*x^171 + (377925441616168009977*y + - 1037951764481934863694)*x^170 + (1401192440853964064557*y + 2712041812199 +21501426)*x^169 + (-116817470274758714683*y + 1837817520966021102844)*x^168 ++ (-2362860273074857968126*y + 103875680474127044027)*x^167 + (-421763202246 +558569481*y - 2985437596461812106201)*x^166 + (3701454711020661872373*y - 87 +8419497758685431399)*x^165 + (1521006793930665203185*y + 4486769840934475059 +679)*x^164 + (-5292413186031800428648*y + 2393646591871321675898)*x^163 + (- +3527560907713404811933*y - 6046342849737077241029)*x^162 + (6659475347960239 +461641*y - 4934471883467342725819)*x^161 + (6606218484397706362957*y + 70346 +33694928572084799)*x^160 + (-7071251229918632950519*y + 85221454139378375409 +88)*x^159 + (-10654172673396879304988*y - 6660938661086516468010)*x^158 + (5 +677741559220425296264*y - 12963319200223537566424)*x^157 + (1537868439480061 +5926642*y + 3975042669473795569897)*x^156 + (-1409491575820818236069*y + 177 +68498236629148702410)*x^155 + (-19928654122136236656860*y + 2108177954625221 +499359)*x^154 + (-6549200784773657451762*y - 21617243705895522615660)*x^153 ++ (22645379524677683996954*y - 11738628703873244299229)*x^152 + (17408053637 +884918322314*y + 22982504260819896781381)*x^151 + (-22809630522578701355929* +y + 23340226072231874490562)*x^150 + (-29550558164952915082604*y - 224392369 +77615542871417)*x^149 + (22094525765620020809639*y - 36386527353264595233550 +)*x^148 + (44442209345887020103552*y + 21630493829993114594971)*x^147 + (-20 +362621509381561401708*y + 54254830555411448139989)*x^146 + (-659133869795653 +69752671*y - 17161940478911028975987)*x^145 + (10842803083053018739937*y - 7 +8798826823995559998884)*x^144 + (91671114659094334230114*y + 699010605156960 +463896)*x^143 + (13121977610624125288643*y + 103143317388027280663819)*x^142 + + (-112336281183122778011108*y + 29666952173920616332098)*x^141 + (-4771339 +6391497944676658*y - 119352040791078382516354)*x^140 + (12522214489937288097 +8343*y - 66535424263344578690303)*x^139 + (86443391588395703449231*y + 13128 +8792905554584140170)*x^138 + (-138308631379146285689943*y + 1087117764446364 +01209940)*x^137 + (-134836856528001466894586*y - 145826834678543169365085)*x +^136 + (152261003156819774060466*y - 165525545074570372890946)*x^135 + (2000 +19883617103704090631*y + 155735524429003454571137)*x^134 + (-155214006426713 +875482591*y + 236255888142978579163439)*x^133 + (-271843213937284128310312*y + - 151199785544397594300869)*x^132 + (145501652264843306972923*y - 305326875 +506321100258855)*x^131 + (336932852565943631529246*y + 140097781638111061499 +104)*x^130 + (-135773050794564515416176*y + 368242715265481945864410)*x^129 ++ (-400908655930869378612741*y - 131401561676926670933942)*x^128 + (12442649 +3872813948801626*y - 435145712814328666799539)*x^127 + (46899879143136708390 +7400*y + 112351662733835870233203)*x^126 + (-94381628626117531492779*y + 498 +937937395927788353831)*x^125 + (-521540559152841029573809*y - 72188367562634 +255595303)*x^124 + (49231480359271694594387*y - 535280543629519838165745)*x^ +123 + (541321200409785903521904*y + 28961946371400127296768)*x^122 + (-12936 +229773088822436824*y + 542775176498979507958864)*x^121 - 5428178716207228568 +54615*y*x^120 + (-12936229773088822436824*y - 542775176498979507958864)*x^11 +9 + (541321200409785903521904*y - 28961946371400127296768)*x^118 + (49231480 +359271694594387*y + 535280543629519838165745)*x^117 + (-52154055915284102957 +3809*y + 72188367562634255595303)*x^116 + (-94381628626117531492779*y - 4989 +37937395927788353831)*x^115 + (468998791431367083907400*y - 1123516627338358 +70233203)*x^114 + (124426493872813948801626*y + 435145712814328666799539)*x^ +113 + (-400908655930869378612741*y + 131401561676926670933942)*x^112 + (-135 +773050794564515416176*y - 368242715265481945864410)*x^111 + (336932852565943 +631529246*y - 140097781638111061499104)*x^110 + (145501652264843306972923*y ++ 305326875506321100258855)*x^109 + (-271843213937284128310312*y + 151199785 +544397594300869)*x^108 + (-155214006426713875482591*y - 23625588814297857916 +3439)*x^107 + (200019883617103704090631*y - 155735524429003454571137)*x^106 ++ (152261003156819774060466*y + 165525545074570372890946)*x^105 + (-13483685 +6528001466894586*y + 145826834678543169365085)*x^104 + (-1383086313791462856 +89943*y - 108711776444636401209940)*x^103 + (86443391588395703449231*y - 131 +288792905554584140170)*x^102 + (125222144899372880978343*y + 665354242633445 +78690303)*x^101 + (-47713396391497944676658*y + 119352040791078382516354)*x^ +100 + (-112336281183122778011108*y - 29666952173920616332098)*x^99 + (131219 +77610624125288643*y - 103143317388027280663819)*x^98 + (91671114659094334230 +114*y - 699010605156960463896)*x^97 + (10842803083053018739937*y + 787988268 +23995559998884)*x^96 + (-65913386979565369752671*y + 17161940478911028975987 +)*x^95 + (-20362621509381561401708*y - 54254830555411448139989)*x^94 + (4444 +2209345887020103552*y - 21630493829993114594971)*x^93 + (2209452576562002080 +9639*y + 36386527353264595233550)*x^92 + (-29550558164952915082604*y + 22439 +236977615542871417)*x^91 + (-22809630522578701355929*y - 2334022607223187449 +0562)*x^90 + (17408053637884918322314*y - 22982504260819896781381)*x^89 + (2 +2645379524677683996954*y + 11738628703873244299229)*x^88 + (-654920078477365 +7451762*y + 21617243705895522615660)*x^87 + (-19928654122136236656860*y - 21 +08177954625221499359)*x^86 + (-1409491575820818236069*y - 177684982366291487 +02410)*x^85 + (15378684394800615926642*y - 3975042669473795569897)*x^84 + (5 +677741559220425296264*y + 12963319200223537566424)*x^83 + (-1065417267339687 +9304988*y + 6660938661086516468010)*x^82 + (-7071251229918632950519*y - 8522 +145413937837540988)*x^81 + (6606218484397706362957*y - 703463369492857208479 +9)*x^80 + (6659475347960239461641*y + 4934471883467342725819)*x^79 + (-35275 +60907713404811933*y + 6046342849737077241029)*x^78 + (-529241318603180042864 +8*y - 2393646591871321675898)*x^77 + (1521006793930665203185*y - 44867698409 +34475059679)*x^76 + (3701454711020661872373*y + 878419497758685431399)*x^75 ++ (-421763202246558569481*y + 2985437596461812106201)*x^74 + (-2362860273074 +857968126*y - 103875680474127044027)*x^73 + (-116817470274758714683*y - 1837 +817520966021102844)*x^72 + (1401192440853964064557*y - 271204181219921501426 +)*x^71 + (377925441616168009977*y + 1037951764481934863694)*x^70 + (-7331250 +23480253537968*y + 445824632107486741239)*x^69 + (-477453708065915165092*y - + 475828532275903297714)*x^68 + (260789110179489506909*y - 473346146286012258 +862)*x^67 + (435685264104825475131*y + 87230951613648934063)*x^66 + (4331368 +8758928043819*y + 370488386653834436323)*x^65 + (-287672838056258651793*y + +130006789216819808906)*x^64 + (-175018700423712057769*y - 199325075624692888 +658)*x^63 + (117217186558944665294*y - 184431316627662099968)*x^62 + (167559 +880460473073606*y + 50231770182088582728)*x^61 + (-2924482708853224503*y + 1 +35200656059538396115)*x^60 + (-97526968113689340266*y + 24577168539715006795 +)*x^59 + (-35562575528916824663*y - 62321292808100809456)*x^58 + (3420538527 +7277312731*y - 35129207175233160758)*x^57 + (28534969871679714183*y + 147586 +77431499660732)*x^56 + (-3280308295039992672*y + 20013773166146345265)*x^55 ++ (-12280102244383760786*y + 2169956083918876046)*x^54 + (-38163046556255130 +57*y - 6563685064488706687)*x^53 + (3001549496003468616*y - 3542726921147289 +593)*x^52 + (2626931562224608194*y + 1142827140366519672)*x^51 + (-367443684 +968762359*y + 1741313178847717412)*x^50 + (-1120756441763956820*y - 13880543 +5659787599)*x^49 + (107554480539021407*y - 761016430421970356)*x^48 + (56972 +4473209147360*y + 104273935104641941)*x^47 + (-76920393658091100*y + 4556695 +27002677921)*x^46 + (-364966710997667886*y - 30164046307811567)*x^45 + (-156 +12945533449050*y - 278452806220656846)*x^44 + (196220179915190037*y - 460787 +97156864550)*x^43 + (58047935399898944*y + 125056052810735004)*x^42 + (-7036 +7728073948453*y + 55368143890230595)*x^41 + (-44471188376651271*y - 33091705 +261026148)*x^40 + (10779811934500297*y - 31310302362591686)*x^39 + (19596724 +151621886*y - 457971706716061)*x^38 + (4703077156935772*y + 1081792356232906 +6)*x^37 + (-5112561845313059*y + 5258998337190094)*x^36 + (-4262623171412271 +*y - 1900082482875272)*x^35 + (347587448455796*y - 2909203449118066)*x^34 + +(1761877237395113*y - 250996844693464)*x^33 + (371437987605861*y + 969565907 +346414)*x^32 + (-487486417978576*y + 306059642167156)*x^31 + (-2039902910102 +01*y - 226088796680855)*x^30 + (99522339968066*y - 118416217970085)*x^29 + ( +61143701295650*y + 42854297857883)*x^28 + (-18978818705192*y + 2898834380176 +3)*x^27 + (-12949633488740*y - 9667592872104)*x^26 + (5741131351957*y - 5368 +774573391)*x^25 + (2144907137575*y + 3501192827999)*x^24 + (-2100987167651*y + + 977806363155)*x^23 + (-520851483678*y - 1249500770581)*x^22 + (6929250901 +03*y - 282970748175)*x^21 + (163182970660*y + 341901790078)*x^20 + (-1569892 +67296*y + 100643285180)*x^19 + (-56780498004*y - 70327470888)*x^18 + (288917 +72141*y - 27706877778)*x^17 + (12761071756*y + 10152009124)*x^16 + (-3266832 +488*y + 5793469739)*x^15 + (-2353679384*y - 1069498319)*x^14 + (294927621*y +- 801098945)*x^13 + (247313433*y + 30224897)*x^12 + (19238389*y + 79956654)* +x^11 + (-25462020*y + 12961894)*x^10 + (-5864817*y - 6566480)*x^9 + (1438139 +*y - 2974605)*x^8 + (1415485*y + 635208)*x^7 + (-424808*y + 438197)*x^6 + (- +40904*y - 178707)*x^5 + (35389*y + 20411)*x^4 + (-6344*y + 983)*x^3 + (499*y + - 430)*x^2 + (-15*y + 36)*x - 1 +x^3 + (-y - 1)*x^2 + (y - 2)*x + 1 +x^6 + (-y - 1)*x^5 + (y - 2)*x^4 + 5*x^3 + (-y - 1)*x^2 + (y - 2)*x + 1 +x^15 + (-13*y - 28)*x^14 + (-35*y + 71)*x^13 + (-96*y + 193)*x^12 + (-5*y - +196)*x^11 + (-239*y - 365)*x^10 + (120*y + 1489)*x^9 + (-261*y - 2084)*x^8 + + (-261*y + 2345)*x^7 + (120*y - 1609)*x^6 + (-239*y + 604)*x^5 + (-5*y + 201 +)*x^4 + (-96*y - 97)*x^3 + (-35*y - 36)*x^2 + (-13*y + 41)*x - 1 +x^64 - 2869316*y*x^63 - 14321320456*x^62 + 157634598028*y*x^61 - 20284120752 +9344*x^60 - 187341502817748*y*x^59 + 42513677421330536*x^58 + 89659277585427 +48*y*x^57 - 581758105735037800*x^56 - 22856296353162116*y*x^55 - 17452945591 +56518504*x^54 - 264489521649865972*y*x^53 + 3806496834205999360*x^52 - 74814 +8105793479444*y*x^51 + 34464709754552397448*x^50 - 807085220707689700*y*x^49 + + 112558678351798157916*x^48 + 885683152130937644*y*x^47 + 3063853398816684 +17048*x^46 + 13203419547826420924*y*x^45 + 419863456051485069824*x^44 + 3434 +3465258453402972*y*x^43 + 465608689069031605064*x^42 + 80309592889200941068* +y*x^41 - 360175722030581287640*x^40 + 110486596140091600940*y*x^39 - 1490512 +424563931678536*x^38 + 143957811491089032572*y*x^37 - 3739364774219046032256 +*x^36 + 100323919847689168220*y*x^35 - 4985975135633301110936*x^34 + 5481611 +3881156185292*y*x^33 - 6135008383051601995834*x^32 - 54816113881156185292*y* +x^31 - 4985975135633301110936*x^30 - 100323919847689168220*y*x^29 - 37393647 +74219046032256*x^28 - 143957811491089032572*y*x^27 - 1490512424563931678536* +x^26 - 110486596140091600940*y*x^25 - 360175722030581287640*x^24 - 803095928 +89200941068*y*x^23 + 465608689069031605064*x^22 - 34343465258453402972*y*x^2 +1 + 419863456051485069824*x^20 - 13203419547826420924*y*x^19 + 3063853398816 +68417048*x^18 - 885683152130937644*y*x^17 + 112558678351798157916*x^16 + 807 +085220707689700*y*x^15 + 34464709754552397448*x^14 + 748148105793479444*y*x^ +13 + 3806496834205999360*x^12 + 264489521649865972*y*x^11 - 1745294559156518 +504*x^10 + 22856296353162116*y*x^9 - 581758105735037800*x^8 - 89659277585427 +48*y*x^7 + 42513677421330536*x^6 + 187341502817748*y*x^5 - 202841207529344*x +^4 - 157634598028*y*x^3 - 14321320456*x^2 + 2869316*y*x + 1 +x^21 + (-13*y - 229)*x^20 + (234*y - 100)*x^19 + (-480*y + 8370)*x^18 + (-17 +35*y - 16719)*x^17 + (4913*y - 7834)*x^16 + (-2688*y + 51064)*x^15 + (-3960* +y - 34104)*x^14 + (1782*y - 32956)*x^13 + (8448*y + 5262)*x^12 + (-6380*y + +97204)*x^11 + (-6380*y - 90824)*x^10 + (8448*y - 13710)*x^9 + (1782*y + 3117 +4)*x^8 + (-3960*y + 38064)*x^7 + (-2688*y - 48376)*x^6 + (4913*y + 2921)*x^5 + + (-1735*y + 18454)*x^4 + (-480*y - 7890)*x^3 + (234*y - 134)*x^2 + (-13*y ++ 242)*x - 1 +x^6 - 2*y*x^5 + (-y - 7)*x^4 - 4*x^3 + (y - 8)*x^2 + (2*y - 2)*x + 1 +x^240 + (-15*y - 36)*x^239 + (499*y + 430)*x^238 + (-6344*y - 983)*x^237 + ( +35389*y - 20411)*x^236 + (-40904*y + 178707)*x^235 + (-424808*y - 438197)*x^ +234 + (1415485*y - 635208)*x^233 + (1438139*y + 2974605)*x^232 + (-5864817*y + + 6566480)*x^231 + (-25462020*y - 12961894)*x^230 + (19238389*y - 79956654) +*x^229 + (247313433*y - 30224897)*x^228 + (294927621*y + 801098945)*x^227 + +(-2353679384*y + 1069498319)*x^226 + (-3266832488*y - 5793469739)*x^225 + (1 +2761071756*y - 10152009124)*x^224 + (28891772141*y + 27706877778)*x^223 + (- +56780498004*y + 70327470888)*x^222 + (-156989267296*y - 100643285180)*x^221 ++ (163182970660*y - 341901790078)*x^220 + (692925090103*y + 282970748175)*x^ +219 + (-520851483678*y + 1249500770581)*x^218 + (-2100987167651*y - 97780636 +3155)*x^217 + (2144907137575*y - 3501192827999)*x^216 + (5741131351957*y + 5 +368774573391)*x^215 + (-12949633488740*y + 9667592872104)*x^214 + (-18978818 +705192*y - 28988343801763)*x^213 + (61143701295650*y - 42854297857883)*x^212 + + (99522339968066*y + 118416217970085)*x^211 + (-203990291010201*y + 226088 +796680855)*x^210 + (-487486417978576*y - 306059642167156)*x^209 + (371437987 +605861*y - 969565907346414)*x^208 + (1761877237395113*y + 250996844693464)*x +^207 + (347587448455796*y + 2909203449118066)*x^206 + (-4262623171412271*y + + 1900082482875272)*x^205 + (-5112561845313059*y - 5258998337190094)*x^204 + +(4703077156935772*y - 10817923562329066)*x^203 + (19596724151621886*y + 4579 +71706716061)*x^202 + (10779811934500297*y + 31310302362591686)*x^201 + (-444 +71188376651271*y + 33091705261026148)*x^200 + (-70367728073948453*y - 553681 +43890230595)*x^199 + (58047935399898944*y - 125056052810735004)*x^198 + (196 +220179915190037*y + 46078797156864550)*x^197 + (-15612945533449050*y + 27845 +2806220656846)*x^196 + (-364966710997667886*y + 30164046307811567)*x^195 + ( +-76920393658091100*y - 455669527002677921)*x^194 + (569724473209147360*y - 1 +04273935104641941)*x^193 + (107554480539021407*y + 761016430421970356)*x^192 + + (-1120756441763956820*y + 138805435659787599)*x^191 + (-36744368496876235 +9*y - 1741313178847717412)*x^190 + (2626931562224608194*y - 1142827140366519 +672)*x^189 + (3001549496003468616*y + 3542726921147289593)*x^188 + (-3816304 +655625513057*y + 6563685064488706687)*x^187 + (-12280102244383760786*y - 216 +9956083918876046)*x^186 + (-3280308295039992672*y - 20013773166146345265)*x^ +185 + (28534969871679714183*y - 14758677431499660732)*x^184 + (3420538527727 +7312731*y + 35129207175233160758)*x^183 + (-35562575528916824663*y + 6232129 +2808100809456)*x^182 + (-97526968113689340266*y - 24577168539715006795)*x^18 +1 + (-2924482708853224503*y - 135200656059538396115)*x^180 + (16755988046047 +3073606*y - 50231770182088582728)*x^179 + (117217186558944665294*y + 1844313 +16627662099968)*x^178 + (-175018700423712057769*y + 199325075624692888658)*x +^177 + (-287672838056258651793*y - 130006789216819808906)*x^176 + (433136887 +58928043819*y - 370488386653834436323)*x^175 + (435685264104825475131*y - 87 +230951613648934063)*x^174 + (260789110179489506909*y + 473346146286012258862 +)*x^173 + (-477453708065915165092*y + 475828532275903297714)*x^172 + (-73312 +5023480253537968*y - 445824632107486741239)*x^171 + (377925441616168009977*y + - 1037951764481934863694)*x^170 + (1401192440853964064557*y + 2712041812199 +21501426)*x^169 + (-116817470274758714683*y + 1837817520966021102844)*x^168 ++ (-2362860273074857968126*y + 103875680474127044027)*x^167 + (-421763202246 +558569481*y - 2985437596461812106201)*x^166 + (3701454711020661872373*y - 87 +8419497758685431399)*x^165 + (1521006793930665203185*y + 4486769840934475059 +679)*x^164 + (-5292413186031800428648*y + 2393646591871321675898)*x^163 + (- +3527560907713404811933*y - 6046342849737077241029)*x^162 + (6659475347960239 +461641*y - 4934471883467342725819)*x^161 + (6606218484397706362957*y + 70346 +33694928572084799)*x^160 + (-7071251229918632950519*y + 85221454139378375409 +88)*x^159 + (-10654172673396879304988*y - 6660938661086516468010)*x^158 + (5 +677741559220425296264*y - 12963319200223537566424)*x^157 + (1537868439480061 +5926642*y + 3975042669473795569897)*x^156 + (-1409491575820818236069*y + 177 +68498236629148702410)*x^155 + (-19928654122136236656860*y + 2108177954625221 +499359)*x^154 + (-6549200784773657451762*y - 21617243705895522615660)*x^153 ++ (22645379524677683996954*y - 11738628703873244299229)*x^152 + (17408053637 +884918322314*y + 22982504260819896781381)*x^151 + (-22809630522578701355929* +y + 23340226072231874490562)*x^150 + (-29550558164952915082604*y - 224392369 +77615542871417)*x^149 + (22094525765620020809639*y - 36386527353264595233550 +)*x^148 + (44442209345887020103552*y + 21630493829993114594971)*x^147 + (-20 +362621509381561401708*y + 54254830555411448139989)*x^146 + (-659133869795653 +69752671*y - 17161940478911028975987)*x^145 + (10842803083053018739937*y - 7 +8798826823995559998884)*x^144 + (91671114659094334230114*y + 699010605156960 +463896)*x^143 + (13121977610624125288643*y + 103143317388027280663819)*x^142 + + (-112336281183122778011108*y + 29666952173920616332098)*x^141 + (-4771339 +6391497944676658*y - 119352040791078382516354)*x^140 + (12522214489937288097 +8343*y - 66535424263344578690303)*x^139 + (86443391588395703449231*y + 13128 +8792905554584140170)*x^138 + (-138308631379146285689943*y + 1087117764446364 +01209940)*x^137 + (-134836856528001466894586*y - 145826834678543169365085)*x +^136 + (152261003156819774060466*y - 165525545074570372890946)*x^135 + (2000 +19883617103704090631*y + 155735524429003454571137)*x^134 + (-155214006426713 +875482591*y + 236255888142978579163439)*x^133 + (-271843213937284128310312*y + - 151199785544397594300869)*x^132 + (145501652264843306972923*y - 305326875 +506321100258855)*x^131 + (336932852565943631529246*y + 140097781638111061499 +104)*x^130 + (-135773050794564515416176*y + 368242715265481945864410)*x^129 ++ (-400908655930869378612741*y - 131401561676926670933942)*x^128 + (12442649 +3872813948801626*y - 435145712814328666799539)*x^127 + (46899879143136708390 +7400*y + 112351662733835870233203)*x^126 + (-94381628626117531492779*y + 498 +937937395927788353831)*x^125 + (-521540559152841029573809*y - 72188367562634 +255595303)*x^124 + (49231480359271694594387*y - 535280543629519838165745)*x^ +123 + (541321200409785903521904*y + 28961946371400127296768)*x^122 + (-12936 +229773088822436824*y + 542775176498979507958864)*x^121 - 5428178716207228568 +54615*y*x^120 + (-12936229773088822436824*y - 542775176498979507958864)*x^11 +9 + (541321200409785903521904*y - 28961946371400127296768)*x^118 + (49231480 +359271694594387*y + 535280543629519838165745)*x^117 + (-52154055915284102957 +3809*y + 72188367562634255595303)*x^116 + (-94381628626117531492779*y - 4989 +37937395927788353831)*x^115 + (468998791431367083907400*y - 1123516627338358 +70233203)*x^114 + (124426493872813948801626*y + 435145712814328666799539)*x^ +113 + (-400908655930869378612741*y + 131401561676926670933942)*x^112 + (-135 +773050794564515416176*y - 368242715265481945864410)*x^111 + (336932852565943 +631529246*y - 140097781638111061499104)*x^110 + (145501652264843306972923*y ++ 305326875506321100258855)*x^109 + (-271843213937284128310312*y + 151199785 +544397594300869)*x^108 + (-155214006426713875482591*y - 23625588814297857916 +3439)*x^107 + (200019883617103704090631*y - 155735524429003454571137)*x^106 ++ (152261003156819774060466*y + 165525545074570372890946)*x^105 + (-13483685 +6528001466894586*y + 145826834678543169365085)*x^104 + (-1383086313791462856 +89943*y - 108711776444636401209940)*x^103 + (86443391588395703449231*y - 131 +288792905554584140170)*x^102 + (125222144899372880978343*y + 665354242633445 +78690303)*x^101 + (-47713396391497944676658*y + 119352040791078382516354)*x^ +100 + (-112336281183122778011108*y - 29666952173920616332098)*x^99 + (131219 +77610624125288643*y - 103143317388027280663819)*x^98 + (91671114659094334230 +114*y - 699010605156960463896)*x^97 + (10842803083053018739937*y + 787988268 +23995559998884)*x^96 + (-65913386979565369752671*y + 17161940478911028975987 +)*x^95 + (-20362621509381561401708*y - 54254830555411448139989)*x^94 + (4444 +2209345887020103552*y - 21630493829993114594971)*x^93 + (2209452576562002080 +9639*y + 36386527353264595233550)*x^92 + (-29550558164952915082604*y + 22439 +236977615542871417)*x^91 + (-22809630522578701355929*y - 2334022607223187449 +0562)*x^90 + (17408053637884918322314*y - 22982504260819896781381)*x^89 + (2 +2645379524677683996954*y + 11738628703873244299229)*x^88 + (-654920078477365 +7451762*y + 21617243705895522615660)*x^87 + (-19928654122136236656860*y - 21 +08177954625221499359)*x^86 + (-1409491575820818236069*y - 177684982366291487 +02410)*x^85 + (15378684394800615926642*y - 3975042669473795569897)*x^84 + (5 +677741559220425296264*y + 12963319200223537566424)*x^83 + (-1065417267339687 +9304988*y + 6660938661086516468010)*x^82 + (-7071251229918632950519*y - 8522 +145413937837540988)*x^81 + (6606218484397706362957*y - 703463369492857208479 +9)*x^80 + (6659475347960239461641*y + 4934471883467342725819)*x^79 + (-35275 +60907713404811933*y + 6046342849737077241029)*x^78 + (-529241318603180042864 +8*y - 2393646591871321675898)*x^77 + (1521006793930665203185*y - 44867698409 +34475059679)*x^76 + (3701454711020661872373*y + 878419497758685431399)*x^75 ++ (-421763202246558569481*y + 2985437596461812106201)*x^74 + (-2362860273074 +857968126*y - 103875680474127044027)*x^73 + (-116817470274758714683*y - 1837 +817520966021102844)*x^72 + (1401192440853964064557*y - 271204181219921501426 +)*x^71 + (377925441616168009977*y + 1037951764481934863694)*x^70 + (-7331250 +23480253537968*y + 445824632107486741239)*x^69 + (-477453708065915165092*y - + 475828532275903297714)*x^68 + (260789110179489506909*y - 473346146286012258 +862)*x^67 + (435685264104825475131*y + 87230951613648934063)*x^66 + (4331368 +8758928043819*y + 370488386653834436323)*x^65 + (-287672838056258651793*y + +130006789216819808906)*x^64 + (-175018700423712057769*y - 199325075624692888 +658)*x^63 + (117217186558944665294*y - 184431316627662099968)*x^62 + (167559 +880460473073606*y + 50231770182088582728)*x^61 + (-2924482708853224503*y + 1 +35200656059538396115)*x^60 + (-97526968113689340266*y + 24577168539715006795 +)*x^59 + (-35562575528916824663*y - 62321292808100809456)*x^58 + (3420538527 +7277312731*y - 35129207175233160758)*x^57 + (28534969871679714183*y + 147586 +77431499660732)*x^56 + (-3280308295039992672*y + 20013773166146345265)*x^55 ++ (-12280102244383760786*y + 2169956083918876046)*x^54 + (-38163046556255130 +57*y - 6563685064488706687)*x^53 + (3001549496003468616*y - 3542726921147289 +593)*x^52 + (2626931562224608194*y + 1142827140366519672)*x^51 + (-367443684 +968762359*y + 1741313178847717412)*x^50 + (-1120756441763956820*y - 13880543 +5659787599)*x^49 + (107554480539021407*y - 761016430421970356)*x^48 + (56972 +4473209147360*y + 104273935104641941)*x^47 + (-76920393658091100*y + 4556695 +27002677921)*x^46 + (-364966710997667886*y - 30164046307811567)*x^45 + (-156 +12945533449050*y - 278452806220656846)*x^44 + (196220179915190037*y - 460787 +97156864550)*x^43 + (58047935399898944*y + 125056052810735004)*x^42 + (-7036 +7728073948453*y + 55368143890230595)*x^41 + (-44471188376651271*y - 33091705 +261026148)*x^40 + (10779811934500297*y - 31310302362591686)*x^39 + (19596724 +151621886*y - 457971706716061)*x^38 + (4703077156935772*y + 1081792356232906 +6)*x^37 + (-5112561845313059*y + 5258998337190094)*x^36 + (-4262623171412271 +*y - 1900082482875272)*x^35 + (347587448455796*y - 2909203449118066)*x^34 + +(1761877237395113*y - 250996844693464)*x^33 + (371437987605861*y + 969565907 +346414)*x^32 + (-487486417978576*y + 306059642167156)*x^31 + (-2039902910102 +01*y - 226088796680855)*x^30 + (99522339968066*y - 118416217970085)*x^29 + ( +61143701295650*y + 42854297857883)*x^28 + (-18978818705192*y + 2898834380176 +3)*x^27 + (-12949633488740*y - 9667592872104)*x^26 + (5741131351957*y - 5368 +774573391)*x^25 + (2144907137575*y + 3501192827999)*x^24 + (-2100987167651*y + + 977806363155)*x^23 + (-520851483678*y - 1249500770581)*x^22 + (6929250901 +03*y - 282970748175)*x^21 + (163182970660*y + 341901790078)*x^20 + (-1569892 +67296*y + 100643285180)*x^19 + (-56780498004*y - 70327470888)*x^18 + (288917 +72141*y - 27706877778)*x^17 + (12761071756*y + 10152009124)*x^16 + (-3266832 +488*y + 5793469739)*x^15 + (-2353679384*y - 1069498319)*x^14 + (294927621*y +- 801098945)*x^13 + (247313433*y + 30224897)*x^12 + (19238389*y + 79956654)* +x^11 + (-25462020*y + 12961894)*x^10 + (-5864817*y - 6566480)*x^9 + (1438139 +*y - 2974605)*x^8 + (1415485*y + 635208)*x^7 + (-424808*y + 438197)*x^6 + (- +40904*y - 178707)*x^5 + (35389*y + 20411)*x^4 + (-6344*y + 983)*x^3 + (499*y + - 430)*x^2 + (-15*y + 36)*x - 1 +x^6 + (-2*y - 2)*x^5 + (2*y - 4)*x^4 + 14*x^3 + (-2*y - 2)*x^2 + (2*y - 4)*x + + 1 +x^8 + 9*x^6 - 16*x^4 + 9*x^2 + 1 +x^20 + 6*x^19 + 24*x^18 + 46*x^17 + 57*x^16 + 51*x^15 + 37*x^14 + 21*x^13 + +12*x^12 + 3*x^11 - 11*x^10 - 3*x^9 + 15*x^8 + 14*x^7 + 9*x^6 + 15*x^5 + 15*x +^4 + 6*x^3 + 3*x^2 + 3*x + 1 +x^20 + 12*x^18 + 6*x^16 - 5*x^14 - 9*x^12 + 17*x^10 - 9*x^8 + 6*x^4 - 3*x^2 ++ 1 +x^24 + 4*x^22 + 8*x^20 + 20*x^18 + 32*x^16 - 12*x^14 - 42*x^12 - 12*x^10 + 3 +2*x^8 + 20*x^6 + 8*x^4 + 4*x^2 + 1 +x^21 - 7*x^20 + (3*y + 16)*x^19 + (-22*y - 3)*x^18 + (64*y - 46)*x^17 + (-80 +*y + 89)*x^16 + (14*y - 133)*x^15 + (57*y + 244)*x^14 + (-56*y - 259)*x^13 + + (132*y - 3)*x^12 + (-317*y + 204)*x^11 + (317*y - 113)*x^10 + (-132*y + 129 +)*x^9 + (56*y - 315)*x^8 + (-57*y + 301)*x^7 + (-14*y - 119)*x^6 + (80*y + 9 +)*x^5 + (-64*y + 18)*x^4 + (22*y - 25)*x^3 + (-3*y + 19)*x^2 - 7*x + 1 +x^4 - y*x^3 - 3*x^2 + y*x + 1 +x^4 + (-1/4*y + 1/2)*x^3 - 2*x^2 + (1/4*y + 1/2)*x + 1 +x^2 - x + 1 + +""" From cda8f0fc02e2746f002788bfd5b915c236deedc2 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Tue, 3 Oct 2017 17:33:55 +0200 Subject: [PATCH 07/28] corrections de test --- tests/unittests/ellanal.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/unittests/ellanal.py b/tests/unittests/ellanal.py index 90a761c..d4f9056 100644 --- a/tests/unittests/ellanal.py +++ b/tests/unittests/ellanal.py @@ -67,14 +67,16 @@ def test_ellheegner(self): pari.set_real_precision(38) def he(x): - x = pari.ellinit(x) + x = pari.ellinit(x, precision=127) return pari.ellheegner(x) self.assertEquals(str(he([1, 1, 0, -1297, -18530])), '[-339/16, 691/64]') self.assertEquals(str(he([0, -1, 1, -33, 93])), '[-3, 12]') - self.assertEquals(str(he([-157^2,0])), '[69648970982596494254458225/166136231668185267540804, 538962435089604615078004307258785218335/67716816556077455999228495435742408]') - self.assertEquals(str(he([0,0,-9/484,0,-27/234256])), '[553/17424, 25469/2299968]') - self.assertEquals(str(pari.getheap()[0]), '30') + self.assertEquals(str(he(['-157^2', 0])), + '[69648970982596494254458225/166136231668185267540804, ' + '538962435089604615078004307258785218335/67716816556077455999228495435742408]') + self.assertEquals(str(he([0, 0, '-9/484', 0, '-27/234256'])), '[553/17424, 25469/2299968]') + # self.assertEquals(str(pari.getheap()[0]), '30') E = pari.ellinit([0, -1437004800, 0, 458885065605120000, 0]); pari.ellglobalred(E); From 33e4a123d04a08b276afdd44f1f8c01384e0478b Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Thu, 5 Oct 2017 11:06:40 +0200 Subject: [PATCH 08/28] Add tests for several files: 'rootsreal', 'ser', 'subst','sumdedekind', 'sumformal', 'zeta' --- tests/unittests/alltest.py | 8 +- tests/unittests/rootsreal.py | 314 +++++++++++++++++++++++++++++++++ tests/unittests/ser.py | 314 +++++++++++++++++++++++++++++++++ tests/unittests/subst.py | 147 +++++++++++++++ tests/unittests/sumdedekind.py | 32 ++++ tests/unittests/sumformal.py | 43 +++++ tests/unittests/zeta.py | 87 +++++++++ 7 files changed, 944 insertions(+), 1 deletion(-) create mode 100644 tests/unittests/rootsreal.py create mode 100644 tests/unittests/ser.py create mode 100644 tests/unittests/subst.py create mode 100644 tests/unittests/sumdedekind.py create mode 100644 tests/unittests/sumformal.py create mode 100644 tests/unittests/zeta.py diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 383f77a..93d918a 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -40,7 +40,13 @@ 'qfb', 'qfbclassno', 'qfsolve', - 'quadray' + 'quadray', + 'rootsreal', + 'ser', + 'subst', + 'sumdedekind', + 'sumformal', + 'zeta' ] suite = unittest.TestSuite() diff --git a/tests/unittests/rootsreal.py b/tests/unittests/rootsreal.py new file mode 100644 index 0000000..8995542 --- /dev/null +++ b/tests/unittests/rootsreal.py @@ -0,0 +1,314 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file rootsreal : +default(realprecision,38); +T=x^3-6*x^2+11*x-6; +polrootsreal(T) +polrootsreal(T, [-oo,3/2]) +polrootsreal(T, [3/2,6]) +polrootsreal(T, [-oo,+oo]) +polrootsreal(T, [2,3]) +polrootsreal(T, [1,2]) +polsturm(T, [-oo,3/2]) +polsturm(T, [3/2,6]) +polsturm(T, [-oo,+oo]) +polsturm(T, [2,3]) +polsturm(T, [1,2]) +polsturm(T, [1,+oo]) +polsturm(T, 2,3) +polsturm(T, 2.,3) +polsturm(T,,2) +polrootsreal(x^10 + 23*x^9 + 19*x^8 + 18*x^7 + 39*x^6 + 41*x^5 + 46*x^4 + 24*x^3 - 4*x^2 + 2*x + 42) +polrootsreal(polchebyshev(9)) +polrootsreal(polchebyshev(10)) +polrootsreal(x^0) +polrootsreal(1) +polrootsreal(0) +polrootsreal(Pol(0)) +polrootsreal(Mod(1,2)) + +polroots(T*x+0.) +polroots(1) +polrootsreal(T,[1,1]) +polrootsreal(T,[0,0]) +polsturm(T,[1,1]) +polsturm(T,[2,1]) + +U=(x^2-1)*(x-2); +polsturm(U) +polsturm(U,[-oo,1]) +polsturm(U,[-1,+oo]) + +polrootsreal(x,[1,2]) +polrootsreal(x,[-2,-1]) +polrootsreal(x,[-1,1]) + +polrootsreal(x^3-2) +polrootsreal(x^3+2) +\\#1605 +polsturm(33*x^2-4*x-1) +polrootsreal(4*x) +polsturm(-4*x) +polsturm((x^4-2)^2) + +\\#1807 +T=x^3+x^2-x+2; +polrootsreal(T) +polsturm(T) +polsturm(T,[-3,-1]) +polsturm(T,[-2,-1]) +polsturm(T,[-oo,-2]) +polsturm(T,[-2,oo]) +T=4*x^3-2*x^2-x-1; +polsturm(T,[0,oo]) +polsturm(T,[0,1]) +polsturm(T,[0,2]) +polsturm(T,[1,3]) + +\\#1808 +polrootsreal(3*x^3-4*x^2+3*x-1) + +\\#1809 +polrootsreal(x^3-3*x^2-3*x+2) + +\\#1810 +polrootsreal(x^3-x^2) +polrootsreal((x^3-x^2)*(x-2)^3*(x-3)^2) + +default(realprecision,19); +#polroots((x+1)^2 * (x-1)^7 * (x^2-x+1)^5 * 1.0) + +\\#1884 +default(realprecision,38); +polsturm(x^2-1,[-1,1]) +polrootsreal(x^2-1,[-1,1]) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestRootsreal(unittest.TestCase): + def setUp(self): + pari.set_real_precision(38) + + def tearDown(self): + pari.set_real_precision(15) + + def test_rootsreal(self): + T = 'x^3-6*x^2+11*x-6'; + self.assertEquals(pari.polrootsreal(T), '[1.0000000000000000000000000000000000000, 2.00000000000000000000' + '00000000000000000, 3.0000000000000000000000000000000000000]~') + self.assertEquals(pari.polrootsreal(T, ['-oo', '3/2']), '[1.0000000000000000000000000000000000000]~') + self.assertEquals(pari.polrootsreal(T, ['3/2', 6]), + '[2.0000000000000000000000000000000000000, 3.0000000000000000000000000000000000000]~') + self.assertEquals(pari.polrootsreal(T, ['-oo', '+oo']), + '[1.0000000000000000000000000000000000000, 2.0000000000000000000000000000000000000, ' + '3.0000000000000000000000000000000000000]~') + self.assertEquals(pari.polrootsreal(T, [2, 3]), + '[2.0000000000000000000000000000000000000, 3.0000000000000000000000000000000000000]~') + self.assertEquals(pari.polrootsreal(T, [1, 2]), + '[1.0000000000000000000000000000000000000, 2.0000000000000000000000000000000000000]~') + + self.assertEquals(str(pari.polsturm(T, ['-oo', '3/2'])), '1') + self.assertEquals(str(pari.polsturm(T, ['3/2', 6])), '2') + self.assertEquals(str(pari.polsturm(T, ['-oo', '+oo'])), '3') + self.assertEquals(str(pari.polsturm(T, [2, 3])), '2') + self.assertEquals(str(pari.polsturm(T, [1, 2])), '2') + self.assertEquals(str(pari.polsturm(T, [1, '+oo'])), '3') + self.assertEquals(str(pari.polsturm(T, 2, 3)), '2') + self.assertEquals(str(pari.polsturm(T, '2.', 3)), '2') + self.assertEquals(str(pari.polsturm(T, None, 2)), '2') + self.assertEquals(str(pari.polrootsreal('x^10 + 23*x^9 + 19*x^8 + 18*x^7 + 39*x^6 + 41*x^5 + 46*x^4 + 24*x^3' + ' - 4*x^2 + 2*x + 42', precision=127)), + '[-22.176420046821213834911725420609849287, -1.2204011038823372357354593544256902868]~') + self.assertEquals(str(pari.polrootsreal(pari.polchebyshev(9), precision=127)), + '[-0.98480775301220805936674302458952301367, -0.86602540378443864676372317075293618347, -' + + '0.64278760968653932632264340990726343291, -0.34202014332566873304409961468225958076, 0.E' + + '-38, 0.34202014332566873304409961468225958076, 0.64278760968653932632264340990726343291,' + + ' 0.86602540378443864676372317075293618347, 0.98480775301220805936674302458952301367]~') + self.assertEquals(str(pari.polrootsreal(pari.polchebyshev(10), precision=127)), + '[-0.98768834059513772619004024769343726076, -0.89100652418836786235970957141362631277, -' + + '0.70710678118654752440084436210484903928, -0.45399049973954679156040836635787119898, -0.' + + '15643446504023086901010531946716689231, 0.15643446504023086901010531946716689231, 0.4539' + + '9049973954679156040836635787119898, 0.70710678118654752440084436210484903928, 0.89100652' + + '418836786235970957141362631277, 0.98768834059513772619004024769343726076]~') + self.assertEquals(str(pari.polrootsreal('x^0', precision=127)), '[]~') + self.assertEquals(str(pari.polrootsreal(1, precision=127)), '[]~') + + with self.assertRaises(PariError) as context: + pari.polrootsreal(0, precision=127) + self.assertTrue('zero polynomial in realroots' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.polrootsreal(pari.Pol(0), precision=127) + self.assertTrue('zero polynomial in realroots' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.polrootsreal(pari.Mod(1, 2), precision=127) + self.assertTrue('incorrect type in realroots (t_INTMOD)' in str(context.exception)) + + self.assertEquals(pari.polroots('(x^3-6*x^2+11*x-6)*x+0.'), + '[0.E-38 + 0.E-38*I, 1.0000000000000000000000000000000000000 + 0.E-38*I, 2.00000000000000' + + '00000000000000000000000 + 0.E-38*I, 3.0000000000000000000000000000000000000 + 0.E-38*I]~') + self.assertEquals(pari.polroots(1), '[]~') + self.assertEquals(str(pari.polrootsreal(T, [1, 1], precision=127)), + '[1.0000000000000000000000000000000000000]~') + self.assertEquals(str(pari.polrootsreal(T, [0, 0], precision=127)), '[]~') + self.assertEquals(str(pari.polsturm(T, [1, 1])), '1') + self.assertEquals(str(pari.polsturm(T, [2, 1])), '0') + + U = '(x^2-1)*(x-2)'; + self.assertEquals(str(pari.polsturm(U)), '3') + self.assertEquals(str(pari.polsturm(U, ['-oo', 1])), '2') + self.assertEquals(str(pari.polsturm(U, [-1, '+oo'])), '3') + + self.assertEquals(str(pari.polrootsreal('x', [1, 2])), '[]~') + self.assertEquals(str(pari.polrootsreal('x', [-2, -1])), '[]~') + self.assertEquals(str(pari.polrootsreal('x', [-1, 1], precision=127)), '[0.E-38]~') + + self.assertEquals(str(pari.polrootsreal('x^3-2', precision=127)), '[1.2599210498948731647672106072782283506]~') + self.assertEquals(str(pari.polrootsreal('x^3+2', precision=127)), '[-1.2599210498948731647672106072782283506]~') + + # #1605 + self.assertEquals(str(pari.polsturm('33*x^2-4*x-1')), '2') + self.assertEquals(str(pari.polrootsreal('4*x', precision=127)), '[0.E-38]~') + self.assertEquals(str(pari.polsturm('-4*x')), '1') + with self.assertRaises(PariError) as context: + pari.polsturm('(x^4-2)^2') + self.assertTrue('domain error in polsturm: issquarefree(pol) = 0' in str(context.exception)) + + # #1807 + T = 'x^3+x^2-x+2'; + self.assertEquals(str(pari.polrootsreal(T, precision=127)), '[-2.0000000000000000000000000000000000000]~') + self.assertEquals(str(pari.polsturm(T)), '1') + self.assertEquals(str(pari.polsturm(T, [-3, -1])), '1') + self.assertEquals(str(pari.polsturm(T, [-2, -1])), '1') + self.assertEquals(str(pari.polsturm(T, ['-oo', -2])), '1') + self.assertEquals(str(pari.polsturm(T, [-2, 'oo'])), '1') + + T = '4*x^3-2*x^2-x-1'; + self.assertEquals(str(pari.polsturm(T, [0, 'oo'])), '1') + self.assertEquals(str(pari.polsturm(T, [0, 1])), '1') + self.assertEquals(str(pari.polsturm(T, [0, 2])), '1') + self.assertEquals(str(pari.polsturm(T, [1, 3])), '1') + + # #1808 + self.assertEquals(str(pari.polrootsreal('3*x^3-4*x^2+3*x-1', precision=127)), + '[0.59441447601624956642908249516963028371]~') + + # #1809 + self.assertEquals(str(pari.polrootsreal('x^3-3*x^2-3*x+2', precision=127)), + '[-1.1451026912004224304268100262663119669, 0.47602360291813403446915767711979045497, ' + '3.6690790882822883959576523491465215119]~') + + # #1810 + self.assertEquals(str(pari.polrootsreal('x^3-x^2', precision=127)), + '[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000]~') + self.assertEquals(str(pari.polrootsreal('(x^3-x^2)*(x-2)^3*(x-3)^2', precision=127)), + '[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000, 2.00000000000000000000' + + '00000000000000000, 2.0000000000000000000000000000000000000, 2.000000000000000000' + + '0000000000000000000, 3.0000000000000000000000000000000000000, 3.0000000000000000' + + '000000000000000000000]~') + + pari.set_real_precision(19) + self.assertEquals(len(pari.polroots('(x+1)^2 * (x-1)^7 * (x^2-x+1)^5 * 1.0')), 19) + + # #1884 + pari.set_real_precision(38) + self.assertEquals(str(pari.polsturm('x^2-1', [-1, 1])), '2') + self.assertEquals(str(pari.polrootsreal('x^2-1', [-1, 1], precision=127)), + '[-1.0000000000000000000000000000000000000, 1.0000000000000000000000000000000000000]~') + +"""**** Original expected results **** + +[1.0000000000000000000000000000000000000, 2.00000000000000000000000000000000 +00000, 3.0000000000000000000000000000000000000]~ +[1.0000000000000000000000000000000000000]~ +[2.0000000000000000000000000000000000000, 3.00000000000000000000000000000000 +00000]~ +[1.0000000000000000000000000000000000000, 2.00000000000000000000000000000000 +00000, 3.0000000000000000000000000000000000000]~ +[2.0000000000000000000000000000000000000, 3.00000000000000000000000000000000 +00000]~ +[1.0000000000000000000000000000000000000, 2.00000000000000000000000000000000 +00000]~ +1 +2 +3 +2 +2 +3 +2 +2 +2 +[-22.176420046821213834911725420609849287, -1.220401103882337235735459354425 +6902868]~ +[-0.98480775301220805936674302458952301367, -0.86602540378443864676372317075 +293618347, -0.64278760968653932632264340990726343291, -0.3420201433256687330 +4409961468225958076, 0.E-38, 0.34202014332566873304409961468225958076, 0.642 +78760968653932632264340990726343291, 0.8660254037844386467637231707529361834 +7, 0.98480775301220805936674302458952301367]~ +[-0.98768834059513772619004024769343726076, -0.89100652418836786235970957141 +362631277, -0.70710678118654752440084436210484903928, -0.4539904997395467915 +6040836635787119898, -0.15643446504023086901010531946716689231, 0.1564344650 +4023086901010531946716689231, 0.45399049973954679156040836635787119898, 0.70 +710678118654752440084436210484903928, 0.891006524188367862359709571413626312 +77, 0.98768834059513772619004024769343726076]~ +[]~ +[]~ + *** at top-level: polrootsreal(0) + *** ^--------------- + *** polrootsreal: zero polynomial in realroots. + *** at top-level: polrootsreal(Pol(0)) + *** ^-------------------- + *** polrootsreal: zero polynomial in realroots. + *** at top-level: polrootsreal(Mod(1,2 + *** ^-------------------- + *** polrootsreal: incorrect type in realroots (t_INTMOD). +[0.E-38 + 0.E-38*I, 1.0000000000000000000000000000000000000 + 0.E-38*I, 2.00 +00000000000000000000000000000000000 + 0.E-38*I, 3.00000000000000000000000000 +00000000000 + 0.E-38*I]~ +[]~ +[1.0000000000000000000000000000000000000]~ +[]~ +1 +0 +3 +2 +3 +[]~ +[]~ +[0.E-38]~ +[1.2599210498948731647672106072782283506]~ +[-1.2599210498948731647672106072782283506]~ +2 +[0.E-38]~ +1 + *** at top-level: polsturm((x^4-2)^2) + *** ^------------------- + *** polsturm: domain error in polsturm: issquarefree(pol) = 0 +[-2.0000000000000000000000000000000000000]~ +1 +1 +1 +1 +1 +1 +1 +1 +1 +[0.59441447601624956642908249516963028371]~ +[-1.1451026912004224304268100262663119669, 0.4760236029181340344691576771197 +9045497, 3.6690790882822883959576523491465215119]~ +[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000]~ +[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000, 2.0000000000000000 +000000000000000000000, 2.0000000000000000000000000000000000000, 2.0000000000 +000000000000000000000000000, 3.0000000000000000000000000000000000000, 3.0000 +000000000000000000000000000000000]~ +19 +2 +[-1.0000000000000000000000000000000000000, 1.0000000000000000000000000000000 +000000]~ + +""" diff --git a/tests/unittests/ser.py b/tests/unittests/ser.py new file mode 100644 index 0000000..29113a4 --- /dev/null +++ b/tests/unittests/ser.py @@ -0,0 +1,314 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file ser : +default(realprecision,38); +s=x+x^2+O(x^5) +f=[atan,asin,acos,cosh,sinh,tanh,cotanh,acosh,asinh,atanh]; +{ +for (i=1,#f, + print(f[i](s)); + print(f[i](O(x^5))); + print(f[i]([Pol(1)])); +) +} +O(x^-2) +O(1/x^2) +trace(I*x+1+O(x^2)) +norm(I*x+1+O(x^2)) +a=Ser(vector(200,i,i)); +a^2 == a*(a+1) - a \\ test RgX_mullow, RgX_sqrlow +3+O(1) +serreverse(x/2+O(x^2)) +serreverse(tan(x)/2) + +Ser(x+y+O(x^2),x) +Ser(x+y+O(x^2),y) +Ser("") +s = Ser(Mod(0,7)) +Ser(Mod(1,7)*(x^4+x^2), x,3) +s+O(x^16) +s+Mod(1,7) +s+Mod(1,7)*x +s/x +s' +deriv(s,y) +trace(s) +round(s) +round(s,&e) +lift(s) +lift(s,x) +liftint(s) +Ser(x,, -5) +O(x^2)*0 +deriv(Mod(2,4)*x^2+O(x^3)) +x^3*(1+O(y^2)) +Mod(1,3)*x^3*(1+O(y^2)) +O(x)/2 +s = O(3^2)+O(x); +s/3 +s/2 +s*3 +(1+O(x))^2 +1/(x+0.)+O(x^2) +[1==O(x), 1==O(x^0), 1==O(x^-1)] +[-1==O(x), -1==O(x^0), -1==O(x^-1)] +[2==O(x), 2==O(x^0), 2==O(x^-1)] + +a=1./x+O(1);a-a +a=1/x+O(1);a-a +a=Mod(1,2)/x+O(1);a-a + +subst(1+O(x),x,y) +subst(1+x+O(x^2),x,y^2) +O(1)==O(x) +O(1)==x +O(x)==1 + +exp(x+O(x^200))*exp(-x+O(x^200)) +exp(x+O(x^200))^2==exp(2*x+O(x^200)) + +subst(1+x^3+O(x^6),x,x+O(x^4)) +subst(1+x^2+O(x^6),x,x+O(x^3)) +subst(1+x^3+x^4+O(x^6),x,x+x^2+O(x^3)) + +subst(x^2+O(x^3),x,0*x) +subst(x^2+O(x^3),x,Mod(0,3)*x) +subst(x^2+O(x^3),x,O(3)*x) +subst(1+x+O(x^2),x,0*x) +subst(1+x+O(x^2),x,Mod(0,3)*x) +subst(1+x+O(x^2),x,O(3)*x) + +\\ Errors. Keep at end of file +subst(x^-1+O(x),x,Mod(0,3)) +subst(O(x^-1),x,Mod(0,3)) +subst(x^-1+O(x),x,0*x) +subst(O(x^-1),x,0*x) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestSer(unittest.TestCase): + def test_ser(self): + pari.set_real_precision(38) + s = 'x+x^2+O(x^5)' + f = [pari.atan, pari.asin, pari.acos, pari.cosh, pari.sinh, pari.tanh, pari.cotanh, pari.acosh, pari.asinh]; + + res1 = ['x + x^2 - 1/3*x^3 - x^4 + O(x^5)', + 'x + x^2 + 1/6*x^3 + 1/2*x^4 + O(x^5)', + '1.5707963267948966192313216916397514421 - x - x^2 - 1/6*x^3 - 1/2*x^4 + O(x^5)', + '1 + 1/2*x^2 + x^3 + 13/24*x^4 + O(x^5)', + 'x + x^2 + 1/6*x^3 + 1/2*x^4 + O(x^5)', + 'x + x^2 - 1/3*x^3 - x^4 + O(x^5)', + 'x^-1 - 1 + 4/3*x - 2/3*x^2 + O(x^3)', + '1.5707963267948966192313216916397514421*I - 1.0000000000000000000000000000000000000*I*x - ' + '1.0000000000000000000000000000000000000*I*x^2 - 0.16666666666666666666666666666666666667*I*x^3 - ' + '0.50000000000000000000000000000000000000*I*x^4 + O(x^5)', + 'x + x^2 - 1/6*x^3 - 1/2*x^4 + O(x^5)'] + + res2 = ['O(x^5)', + 'O(x^5)', + '1.5707963267948966192313216916397514421 + O(x^5)', + '1 + O(x^5)', + 'O(x^5)', + 'O(x^5)', + 'O(x^5)', + '1.5707963267948966192313216916397514421*I + O(x^5)', + 'O(x^5)'] + + res3 = ['[0.78539816339744830961566084581987572105 + O(x^16)]', + '[1.5707963267948966192313216916397514421 + O(x^8)]', + '[O(x^8)]', + '[1.5430806348152437784779056207570616826 + O(x^16)]', + '[1.1752011936438014568823818505956008152 + O(x^16)]', + '[0.76159415595576488811945828260479359041 + O(x^16)]', + '[1.3130352854993313036361612469308478329 + O(x^16)]', + '[O(x^8)]', + '[0.88137358701954302523260932497979230903 + O(x^16)]'] + + for i in range(0, len(f)): + self.assertEquals(str(f[i](s, precision=127)), res1[i]); + self.assertEquals(str(f[i]('O(x^5)', precision=127)), res2[i]); + self.assertEquals(str(f[i]([pari.Pol(1)], precision=127)), res3[i]); + + self.assertEquals(str(pari.atanh(s, precision=127)), 'x + x^2 + 1/3*x^3 + x^4 + O(x^5)') + self.assertEquals(str(pari.atanh('O(x^5)', precision=127)), 'O(x^5)') + with self.assertRaises(PariError) as context: + pari.atanh([pari.Pol(1)], precision=127) + self.assertTrue('impossible inverse in div_ser: O(x^16)' in str(context.exception)) + self.assertEquals(pari.trace('I*x+1+O(x^2)'), '2 + O(x^2)') + self.assertEquals(pari.norm('I*x+1+O(x^2)'), '1 + O(x^2)') + + self.assertEquals(pari.Ser('x+y+O(x^2)','x'), 'y + x + O(x^2)') + self.assertEquals(pari.Ser('x+y+O(x^2)','y'), '(y + O(y^17)) + (1 + O(y^16))*x + O(x^2)') + with self.assertRaises(PariError) as context: + pari.Ser('""') + self.assertTrue('incorrect type in gtoser (t_STR)' in str(context.exception)) + s = pari.Ser(pari.Mod(0,7)) + self.assertEquals(s, 'Mod(0, 7)*x^15 + O(x^16)') + self.assertEquals(pari.Ser('Mod(1,7)*(x^4+x^2)', 'x', 3), 'Mod(1, 7)*x^2 + Mod(1, 7)*x^4 + O(x^5)') + self.assertEquals(pari.deriv(s, 'y'), 'Mod(0, 7)*x^15 + O(x^16)') + self.assertEquals(pari.trace(s), 'Mod(0, 7)*x^15 + O(x^16)') + self.assertEquals(pari.lift(s), 'O(x^16)') + self.assertEquals(pari.lift(s, 'x'), 'Mod(0, 7)*x^15 + O(x^16)') + self.assertEquals(pari.liftint(s), 'O(x^16)') + self.assertEquals(pari.deriv('Mod(2,4)*x^2+O(x^3)'), 'Mod(0, 4)*x + O(x^2)') + + self.assertEquals(pari.subst('1+O(x)', 'x', 'y'), '1 + O(y)') + self.assertEquals(pari.subst('1+x+O(x^2)', 'x', 'y^2'), '1 + y^2 + O(y^4)') + self.assertEquals(pari.subst('1+x^3+O(x^6)', 'x', 'x+O(x^4)'), '1 + x^3 + O(x^6)') + self.assertEquals(pari.subst('1+x^2+O(x^6)', 'x', 'x+O(x^3)'), '1 + x^2 + O(x^4)') + self.assertEquals(pari.subst('1+x^3+x^4+O(x^6)', 'x', 'x+x^2+O(x^3)'), '1 + x^3 + 4*x^4 + O(x^5)') + + self.assertEquals(pari.subst('x^2+O(x^3)', 'x', '0*x'), '0') + self.assertEquals(pari.subst('x^2+O(x^3)', 'x', 'Mod(0,3)*x'), 'Mod(0, 3)') + self.assertEquals(pari.subst('x^2+O(x^3)', 'x', 'O(3)*x'), 'O(3^2)*x^2 + O(x^3)') + self.assertEquals(pari.subst('1+x+O(x^2)', 'x', '0*x'), '1') + self.assertEquals(pari.subst('1+x+O(x^2)', 'x', 'Mod(0,3)*x'), 'Mod(1, 3)') + self.assertEquals(pari.subst('1+x+O(x^2)', 'x', 'O(3)*x'), '1 + O(3)*x + O(x^2)') + + def test_serreverse(self): + self.assertEquals(pari.serreverse('x/2+O(x^2)'), '2*x + O(x^2)') + self.assertEquals(pari.serreverse('tan(x)/2'), '2*x - 8/3*x^3 + 32/5*x^5 - 128/7*x^7 + 512/9*x^9 - 204' + '8/11*x^11 + 8192/13*x^13 - 32768/15*x^15 + O(x^17)') + + def test_errors(self): + with self.assertRaises(PariError) as context: + pari.subst('x^-1+O(x)', 'x', pari.Mod(0, 3)) + self.assertTrue('impossible inverse in gsubst: Mod(0, 3)' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.subst('O(x^-1)', 'x', pari.Mod(0, 3)) + self.assertTrue('impossible inverse in gsubst: Mod(0, 3)' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.subst('x^-1+O(x)', 'x', '0*x') + self.assertTrue('impossible inverse in gsubst: 0' in str(context.exception)) + with self.assertRaises(PariError) as context: + pari.subst('O(x^-1)', 'x', '0*x') + self.assertTrue('impossible inverse in gsubst: 0' in str(context.exception)) + + + + + +"""**** Original expected results **** + +x + x^2 + O(x^5) +x + x^2 - 1/3*x^3 - x^4 + O(x^5) +O(x^5) +[0.78539816339744830961566084581987572105 + O(x^16)] +x + x^2 + 1/6*x^3 + 1/2*x^4 + O(x^5) +O(x^5) +[1.5707963267948966192313216916397514421 + O(x^8)] +1.5707963267948966192313216916397514421 - x - x^2 - 1/6*x^3 - 1/2*x^4 + O(x^ +5) +1.5707963267948966192313216916397514421 + O(x^5) +[O(x^8)] +1 + 1/2*x^2 + x^3 + 13/24*x^4 + O(x^5) +1 + O(x^5) +[1.5430806348152437784779056207570616826 + O(x^16)] +x + x^2 + 1/6*x^3 + 1/2*x^4 + O(x^5) +O(x^5) +[1.1752011936438014568823818505956008152 + O(x^16)] +x + x^2 - 1/3*x^3 - x^4 + O(x^5) +O(x^5) +[0.76159415595576488811945828260479359041 + O(x^16)] +x^-1 - 1 + 4/3*x - 2/3*x^2 + O(x^3) +O(x^5) +[1.3130352854993313036361612469308478329 + O(x^16)] +1.5707963267948966192313216916397514421*I - 1.000000000000000000000000000000 +0000000*I*x - 1.0000000000000000000000000000000000000*I*x^2 - 0.166666666666 +66666666666666666666666667*I*x^3 - 0.50000000000000000000000000000000000000* +I*x^4 + O(x^5) +1.5707963267948966192313216916397514421*I + O(x^5) +[O(x^8)] +x + x^2 - 1/6*x^3 - 1/2*x^4 + O(x^5) +O(x^5) +[0.88137358701954302523260932497979230903 + O(x^16)] +x + x^2 + 1/3*x^3 + x^4 + O(x^5) +O(x^5) + *** at top-level: ...rint(f[i](O(x^5)));print(f[i]([Pol(1)]));) + *** ^----------------- + *** in function f: atanh + *** ^----- + *** atanh: impossible inverse in div_ser: O(x^16). +O(x^-2) +O(x^-2) +2 + O(x^2) +1 + O(x^2) +1 +O(x^0) +2*x + O(x^2) +2*x - 8/3*x^3 + 32/5*x^5 - 128/7*x^7 + 512/9*x^9 - 2048/11*x^11 + 8192/13*x^ +13 - 32768/15*x^15 + O(x^17) +y + x + O(x^2) +(y + O(y^17)) + (1 + O(y^16))*x + O(x^2) + *** at top-level: Ser("") + *** ^------- + *** Ser: incorrect type in gtoser (t_STR). +Mod(0, 7)*x^15 + O(x^16) +Mod(1, 7)*x^2 + Mod(1, 7)*x^4 + O(x^5) +Mod(0, 7)*x^15 + O(x^16) +Mod(1, 7) + O(x^16) +Mod(1, 7)*x + O(x^16) +Mod(0, 7)*x^14 + O(x^15) +Mod(0, 7)*x^14 + O(x^15) +Mod(0, 7)*x^15 + O(x^16) +Mod(0, 7)*x^15 + O(x^16) +Mod(0, 7)*x^15 + O(x^16) +Mod(0, 7)*x^15 + O(x^16) +O(x^16) +Mod(0, 7)*x^15 + O(x^16) +O(x^16) + *** at top-level: Ser(x,,-5) + *** ^---------- + *** Ser: domain error in gtoser: precision < 0 +0 +Mod(0, 4)*x + O(x^2) +(1 + O(y^2))*x^3 +(Mod(1, 3) + O(y^2))*x^3 +O(x) +O(3) + O(x) +O(3^2) + O(x) +O(3^3) + O(x) +1 + O(x) + *** _+_: Warning: normalizing a series with 0 leading term. +x^-1 + O(x) +[0, 1, 1] +[0, 1, 1] +[0, 1, 1] +0.E-38*x^-1 + O(x^0) +O(x^0) +Mod(0, 2)*x^-1 + O(x^0) +1 + O(y) +1 + y^2 + O(y^4) +1 +1 +0 +1 + O(x^200) +1 +1 + x^3 + O(x^6) +1 + x^2 + O(x^4) +1 + x^3 + 4*x^4 + O(x^5) +0 +Mod(0, 3) +O(3^2)*x^2 + O(x^3) +1 +Mod(1, 3) +1 + O(3)*x + O(x^2) + *** at top-level: subst(x^-1+O(x),x,Mo + *** ^-------------------- + *** subst: impossible inverse in gsubst: Mod(0, 3). + *** at top-level: subst(O(x^-1),x,Mod( + *** ^-------------------- + *** subst: impossible inverse in gsubst: Mod(0, 3). + *** at top-level: subst(x^-1+O(x),x,0* + *** ^-------------------- + *** subst: impossible inverse in gsubst: 0. + *** at top-level: subst(O(x^-1),x,0*x) + *** ^-------------------- + *** subst: impossible inverse in gsubst: 0. + +""" diff --git a/tests/unittests/subst.py b/tests/unittests/subst.py new file mode 100644 index 0000000..fdf0b83 --- /dev/null +++ b/tests/unittests/subst.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file subst : +x; y; p; q; +subst(Y/X,X,x) +substvec(x+y,[x,y],[1,x]) + +\\ #1321 +v = [p + w*q, w*p + q] * Mod(1, w + 1); +substvec(x+y, [x, y], v) +\\ #1447 +subst(O(x^2),x,0*x) +subst(x+O(x^2),x,Mod(1,3)) +subst(x+O(x^2),x,Mod(0,3)) +subst(1/x+O(x^2),x,Mod(0,3)) +subst(2+x+O(x^2),x,Mod(0,3)) +subst(Pol(0),x,Mod(1,3)) +subst(Pol(0),x,Mod(1,3)*matid(2)) +subst(Pol(1),x,Mod(1,3)) +subst(Pol(1),x,Mod(1,3)*matid(2)) + +substpol(x,1/x,y) +substpol(Mod(x*y^2, y^3*x^2+1), y^2,y) +substpol(x*y^2/(y^3*x^2+1), y^2,y) +substpol(List(), y^2,y) +substpol(List(x^2*y^2), y^2,y) +substpol(x^2+y^3*x^3+O(x^4),y^2, y) + +subst(1,x,[;]) +subst(1,x,Mat([1,2])) +subst(x^2+x^3+O(x^4),x, 2*y+O(y^2)) + +substpol(1+O(x^2),x^2,x) +substpol(x^2+O(x^4),x^2,x) +substpol(x+O(x^4),x^2,x) +substpol(1,x^2,x) + +\\#1727 +substvec(1+x+y+x*y+O(x^2), [x,y],[x,y]) + +subst(Mod(1/z,y),z,x) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestSubst(unittest.TestCase): + def test_subst(self): + self.assertEquals(pari.subst('Y/X', 'X', 'x'), 'Y/x') + self.assertEquals(pari.substvec('x+y', ['x', 'y'], [1, 'x']), 'x + 1') + + # #1321 + v = '[p + w*q, w*p + q] * Mod(1, w + 1)'; + self.assertEquals(pari.substvec('x+y', ['x', 'y'], v), '0') + # #1447 + self.assertEquals(pari.subst('O(x^2)', 'x', '0*x'), 'O(x^2)') + with self.assertRaises(PariError) as context: + pari.subst('x+O(x^2)', 'x', pari.Mod(1, 3)) + self.assertTrue('forbidden substitution t_SER , t_INTMOD' in str(context.exception)) + + self.assertEquals(pari.subst('x+O(x^2)', 'x', pari.Mod(0, 3)), 'Mod(0, 3)') + + with self.assertRaises(PariError) as context: + pari.subst('1/x+O(x^2)', 'x', pari.Mod(0, 3)) + self.assertTrue('impossible inverse in gsubst: Mod(0, 3)' in str(context.exception)) + + self.assertEquals(pari.subst('2+x+O(x^2)', 'x', pari.Mod(0, 3)), 'Mod(2, 3)') + self.assertEquals(pari.subst(pari.Pol(0), 'x', pari.Mod(1, 3)), 'Mod(0, 3)') + self.assertEquals(pari.subst(pari.Pol(0), 'x', 'Mod(1,3)*matid(2)'), '[Mod(0, 3), 0; 0, Mod(0, 3)]') + self.assertEquals(pari.subst(pari.Pol(1), 'x', pari.Mod(1, 3)), 'Mod(1, 3)') + self.assertEquals(pari.subst(pari.Pol(1), 'x', 'Mod(1,3)*matid(2)'), '[1, 0; 0, 1]') + + self.assertEquals(pari.substpol('x', '1/x', 'y'), '-1/-y') + self.assertEquals(pari.substpol(pari.Mod('x*y^2', 'y^3*x^2+1'), 'y^2', 'y'), 'Mod(y*x, y^2*x^2 + 1)') + self.assertEquals(pari.substpol('x*y^2/(y^3*x^2+1)', 'y^2', 'y'), 'y*x/(y^2*x^2 + 1)') + self.assertEquals(pari.substpol(pari.List(), 'y^2', 'y'), 'List([])') + self.assertEquals(pari.substpol(pari.List('x^2*y^2'), 'y^2', 'y'), 'List([y*x^2])') + self.assertEquals(pari.substpol('x^2+y^3*x^3+O(x^4)', 'y^2', 'y'), 'x^2 + y^2*x^3 + O(x^4)') + + self.assertEquals(pari.subst(1, 'x', '[;]'), '[;]') + with self.assertRaises(PariError) as context: + pari.subst(1, 'x', pari.Mat([1, 2])) + self.assertTrue('forbidden substitution t_INT , t_MAT (1x2)' in str(context.exception)) + self.assertEquals(pari.subst('x^2+x^3+O(x^4)', 'x', '2*y+O(y^2)'), '4*y^2 + O(y^3)') + + self.assertEquals(pari.substpol('1+O(x^2)', 'x^2', 'x'), '1 + O(x)') + self.assertEquals(pari.substpol('x^2+O(x^4)', 'x^2', 'x'), 'x + O(x^2)') + with self.assertRaises(PariError) as context: + pari.substpol('x+O(x^4)', 'x^2', 'x') + self.assertTrue('domain error in gdeflate: valuation(x) % 2 != 0' in str(context.exception)) + self.assertEquals(pari.substpol(1, 'x^2', 'x'), '1') + + # #1727 + self.assertEquals(pari.substvec('1+x+y+x*y+O(x^2)', ['x', 'y'], ['x', 'y']), '(y + 1) + (y + 1)*x + O(x^2)') + + self.assertEquals(pari.subst(pari.Mod('1/z', 'y'), 'z', 'x'), 'Mod(1, y)/(Mod(1, y)*x)') + +"""**** Original expected results **** + +Y/x +x + 1 +0 +O(x^2) + *** at top-level: subst(x+O(x^2),x,Mod + *** ^-------------------- + *** subst: forbidden substitution t_SER , t_INTMOD. +Mod(0, 3) + *** at top-level: subst(1/x+O(x^2),x,M + *** ^-------------------- + *** subst: impossible inverse in gsubst: Mod(0, 3). +Mod(2, 3) +Mod(0, 3) + +[Mod(0, 3) 0] + +[ 0 Mod(0, 3)] + +Mod(1, 3) + +[1 0] + +[0 1] + +-1/-y +Mod(y*x, y^2*x^2 + 1) +y*x/(y^2*x^2 + 1) +List([]) +List([y*x^2]) +x^2 + y^2*x^3 + O(x^4) +[;] + *** at top-level: subst(1,x,Mat([1,2]) + *** ^-------------------- + *** subst: forbidden substitution t_INT , t_MAT (1x2). +4*y^2 + O(y^3) +1 + O(x) +x + O(x^2) + *** at top-level: substpol(x+O(x^4),x^ + *** ^-------------------- + *** substpol: domain error in gdeflate: valuation(x) % 2 != 0 +1 +(y + 1) + (y + 1)*x + O(x^2) +Mod(1, y)/(Mod(1, y)*x) + +""" diff --git a/tests/unittests/sumdedekind.py b/tests/unittests/sumdedekind.py new file mode 100644 index 0000000..01497a8 --- /dev/null +++ b/tests/unittests/sumdedekind.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file sumdedekind : +sumdedekind(-2,-3) +sumdedekind(2, 4) +sumdedekind(123186,28913191) +sumdedekind(2^64+1, 2^65) +""" +import unittest +from cypari2 import Pari, PariError +from math import pow + +pari = Pari() + + +class TestSumdedekind(unittest.TestCase): + def test_sumdedekind(self): + self.assertEquals(pari.sumdedekind(-2, -3), '-1/18') + self.assertEquals(pari.sumdedekind(2, 4), '0') + self.assertEquals(pari.sumdedekind(123186, 28913191), '1145846923/57826382') + self.assertEquals(pari.sumdedekind(int(pow(2, 64)) + 1, int(pow(2, 65))), + '56713727820156410558782357164918483627/73786976294838206464') + +"""**** Original expected results **** + +-1/18 +0 +1145846923/57826382 +56713727820156410558782357164918483627/73786976294838206464 + +""" diff --git a/tests/unittests/sumformal.py b/tests/unittests/sumformal.py new file mode 100644 index 0000000..c7cbd9a --- /dev/null +++ b/tests/unittests/sumformal.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file sumformal : +sumformal(1/n) +sumformal(0) +sumformal(1) +sumformal(n) +sumformal(n^2) +sumformal(x*y + 1) +sumformal(x*y + 1,y) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestSumformal(unittest.TestCase): + def test_sumformal(self): + with self.assertRaises(PariError) as context: + pari.sumformal('1/n') + self.assertTrue('incorrect type in sumformal [not a t_POL] (t_RFRAC)' in str(context.exception)) + self.assertEquals(pari.sumformal(0), '0') + self.assertEquals(pari.sumformal(1), 'x') + self.assertEquals(pari.sumformal('n'), '1/2*n^2 + 1/2*n') + self.assertEquals(pari.sumformal('n^2'), '1/3*n^3 + 1/2*n^2 + 1/6*n') + self.assertEquals(pari.sumformal('x*y + 1'), '1/2*y*x^2 + (1/2*y + 1)*x') + self.assertEquals(pari.sumformal('x*y + 1', 'y'), '(1/2*y^2 + 1/2*y)*x + y') + +"""**** Original expected results **** + + *** at top-level: sumformal(1/n) + *** ^-------------- + *** sumformal: incorrect type in sumformal [not a t_POL] (t_RFRAC). +0 +x +1/2*n^2 + 1/2*n +1/3*n^3 + 1/2*n^2 + 1/6*n +1/2*y*x^2 + (1/2*y + 1)*x +(1/2*y^2 + 1/2*y)*x + y + +""" diff --git a/tests/unittests/zeta.py b/tests/unittests/zeta.py new file mode 100644 index 0000000..7962a1d --- /dev/null +++ b/tests/unittests/zeta.py @@ -0,0 +1,87 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file zeta : +default(realprecision,38); +allocatemem(20*10^6); +zeta(3+O(5^10)) +zeta(1 + I/100) +zeta(1000.5) +zeta(1000) +zeta(100) +zeta(31) +zeta(100+100*I) +zeta(60+I) +zeta(-1000+I) +zeta(2+O(2^10)) +zeta(2^64) +zeta(-2^64) +iferr(zeta(-1-2^64),E,E) +zeta(2+1e-101*I) +zeta(1.01) +zeta(1e-32) +""" +import unittest +from cypari2 import Pari, PariError +from math import pow + +pari = Pari() + + +class TestZeta(unittest.TestCase): + def test_zeta(self): + pari.set_real_precision(38) + pari.allocatemem(2e7); + self.assertEquals(pari.zeta('3+O(5^10)'), '2*5^-1 + 2*5 + 3*5^2 + 3*5^4 + 3*5^5 + 2*5^6 + 5^7 + 4*5^8 + O(5^9)') + self.assertEquals(pari.zeta('1 + I/100', precision=127), + '0.57721614942066140874800424251188396262 - 99.999271841202858157138397118797159155*I') + self.assertEquals(pari.zeta('1000.5', precision=127), '1.0000000000000000000000000000000000000') + self.assertEquals(pari.zeta(1000, precision=127), '1.0000000000000000000000000000000000000') + self.assertEquals(str(pari.zeta(100, precision=127)), '1.0000000000000000000000000000007888609') + self.assertEquals(str(pari.zeta(31, precision=127)), '1.0000000004656629065033784072989233251') + self.assertEquals(str(pari.zeta('100+100*I', precision=127)), + '1.0000000000000000000000000000007731864 - 1.5647480679975229240431199238639049803 E-31*I') + self.assertEquals(str(pari.zeta('60+I', precision=127)), + '1.0000000000000000006672083904260744090 - 5.5421056315169138713580539141777567374 E-19*I') + self.assertEquals(str(pari.zeta('-1000+I', precision=127)), '-1.8236338315400224657144248914124703368 E1769 + ' + '6.8223788001755144705322033655798283436 E1768*I') + self.assertEquals(pari.zeta('2+O(2^10)', precision=127), '2^-1 + 1 + 2^2 + 2^3 + 2^5 + 2^6 + 2^7 + O(2^9)') + self.assertEquals(pari.zeta(pow(2, 64), precision=127), '1.0000000000000000000000000000000000000') + self.assertEquals(pari.zeta('-2^64', precision=127), '0.E-38') + + with self.assertRaises(PariError) as context: + pari.zeta('-1-2^64') + self.assertTrue('overflow in zeta [large negative argument]' in str(context.exception)) + + self.assertEquals(str(pari.zeta('2+1e-101*I', precision=127)), + '1.6449340668482264364724151666460251892 - 9.3754825431584375370257409456786497790 E-102*I') + self.assertEquals(str(pari.zeta('1.01', precision=127)), '100.57794333849687249028215428579024415') + self.assertEquals(str(pari.zeta('1e-32', precision=127)), '-0.50000000000000000000000000000000918939') + pari.set_real_precision(15) + +"""**** Original expected results **** + + *** Warning: new stack size = 20000000 (19.073 Mbytes). +2*5^-1 + 2*5 + 3*5^2 + 3*5^4 + 3*5^5 + 2*5^6 + 5^7 + 4*5^8 + O(5^9) +0.57721614942066140874800424251188396262 - 99.999271841202858157138397118797 +159155*I +1.0000000000000000000000000000000000000 +1.0000000000000000000000000000000000000 +1.0000000000000000000000000000007888609 +1.0000000004656629065033784072989233251 +1.0000000000000000000000000000007731864 - 1.56474806799752292404311992386390 +49803 E-31*I +1.0000000000000000006672083904260744090 - 5.54210563151691387135805391417775 +67374 E-19*I +-1.8236338315400224657144248914124703368 E1769 + 6.8223788001755144705322033 +655798283436 E1768*I +2^-1 + 1 + 2^2 + 2^3 + 2^5 + 2^6 + 2^7 + O(2^9) +1.0000000000000000000000000000000000000 +0.E-38 +error("overflow in zeta [large negative argument].") +1.6449340668482264364724151666460251892 - 9.37548254315843753702574094567864 +97790 E-102*I +100.57794333849687249028215428579024415 +-0.50000000000000000000000000000000918939 + +""" From c7d055f46766ea41d3ec5e92341399ee362e452d Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Thu, 12 Oct 2017 13:50:03 +0200 Subject: [PATCH 09/28] isprime : use ** operator instead of int(pow(x)) --- tests/unittests/isprime.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/unittests/isprime.py b/tests/unittests/isprime.py index cfb35b8..7ec357f 100644 --- a/tests/unittests/isprime.py +++ b/tests/unittests/isprime.py @@ -23,7 +23,6 @@ isprime(2^256+5721) """ import unittest -from math import pow from cypari2 import Pari, PariError pari = Pari() @@ -35,11 +34,11 @@ def test_isprime(self): self.assertEquals(pari.isprime(4309513411435775833571), '1') self.assertEquals(pari.isprime(26959946667150639794667015087019630673557916260026308143510066298881), '1') - p = int(pow(10, 6) + 3); - q = int(pow(10, 6) + 33); + p = 10 ** 6 + 3; + q = 10 ** 6 + 33; self.assertEquals(pari.isprime(1 + 24 * p * q, 1), '[2, 5, 1; 3, 2, 1; 1000003, 2, 1]') - x = pari.isprime(1 + 232 * int(pow(p, 2)) * int(pow(q, 3)), 1) - # self.assertEquals(x, '[2, 3, 1; 29, 2, 1; 1000003, 2, 1]') + x = pari.isprime(1 + 232 * p ** 2 * q ** 3, 1) + self.assertEquals(x, '[2, 3, 1; 29, 2, 1; 1000003, 2, 1]') self.assertEquals(pari.isprime([2, 3, 4]), '[1, 1, 0]') self.assertEquals(pari.isprime([2, 3, 4], 1), '[1, Mat([2, 2, 1]), 0]') @@ -48,9 +47,9 @@ def test_isprime(self): # pari.isprime(2^3515+159, 2) 10 min # pari.isprime(2^2000+841, 2) 1 min # pari.isprime(2^1600+895, 2) 27s - self.assertEquals(pari.isprime(int(pow(2, 1000)) + 297, 2), '1') + self.assertEquals(pari.isprime(2 ** 1000 + 297, 2), '1') - self.assertEquals(pari.isprime(int(pow(2, 256)) + 5721), '1') + self.assertEquals(pari.isprime(2 ** 256 + 5721), '1') """**** Original expected results **** From ade114838fe66d411e08683e54dcd29f33240d81 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Thu, 12 Oct 2017 15:04:43 +0200 Subject: [PATCH 10/28] unittest polred --- tests/unittests/polred.py | 289 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 289 insertions(+) create mode 100644 tests/unittests/polred.py diff --git a/tests/unittests/polred.py b/tests/unittests/polred.py new file mode 100644 index 0000000..e6a5a44 --- /dev/null +++ b/tests/unittests/polred.py @@ -0,0 +1,289 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file polred : +rnfpolredbest(nfinit(quadpoly(5,y)),x^7-14*x^5+56*x^3-56*x+22) +\\ rnfpolred(nfinit(quadpoly(1996,y)),quadray(1996,1)) +\\ rnfpolred(nfinit(quadpoly(904,y)),quadray(904,1)) +K=nfinit(quadpoly(29,y)); T=quadray(29,17) +rnfpolredabs(K,T) +rnfpolredbest(K,T) +rnfpolredabs(K,[T,100],16) +rnfpolredbest(K,[T,100]) +K=nfinit(y^3-y-1); T=x^3-x-1; +rnfpolredabs(K,T) +rnfpolredabs(K,T,2) +[P,a]=rnfpolredbest(K,T,1); +subst(K.pol,y,a) +[P,a,b]=rnfpolredbest(K,T,3); +subst(K.pol,y,a) +substvec(T,[x,y],[a,b]) +rnfpolred(nfinit(quadpoly(1129,y)),quadray(1129,1)); + +nfinit(Pol([256,-2560,5120,6400,-60320,6976,116320,72560,-456615,270630,-129362])); +polredabs(quadpoly(14586217464)) +{ +p=x^32 - 1680*x^30 + 1026480*x^28 - 289096080*x^26 + 39933334980*x^24 - +2715474610800*x^22 + 88886222283600*x^20 - 1619990314513200*x^18 + +17928141864081750*x^16 - 125620995771054000*x^14 + 565267786831818000*x^12 - +1629524362237758000*x^10 + 2978275448322310500*x^8 - 3393290168363970000*x^6 + +2319247705779270000*x^4 - 866101453967610000*x^2 + 135345425000900625; +#polredabs(p,4) +} +polredabs(x^12+139968*x^10+24814646784*x^8+1854249948463104*x^6+177954917169813848064*x^4-1827912356210202139164672*x^2+68504919608701082757419237376); +polredabs(x^4+10^21*x^2+1) +polredabs(x^4+146077*x^2+2629386) +\\#1146 +polredabs(x^9-4*x^7-3*x^6+9*x^5+8*x^4-6*x^3-9*x^2-4*x-1) +\\#1228 +polredabs(x^5-13*x^3+3*x^2+5*x-1) +\\#1229 +polredabs(x^6+21471450*x^2+71643071500) +polredbest(x^6+21471450*x^2+71643071500) +polredbest(4*x^4+146077*x^2+2629386) + +polredabs(2*x+1) +polredabs(2*x+1,1) +polred([x,[1]]) +polred(2*x+1) +polred(2*x+1,1) +polred(4*x^2+1,2) +polredbest(2*x+1) +polredbest(2*x+1,1) +polredbest(4*x^2+1,1) +polredord(2*x+1) +polredord(4*x^2+1) +\\ #1519, test T->unscale != 1 +polredbest(x^8+24*x^6+80*x^5+1040*x^4-4288*x^3-12736*x^2-61952*x+311296,1) +\\ #1511 +polredabs(x^16-4*x^15-334*x^14+264*x^13+32231*x^12+57392*x^11-1031422*x^10-3628868*x^9+7185297*x^8+42417784*x^7+11283472*x^6-137773504*x^5-127243504*x^4+69059728*x^3+56307944*x^2-6264432*x+6436) +\\ #1653 +default(parisize, 3<<23); +f=x^40+10*x^39+75*x^38+410*x^37+1888*x^36+7364*x^35+25310*x^34+77140*x^33+211669*x^32+524946*x^31+1183823*x^30+2430610*x^29+4548530*x^28+7743916*x^27+11954920*x^26+16627228*x^25+20626386*x^24+22445616*x^23+20835590*x^22+15611648*x^21+8209812*x^20+1290846*x^19-2562740*x^18-2525172*x^17-76374*x^16+2095346*x^15+2320830*x^14+1050748*x^13-71120*x^12-238080*x^11+31952*x^10+106808*x^9+12549*x^8-18470*x^7-485*x^6+3202*x^5-232*x^4-430*x^3+150*x^2-20*x+1; +polredbest(f); +polredabs(x^5 - 331137220*x^4 + 37922047405356360*x^3 - 1127174691845938128093840*x^2 + 52208293424667465123438066822480*x - 16507431553557006099641796204889368224) + +f=5*x^12+13*x^4+11*x^3+2*x+1; +[g,h] = polredabs(f,1); [g,subst(f,x,h)] +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestPolred(unittest.TestCase): + def test_polred(self): + y = pari('y') + x = pari('x') + self.assertEquals( + pari.rnfpolredbest(pari.nfinit(pari.quadpoly(5, y)), x ** 7 - 14 * x ** 5 + 56 * x ** 3 - 56 * x + 22), + 'x^7 + Mod(7*y, y^2 - y - 1)*x^6 + Mod(21*y + 7, y^2 - y - 1)*x^5 + 35*x^4 + Mod(-35*y - ' + + '14, y^2 - y - 1)*x^3 + Mod(-7*y - 77, y^2 - y - 1)*x^2 + Mod(14*y + 7, y^2 - y - 1)*x + ' + + 'Mod(-y + 44, y^2 - y - 1)') + # \\ pari.rnfpolred(pari.nfinit(pari.quadpoly(1996,y)),pari.quadray(1996,1)) + # \\ pari.rnfpolred(pari.nfinit(pari.quadpoly(904,y)),pari.quadray(904,1)) + K = pari.nfinit(pari.quadpoly(29, y)); + T = pari.quadray(29, 17) + self.assertEquals(T, + 'x^8 + Mod(-5265231366756*y - 11544453645457, y^2 - y - 7)*x^7 + Mod(28411458541660742678' + + '6*y + 622944640581258439174, y^2 - y - 7)*x^6 + Mod(-88698486784831757442657946*y - 1944' + + '78741347464554095950854, y^2 - y - 7)*x^5 + Mod(1457861838374320941446687517087*y + 3196' + + '482213651741289611519839129, y^2 - y - 7)*x^4 + Mod(-3466536016262523445329224834043387*' + + 'y - 7600665870589330277066596588522840, y^2 - y - 7)*x^3 + Mod(5000592518487564664208359' + + '83321373618*y + 1096421116344588264250099626740668170, y^2 - y - 7)*x^2 + Mod(-191620894' + + '46215341153510282273347908836*y - 42014460135353505823787366140454468112, y^2 - y - 7)*x' + + ' + Mod(100691810991091652032034511974871062155*y + 2207750929623871787473021021190225896' + + '88, y^2 - y - 7)') + self.assertEquals(pari.rnfpolredabs(K, T), + 'x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mod(-385*y - 2' + + '51, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod(-2451*y - 3350, y^2 - y ' + + '- 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod(-2050*y - 3861, y^2 - y - 7)*x + Mo' + + 'd(565*y + 1331, y^2 - y - 7)') + self.assertEquals(pari.rnfpolredbest(K, T), + 'x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mod(-385*y - 2' + + '51, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod(-2451*y - 3350, y^2 - y ' + + '- 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod(-2050*y - 3861, y^2 - y - 7)*x + Mo' + + 'd(565*y + 1331, y^2 - y - 7)') + self.assertEquals(pari.rnfpolredabs(K, [T, 100], 16), + 'x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mod(-385*y - 2' + + '51, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod(-2451*y - 3350, y^2 - y ' + + '- 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod(-2050*y - 3861, y^2 - y - 7)*x + Mo' + + 'd(565*y + 1331, y^2 - y - 7)') + self.assertEquals(pari.rnfpolredbest(K, [T, 100]), + 'x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mod(-385*y - 2' + + '51, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod(-2451*y - 3350, y^2 - y ' + + '- 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod(-2050*y - 3861, y^2 - y - 7)*x + Mo' + + 'd(565*y + 1331, y^2 - y - 7)') + K = pari.nfinit(y ** 3 - y - 1); + T = x ** 3 - x - 1; + self.assertEquals(pari.rnfpolredabs(K, T), + 'x^3 + Mod(y^2 - 2, y^3 - y - 1)*x^2 + Mod(-y + 1, y^3 - y - 1)*x + Mod(y - 1, y^3 - y - ' + + '1)') + self.assertEquals(pari.rnfpolredabs(K, T, 2), + 'x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1') + [P, a] = pari.rnfpolredbest(K, T, 1); + self.assertEquals(pari.subst(K[0], y, a), + 'Mod(0, x^3 + Mod(y^2 - y - 2, y^3 - y - 1)*x^2 + Mod(-y^2 + y + 1, y^3 - y - 1)*x + Mod(' + + 'y^2, y^3 - y - 1))') + [P, a, b] = pari.rnfpolredbest(K, T, 3); + self.assertEquals(pari.subst(K[0], y, a), + 'Mod(0, x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1)') + self.assertEquals(pari.substvec(T, [x, y], [a, b]), + 'Mod(0, x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1)') + pari.rnfpolred(pari.nfinit(pari.quadpoly(1129, y)), pari.quadray(1129, 1)); + + pari.nfinit(pari.Pol([256, -2560, 5120, 6400, -60320, 6976, 116320, 72560, -456615, 270630, -129362])); + self.assertEquals(pari.polredabs(pari.quadpoly(14586217464)), 'x^2 - 3646554366') + p = x ** 32 - 1680 * x ** 30 + 1026480 * x ** 28 - 289096080 * x ** 26 + 39933334980 * x ** 24 - \ + 2715474610800 * x ** 22 + 88886222283600 * x ** 20 - 1619990314513200 * x ** 18 + 17928141864081750 * x \ + ** 16 - 125620995771054000 * x ** 14 + 565267786831818000 * x ** 12 - 1629524362237758000 * x ** 10 + \ + 2978275448322310500 * x ** 8 - 3393290168363970000 * x ** 6 + 2319247705779270000 * x ** 4 - \ + 866101453967610000 * x ** 2 + 135345425000900625; + self.assertEquals(len(pari.polredabs(p,4)), 304) + pari.polredabs( + x ** 12 + 139968 * x ** 10 + 24814646784 * x ** 8 + 1854249948463104 * x ** 6 + 177954917169813848064 * x + ** 4 - 1827912356210202139164672 * x ** 2 + 68504919608701082757419237376); + self.assertEquals(pari.polredabs(x ** 4 + 10 ** 21 * x ** 2 + 1), 'x^4 + 1000000000000000000000*x^2 + 1') + self.assertEquals(pari.polredabs(x ** 4 + 146077 * x ** 2 + 2629386), 'x^4 + 146077*x^2 + 2629386') + # #1146 + self.assertEquals(pari.polredabs( + x ** 9 - 4 * x ** 7 - 3 * x ** 6 + 9 * x ** 5 + 8 * x ** 4 - 6 * x ** 3 - 9 * x ** 2 - 4 * x - 1), + 'x^9 - 4*x^7 - 3*x^6 + 9*x^5 + 8*x^4 - 6*x^3 - 9*x^2 - 4*x - 1') + # #1228 + self.assertEquals(pari.polredabs(x ** 5 - 13 * x ** 3 + 3 * x ** 2 + 5 * x - 1), + 'x^5 - 13*x^3 - 3*x^2 + 5*x + 1') + # #1229 + self.assertEquals(pari.polredabs(x ** 6 + 21471450 * x ** 2 + 71643071500), 'x^6 + 21471450*x^2 + 71643071500') + self.assertEquals(pari.polredbest(x ** 6 + 21471450 * x ** 2 + 71643071500), + 'x^6 - 12*x^4 - 24*x^3 + 21651666*x^2 - 257657256*x + 71814482884') + self.assertEquals(pari.polredbest(4 * x ** 4 + 146077 * x ** 2 + 2629386), 'x^4 + 146077*x^2 + 10517544') + + self.assertEquals(pari.polredabs(2 * x + 1), 'x') + self.assertEquals(pari.polredabs(2 * x + 1, 1), '[x, Mod(-1/2, x)]') + with self.assertRaises(PariError) as context: + pari.polred([x, [1]]) + self.assertTrue('domain error in gvaluation: p = 1' in str(context.exception)) + self.assertEquals(pari.polred(2 * x + 1), '[x - 1]') + self.assertEquals(pari.polred(2 * x + 1, 1), '[x - 1]') + self.assertEquals(pari.polred(4 * x ** 2 + 1, 2), '[1, x-1; 2*x, x^2+1]') + self.assertEquals(pari.polredbest(2 * x + 1), 'x + 1') + self.assertEquals(pari.polredbest(2 * x + 1, 1), '[x + 1, Mod(-1/2, x + 1)]') + self.assertEquals(pari.polredbest(4 * x ** 2 + 1, 1), '[x^2 + 1, Mod(1/2*x, x^2 + 1)]') + self.assertEquals(pari.polredord(2 * x + 1), '[2*x + 1]') + self.assertEquals(pari.polredord(4 * x ** 2 + 1), '[x - 1, x^2 + 1]') + # len(1519), test T->unscale != 1 + self.assertEquals(pari.polredbest( + x ** 8 + 24 * x ** 6 + 80 * x ** 5 + 1040 * x ** 4 - 4288 * x ** 3 - 12736 * x ** 2 - 61952 * x + 311296, + 1), + '[x^8 - 4*x^7 + 24*x^6 - 58*x^5 + 126*x^4 - 160*x^3 + 160*x^2 - 89*x + 26, Mod(-68/135*x^' + + '7 + 208/135*x^6 - 1378/135*x^5 + 56/3*x^4 - 194/5*x^3 + 4976/135*x^2 - 4492/135*x + 1856' + + '/135, x^8 - 4*x^7 + 24*x^6 - 58*x^5 + 126*x^4 - 160*x^3 + 160*x^2 - 89*x + 26)]') + # #1511 + self.assertEquals(pari.polredabs( + x ** 16 - 4 * x ** 15 - 334 * x ** 14 + 264 * x ** 13 + 32231 * x ** 12 + 57392 * x ** 11 - 1031422 * x + ** 10 - 3628868 * x ** 9 + 7185297 * x ** 8 + 42417784 * x ** 7 + 11283472 * x ** 6 - 137773504 * x ** 5 + - 127243504 * x ** 4 + 69059728 * x ** 3 + 56307944 * x ** 2 - 6264432 * x + 6436), + 'x^16 - 4*x^15 - 334*x^14 + 264*x^13 + 32231*x^12 + 57392*x^11 - 1031422*x^10 - 3628868*x' + + '^9 + 7185297*x^8 + 42417784*x^7 + 11283472*x^6 - 137773504*x^5 - 127243504*x^4 + 6905972' + + '8*x^3 + 56307944*x^2 - 6264432*x + 6436') + # #1653 + # pari.default(parisize, 3 << 23); + f = x ** 40 + 10 * x ** 39 + 75 * x ** 38 + 410 * x ** 37 + 1888 * x ** 36 + 7364 * x ** 35 + 25310 * x ** 34 \ + + 77140 * x ** 33 + 211669 * x ** 32 + 524946 * x ** 31 + 1183823 * x ** 30 + 2430610 * x ** 29 + 4548530 \ + * x ** \ + 28 + \ + 7743916 * x ** 27 + 11954920 * x ** 26 + 16627228 * x ** 25 + 20626386 * x ** 24 + 22445616 * x ** 23 + \ + 20835590 * x ** 22 + 15611648 * x ** 21 + 8209812 * x ** 20 + 1290846 * x ** 19 - 2562740 * x ** 18 - \ + 2525172 * x ** 17 - 76374 * x ** 16 + 2095346 * x ** 15 + 2320830 * x ** 14 + 1050748 * x ** 13 - 71120 * \ + x ** 12 \ + - 238080 * x ** 11 + 31952 * x ** 10 + 106808 * x ** 9 + 12549 * x ** 8 - 18470 * x ** 7 - 485 * x ** 6 + \ + 3202 * x ** 5 - 232 * x ** 4 - 430 * x ** 3 + 150 * x ** 2 - 20 * x + 1; + pari.polredbest(f); + self.assertEquals(pari.polredabs( + x ** 5 - 331137220 * x ** 4 + 37922047405356360 * x ** 3 - 1127174691845938128093840 * x ** 2 + + 52208293424667465123438066822480 * x - 16507431553557006099641796204889368224), 'x^5 + 5*x - 1') + + f = 5 * x ** 12 + 13 * x ** 4 + 11 * x ** 3 + 2 * x + 1; + [g, h] = pari.polredabs(f, 1); + self.assertEquals(g, 'x^12 - 2*x^11 - 11*x^9 + 13*x^8 + 5') + self.assertEquals(pari.subst(f, x, h), 'Mod(0, x^12 - 2*x^11 - 11*x^9 + 13*x^8 + 5)') + +"""**** Original expected results **** + +x^7 + Mod(7*y, y^2 - y - 1)*x^6 + Mod(21*y + 7, y^2 - y - 1)*x^5 + 35*x^4 + +Mod(-35*y - 14, y^2 - y - 1)*x^3 + Mod(-7*y - 77, y^2 - y - 1)*x^2 + Mod(14* +y + 7, y^2 - y - 1)*x + Mod(-y + 44, y^2 - y - 1) +x^8 + Mod(-5265231366756*y - 11544453645457, y^2 - y - 7)*x^7 + Mod(28411458 +5416607426786*y + 622944640581258439174, y^2 - y - 7)*x^6 + Mod(-88698486784 +831757442657946*y - 194478741347464554095950854, y^2 - y - 7)*x^5 + Mod(1457 +861838374320941446687517087*y + 3196482213651741289611519839129, y^2 - y - 7 +)*x^4 + Mod(-3466536016262523445329224834043387*y - 760066587058933027706659 +6588522840, y^2 - y - 7)*x^3 + Mod(500059251848756466420835983321373618*y + +1096421116344588264250099626740668170, y^2 - y - 7)*x^2 + Mod(-1916208944621 +5341153510282273347908836*y - 42014460135353505823787366140454468112, y^2 - +y - 7)*x + Mod(100691810991091652032034511974871062155*y + 22077509296238717 +8747302102119022589688, y^2 - y - 7) +x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mo +d(-385*y - 251, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod( +-2451*y - 3350, y^2 - y - 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod +(-2050*y - 3861, y^2 - y - 7)*x + Mod(565*y + 1331, y^2 - y - 7) +x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mo +d(-385*y - 251, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod( +-2451*y - 3350, y^2 - y - 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod +(-2050*y - 3861, y^2 - y - 7)*x + Mod(565*y + 1331, y^2 - y - 7) +x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mo +d(-385*y - 251, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod( +-2451*y - 3350, y^2 - y - 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod +(-2050*y - 3861, y^2 - y - 7)*x + Mod(565*y + 1331, y^2 - y - 7) +x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mo +d(-385*y - 251, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod( +-2451*y - 3350, y^2 - y - 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod +(-2050*y - 3861, y^2 - y - 7)*x + Mod(565*y + 1331, y^2 - y - 7) +x^3 + Mod(y^2 - 2, y^3 - y - 1)*x^2 + Mod(-y + 1, y^3 - y - 1)*x + Mod(y - 1 +, y^3 - y - 1) +x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1 +Mod(0, x^3 + Mod(y^2 - y - 2, y^3 - y - 1)*x^2 + Mod(-y^2 + y + 1, y^3 - y - + 1)*x + Mod(y^2, y^3 - y - 1)) +Mod(0, x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1) +Mod(0, x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1) + *** nfinit: Warning: non-monic polynomial. Result of the form [nf,c]. +x^2 - 3646554366 +304 +x^4 + 1000000000000000000000*x^2 + 1 +x^4 + 146077*x^2 + 2629386 +x^9 - 4*x^7 - 3*x^6 + 9*x^5 + 8*x^4 - 6*x^3 - 9*x^2 - 4*x - 1 +x^5 - 13*x^3 - 3*x^2 + 5*x + 1 +x^6 + 21471450*x^2 + 71643071500 +x^6 - 12*x^4 - 24*x^3 + 21651666*x^2 - 257657256*x + 71814482884 +x^4 + 146077*x^2 + 10517544 +x +[x, Mod(-1/2, x)] + *** at top-level: polred([x,[1]]) + *** ^--------------- + *** polred: domain error in gvaluation: p = 1 +[x - 1] +[x - 1] + +[ 1 x - 1] + +[2*x x^2 + 1] + +x + 1 +[x + 1, Mod(-1/2, x + 1)] +[x^2 + 1, Mod(1/2*x, x^2 + 1)] +[2*x + 1] +[x - 1, x^2 + 1] +[x^8 - 4*x^7 + 24*x^6 - 58*x^5 + 126*x^4 - 160*x^3 + 160*x^2 - 89*x + 26, Mo +d(-68/135*x^7 + 208/135*x^6 - 1378/135*x^5 + 56/3*x^4 - 194/5*x^3 + 4976/135 +*x^2 - 4492/135*x + 1856/135, x^8 - 4*x^7 + 24*x^6 - 58*x^5 + 126*x^4 - 160* +x^3 + 160*x^2 - 89*x + 26)] +x^16 - 4*x^15 - 334*x^14 + 264*x^13 + 32231*x^12 + 57392*x^11 - 1031422*x^10 + - 3628868*x^9 + 7185297*x^8 + 42417784*x^7 + 11283472*x^6 - 137773504*x^5 - + 127243504*x^4 + 69059728*x^3 + 56307944*x^2 - 6264432*x + 6436 + *** Warning: new stack size = 25165824 (24.000 Mbytes). +x^5 + 5*x - 1 +[x^12 - 2*x^11 - 11*x^9 + 13*x^8 + 5, Mod(0, x^12 - 2*x^11 - 11*x^9 + 13*x^8 + + 5)] + +""" From 60efa3a4c272aebac3b997a4ba7c8a247fac29fb Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Thu, 12 Oct 2017 15:07:05 +0200 Subject: [PATCH 11/28] unittest Add polred file in alltest --- tests/unittests/alltest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 93d918a..32ece89 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -46,7 +46,8 @@ 'subst', 'sumdedekind', 'sumformal', - 'zeta' + 'zeta', + 'polred' ] suite = unittest.TestSuite() From 56929096d14da4166c2dbe123304ea1ac8656405 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Fri, 13 Oct 2017 14:28:35 +0200 Subject: [PATCH 12/28] unittest : add bit test file --- tests/unittests/alltest.py | 3 +- tests/unittests/bit.py | 429 +++++++++++++++++++++++++++++++++++++ 2 files changed, 431 insertions(+), 1 deletion(-) create mode 100644 tests/unittests/bit.py diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 32ece89..d332aa1 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -47,7 +47,8 @@ 'sumdedekind', 'sumformal', 'zeta', - 'polred' + 'polred', + 'bit' ] suite = unittest.TestSuite() diff --git a/tests/unittests/bit.py b/tests/unittests/bit.py new file mode 100644 index 0000000..7ebf644 --- /dev/null +++ b/tests/unittests/bit.py @@ -0,0 +1,429 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file bit : +hammingweight(15) +hammingweight(x^100 + 2*x + 1) +hammingweight([Mod(1,2), 2, Mod(0,3)]) +hammingweight(Vecsmall([0,1,2,3])) +hammingweight(matid(100)) +hammingweight(I) +N = 2^128+2^64+1; +[bittest(N, i) | i<-[60..70]] +{ + args = [0, 3, -3, 2^65-1, N, -N, I]; + funs = [bitand, bitnegimply, bitor, bitxor]; + for (a=1,#funs, + my (f = funs[a]); + print("#", f); + for (i=1,#args, + for (j=i,#args, + my(u=args[i], v=args[j]); + print([u,v,iferr(f(u,v),E,E)]) + ) + ) + ); + print("#bitneg"); + for (i=1, #args, + my (u=args[i]); + print(iferr([u, bitneg(u,65),bitneg(u)],E,E)) + ) +} + +bittest(-1,10) +bitneg(-2,64) +bitneg(1,-2) +bitneg(1,128) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestBit(unittest.TestCase): + def iferr(self,f, u, v): + """ + :param f: + :param u: + :param v: + :return: f result with u and v parameter or an error in string + """ + try: + return f(u,v) + except PariError as e: + return str(e) + + + def test_hammingweight(self): + x = pari('x') + self.assertEquals(str(pari.hammingweight(15)), '4') + self.assertEquals(str(pari.hammingweight(x ** 100 + 2 * x + 1)), '3') + self.assertEquals(str(pari.hammingweight([pari.Mod(1, 2), 2, pari.Mod(0, 3)])), '2') + self.assertEquals(str(pari.hammingweight(pari.Vecsmall([0, 1, 2, 3]))), '3') + self.assertEquals(str(pari.hammingweight(pari.matid(100))), '100') + with self.assertRaises(PariError) as context: + pari.hammingweight('I') + self.assertTrue('incorrect type in hammingweight (t_COMPLEX)' in str(context.exception)) + + def test_bit(self): + N = 2 ** 128 + 2 ** 64 + 1; + self.assertEquals(str([pari.bittest(N, i) for i in range(60, 71)]), '[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]') + + res = [['[0, 0, 0]', + '[0, 3, 0]', + '[0, -3, 0]', + '[0, 36893488147419103231L, 0]', + '[0, 340282366920938463481821351505477763073L, 0]', + '[0, -340282366920938463481821351505477763073L, 0]', + '[0, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', + '[3, 3, 3]', + '[3, -3, 1]', + '[3, 36893488147419103231L, 3]', + '[3, 340282366920938463481821351505477763073L, 1]', + '[3, -340282366920938463481821351505477763073L, 3]', + '[3, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', + '[-3, -3, -3]', + '[-3, 36893488147419103231L, 36893488147419103229]', + '[-3, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763073]', + '[-3, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763075]', + '[-3, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', + '[36893488147419103231L, 36893488147419103231L, 36893488147419103231]', + '[36893488147419103231L, 340282366920938463481821351505477763073L, 18446744073709551617]', + '[36893488147419103231L, -340282366920938463481821351505477763073L, 18446744073709551615]', + '[36893488147419103231L, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', + '[340282366920938463481821351505477763073L, 340282366920938463481821351505477763073L, ' + '340282366920938463481821351505477763073]', + '[340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, 1]', + '[340282366920938463481821351505477763073L, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', + '[-340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, ' + '-340282366920938463481821351505477763073]', + '[-340282366920938463481821351505477763073L, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', + '[I, I, \'forbidden bitwise and t_COMPLEX , t_COMPLEX\']'], + ['[0, 0, 0]', + '[0, 3, 0]', + '[0, -3, 0]', + '[0, 36893488147419103231L, 0]', + '[0, 340282366920938463481821351505477763073L, 0]', + '[0, -340282366920938463481821351505477763073L, 0]', + '[0, I, \'forbidden bitwise negated imply t_INT , t_COMPLEX\']', + '[3, 3, 0]', + '[3, -3, 2]', + '[3, 36893488147419103231L, 0]', + '[3, 340282366920938463481821351505477763073L, 2]', + '[3, -340282366920938463481821351505477763073L, 0]', + '[3, I, \'forbidden bitwise negated imply t_INT , t_COMPLEX\']', + '[-3, -3, 0]', + '[-3, 36893488147419103231L, -36893488147419103232]', + '[-3, 340282366920938463481821351505477763073L, -340282366920938463481821351505477763076]', + '[-3, -340282366920938463481821351505477763073L, 340282366920938463481821351505477763072]', + '[-3, I, \'forbidden bitwise negated imply t_INT , t_COMPLEX\']', + '[36893488147419103231L, 36893488147419103231L, 0]', + '[36893488147419103231L, 340282366920938463481821351505477763073L, 18446744073709551614]', + '[36893488147419103231L, -340282366920938463481821351505477763073L, 18446744073709551616]', + '[36893488147419103231L, I, \'forbidden bitwise negated imply t_INT , t_COMPLEX\']', + '[340282366920938463481821351505477763073L, 340282366920938463481821351505477763073L, 0]', + '[340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, ' + '340282366920938463481821351505477763072]', + '[340282366920938463481821351505477763073L, I, \'forbidden bitwise negated imply t_INT , ' + 't_COMPLEX\']', + '[-340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, 0]', + '[-340282366920938463481821351505477763073L, I, \'forbidden bitwise negated imply t_INT , ' + 't_COMPLEX\']', + '[I, I, \'forbidden bitwise negated imply t_COMPLEX , t_COMPLEX\']'], + ['[0, 0, 0]', + '[0, 3, 3]', + '[0, -3, -3]', + '[0, 36893488147419103231L, 36893488147419103231]', + '[0, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763073]', + '[0, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763073]', + '[0, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', + '[3, 3, 3]', + '[3, -3, -1]', + '[3, 36893488147419103231L, 36893488147419103231]', + '[3, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763075]', + '[3, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763073]', + '[3, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', + '[-3, -3, -3]', + '[-3, 36893488147419103231L, -1]', + '[-3, 340282366920938463481821351505477763073L, -3]', + '[-3, -340282366920938463481821351505477763073L, -1]', + '[-3, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', + '[36893488147419103231L, 36893488147419103231L, 36893488147419103231]', + '[36893488147419103231L, 340282366920938463481821351505477763073L, ' + '340282366920938463500268095579187314687]', + '[36893488147419103231L, -340282366920938463481821351505477763073L, ' + '-340282366920938463463374607431768211457]', + '[36893488147419103231L, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', + '[340282366920938463481821351505477763073L, 340282366920938463481821351505477763073L, ' + '340282366920938463481821351505477763073]', + '[340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, -1]', + '[340282366920938463481821351505477763073L, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', + '[-340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, ' + '-340282366920938463481821351505477763073]', + '[-340282366920938463481821351505477763073L, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', + '[I, I, \'forbidden bitwise or t_COMPLEX , t_COMPLEX\']'], + ['[0, 0, 0]', + '[0, 3, 3]', + '[0, -3, -3]', + '[0, 36893488147419103231L, 36893488147419103231]', + '[0, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763073]', + '[0, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763073]', + '[0, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', + '[3, 3, 0]', + '[3, -3, -2]', + '[3, 36893488147419103231L, 36893488147419103228]', + '[3, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763074]', + '[3, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763076]', + '[3, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', + '[-3, -3, 0]', + '[-3, 36893488147419103231L, -36893488147419103230]', + '[-3, 340282366920938463481821351505477763073L, -340282366920938463481821351505477763076]', + '[-3, -340282366920938463481821351505477763073L, 340282366920938463481821351505477763074]', + '[-3, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', + '[36893488147419103231L, 36893488147419103231L, 0]', + '[36893488147419103231L, 340282366920938463481821351505477763073L, ' + '340282366920938463481821351505477763070]', + '[36893488147419103231L, -340282366920938463481821351505477763073L, ' + '-340282366920938463481821351505477763072]', + '[36893488147419103231L, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', + '[340282366920938463481821351505477763073L, 340282366920938463481821351505477763073L, 0]', + '[340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, -2]', + '[340282366920938463481821351505477763073L, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', + '[-340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, 0]', + '[-340282366920938463481821351505477763073L, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', + '[I, I, \'forbidden bitwise xor t_COMPLEX , t_COMPLEX\']']] + + args = [0, 3, -3, 2 ** 65 - 1, N, -N, pari('I')]; + funs = [pari.bitand, pari.bitnegimply, pari.bitor, pari.bitxor]; + + for a in range(0, len(funs)): + f = funs[a]; + k = 0 + for i in range(0, len(args)): + for j in range(i, len(args)): + u = args[i] + v = args[j] + self.assertEquals(str([u, v, self.iferr(f, u, v)]), res[a][k]) + k += 1 + + pari.bittest(-1,10) + + def test_bitneg(self): + + def iferrbn(u): + try: + return [u, pari.bitneg(u,65),pari.bitneg(u)] + except PariError as e: + return str(e) + N = 2 ** 128 + 2 ** 64 + 1; + args = [0, 3, -3, 2 ** 65 - 1, N, -N, pari('I')]; + + res = ['[0, 36893488147419103231, -1]', + '[3, 36893488147419103228, -4]', + '[-3, 2, 2]', + '[36893488147419103231L, 0, -36893488147419103232]', + '[340282366920938463481821351505477763073L, 18446744073709551614, ' + '-340282366920938463481821351505477763074]', + '[-340282366920938463481821351505477763073L, 18446744073709551616, 34028236692093846348182135150547776' + '3072]', + 'incorrect type in bitwise negation (t_COMPLEX)'] + + for i in range(0, len(args)): + u = args[i] + self.assertEquals(str(iferrbn(u)), res[i]) + + self.assertEquals(pari.bitneg(-2, 64), '1') + with self.assertRaises(PariError) as context: + pari.bitneg(1, -2) + self.assertTrue('domain error in bitwise negation: exponent < -1' in str(context.exception)) + self.assertEquals(pari.bitneg(1, 128), '340282366920938463463374607431768211454') + +"""**** Original expected results **** + +4 +3 +2 +3 +100 + *** at top-level: hammingweight(I) + *** ^---------------- + *** hammingweight: incorrect type in hammingweight (t_COMPLEX). +[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0] +#bitand +[0, 0, 0] +[0, 3, 0] +[0, -3, 0] +[0, 36893488147419103231, 0] +[0, 340282366920938463481821351505477763073, 0] +[0, -340282366920938463481821351505477763073, 0] +[0, I, error("forbidden bitwise and t_INT , t_COMPLEX.")] +[3, 3, 3] +[3, -3, 1] +[3, 36893488147419103231, 3] +[3, 340282366920938463481821351505477763073, 1] +[3, -340282366920938463481821351505477763073, 3] +[3, I, error("forbidden bitwise and t_INT , t_COMPLEX.")] +[-3, -3, -3] +[-3, 36893488147419103231, 36893488147419103229] +[-3, 340282366920938463481821351505477763073, 340282366920938463481821351505 +477763073] +[-3, -340282366920938463481821351505477763073, -3402823669209384634818213515 +05477763075] +[-3, I, error("forbidden bitwise and t_INT , t_COMPLEX.")] +[36893488147419103231, 36893488147419103231, 36893488147419103231] +[36893488147419103231, 340282366920938463481821351505477763073, 184467440737 +09551617] +[36893488147419103231, -340282366920938463481821351505477763073, 18446744073 +709551615] +[36893488147419103231, I, error("forbidden bitwise and t_INT , t_COMPLEX.")] +[340282366920938463481821351505477763073, 3402823669209384634818213515054777 +63073, 340282366920938463481821351505477763073] +[340282366920938463481821351505477763073, -340282366920938463481821351505477 +763073, 1] +[340282366920938463481821351505477763073, I, error("forbidden bitwise and t_ +INT , t_COMPLEX.")] +[-340282366920938463481821351505477763073, -34028236692093846348182135150547 +7763073, -340282366920938463481821351505477763073] +[-340282366920938463481821351505477763073, I, error("forbidden bitwise and t +_INT , t_COMPLEX.")] +[I, I, error("forbidden bitwise and t_COMPLEX , t_COMPLEX.")] +#bitnegimply +[0, 0, 0] +[0, 3, 0] +[0, -3, 0] +[0, 36893488147419103231, 0] +[0, 340282366920938463481821351505477763073, 0] +[0, -340282366920938463481821351505477763073, 0] +[0, I, error("forbidden bitwise negated imply t_INT , t_COMPLEX.")] +[3, 3, 0] +[3, -3, 2] +[3, 36893488147419103231, 0] +[3, 340282366920938463481821351505477763073, 2] +[3, -340282366920938463481821351505477763073, 0] +[3, I, error("forbidden bitwise negated imply t_INT , t_COMPLEX.")] +[-3, -3, 0] +[-3, 36893488147419103231, -36893488147419103232] +[-3, 340282366920938463481821351505477763073, -34028236692093846348182135150 +5477763076] +[-3, -340282366920938463481821351505477763073, 34028236692093846348182135150 +5477763072] +[-3, I, error("forbidden bitwise negated imply t_INT , t_COMPLEX.")] +[36893488147419103231, 36893488147419103231, 0] +[36893488147419103231, 340282366920938463481821351505477763073, 184467440737 +09551614] +[36893488147419103231, -340282366920938463481821351505477763073, 18446744073 +709551616] +[36893488147419103231, I, error("forbidden bitwise negated imply t_INT , t_C +OMPLEX.")] +[340282366920938463481821351505477763073, 3402823669209384634818213515054777 +63073, 0] +[340282366920938463481821351505477763073, -340282366920938463481821351505477 +763073, 340282366920938463481821351505477763072] +[340282366920938463481821351505477763073, I, error("forbidden bitwise negate +d imply t_INT , t_COMPLEX.")] +[-340282366920938463481821351505477763073, -34028236692093846348182135150547 +7763073, 0] +[-340282366920938463481821351505477763073, I, error("forbidden bitwise negat +ed imply t_INT , t_COMPLEX.")] +[I, I, error("forbidden bitwise negated imply t_COMPLEX , t_COMPLEX.")] +#bitor +[0, 0, 0] +[0, 3, 3] +[0, -3, -3] +[0, 36893488147419103231, 36893488147419103231] +[0, 340282366920938463481821351505477763073, 3402823669209384634818213515054 +77763073] +[0, -340282366920938463481821351505477763073, -34028236692093846348182135150 +5477763073] +[0, I, error("forbidden bitwise or t_INT , t_COMPLEX.")] +[3, 3, 3] +[3, -3, -1] +[3, 36893488147419103231, 36893488147419103231] +[3, 340282366920938463481821351505477763073, 3402823669209384634818213515054 +77763075] +[3, -340282366920938463481821351505477763073, -34028236692093846348182135150 +5477763073] +[3, I, error("forbidden bitwise or t_INT , t_COMPLEX.")] +[-3, -3, -3] +[-3, 36893488147419103231, -1] +[-3, 340282366920938463481821351505477763073, -3] +[-3, -340282366920938463481821351505477763073, -1] +[-3, I, error("forbidden bitwise or t_INT , t_COMPLEX.")] +[36893488147419103231, 36893488147419103231, 36893488147419103231] +[36893488147419103231, 340282366920938463481821351505477763073, 340282366920 +938463500268095579187314687] +[36893488147419103231, -340282366920938463481821351505477763073, -3402823669 +20938463463374607431768211457] +[36893488147419103231, I, error("forbidden bitwise or t_INT , t_COMPLEX.")] +[340282366920938463481821351505477763073, 3402823669209384634818213515054777 +63073, 340282366920938463481821351505477763073] +[340282366920938463481821351505477763073, -340282366920938463481821351505477 +763073, -1] +[340282366920938463481821351505477763073, I, error("forbidden bitwise or t_I +NT , t_COMPLEX.")] +[-340282366920938463481821351505477763073, -34028236692093846348182135150547 +7763073, -340282366920938463481821351505477763073] +[-340282366920938463481821351505477763073, I, error("forbidden bitwise or t_ +INT , t_COMPLEX.")] +[I, I, error("forbidden bitwise or t_COMPLEX , t_COMPLEX.")] +#bitxor +[0, 0, 0] +[0, 3, 3] +[0, -3, -3] +[0, 36893488147419103231, 36893488147419103231] +[0, 340282366920938463481821351505477763073, 3402823669209384634818213515054 +77763073] +[0, -340282366920938463481821351505477763073, -34028236692093846348182135150 +5477763073] +[0, I, error("forbidden bitwise xor t_INT , t_COMPLEX.")] +[3, 3, 0] +[3, -3, -2] +[3, 36893488147419103231, 36893488147419103228] +[3, 340282366920938463481821351505477763073, 3402823669209384634818213515054 +77763074] +[3, -340282366920938463481821351505477763073, -34028236692093846348182135150 +5477763076] +[3, I, error("forbidden bitwise xor t_INT , t_COMPLEX.")] +[-3, -3, 0] +[-3, 36893488147419103231, -36893488147419103230] +[-3, 340282366920938463481821351505477763073, -34028236692093846348182135150 +5477763076] +[-3, -340282366920938463481821351505477763073, 34028236692093846348182135150 +5477763074] +[-3, I, error("forbidden bitwise xor t_INT , t_COMPLEX.")] +[36893488147419103231, 36893488147419103231, 0] +[36893488147419103231, 340282366920938463481821351505477763073, 340282366920 +938463481821351505477763070] +[36893488147419103231, -340282366920938463481821351505477763073, -3402823669 +20938463481821351505477763072] +[36893488147419103231, I, error("forbidden bitwise xor t_INT , t_COMPLEX.")] +[340282366920938463481821351505477763073, 3402823669209384634818213515054777 +63073, 0] +[340282366920938463481821351505477763073, -340282366920938463481821351505477 +763073, -2] +[340282366920938463481821351505477763073, I, error("forbidden bitwise xor t_ +INT , t_COMPLEX.")] +[-340282366920938463481821351505477763073, -34028236692093846348182135150547 +7763073, 0] +[-340282366920938463481821351505477763073, I, error("forbidden bitwise xor t +_INT , t_COMPLEX.")] +[I, I, error("forbidden bitwise xor t_COMPLEX , t_COMPLEX.")] +#bitneg +[0, 36893488147419103231, -1] +[3, 36893488147419103228, -4] +[-3, 2, 2] +[36893488147419103231, 0, -36893488147419103232] +[340282366920938463481821351505477763073, 18446744073709551614, -34028236692 +0938463481821351505477763074] +[-340282366920938463481821351505477763073, 18446744073709551616, 34028236692 +0938463481821351505477763072] +error("incorrect type in bitwise negation (t_COMPLEX).") +1 +1 + *** at top-level: bitneg(1,-2) + *** ^------------ + *** bitneg: domain error in bitwise negation: exponent < -1 +340282366920938463463374607431768211454 + +""" From 4c542b513ceb071cb019dbbdbf0ee68507be88b7 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Fri, 13 Oct 2017 16:40:28 +0200 Subject: [PATCH 13/28] unittest : add charpoly test file --- tests/unittests/alltest.py | 3 +- tests/unittests/charpoly.py | 223 ++++++++++++++++++++++++++++++++++++ 2 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 tests/unittests/charpoly.py diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index d332aa1..d9f2172 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -48,7 +48,8 @@ 'sumformal', 'zeta', 'polred', - 'bit' + 'bit', + 'charpoly' ] suite = unittest.TestSuite() diff --git a/tests/unittests/charpoly.py b/tests/unittests/charpoly.py new file mode 100644 index 0000000..4bddac8 --- /dev/null +++ b/tests/unittests/charpoly.py @@ -0,0 +1,223 @@ +# -*- coding: utf-8 -*- +# Created 09/26/2017 + +"""Original pari/GP test file charpoly : +charpoly([x,x+1;1,2],y,0) +charpoly([x,x+1;1,2],y,1) +charpoly([x,x+1;1,2],y,2) +charpoly([x,x+1;1,2],y,3) +charpoly([0,0,2,2;0,0,2,2;2,2,0,0;2,2,0,0]) +charpoly([0,0,2,2;0,0,2,2;2,2,0,0;2,2,0,0],,4) +minpoly(matrix(4,4,i,j,i/j)) + +default(realprecision,38); +A=[5/3,7/45;0,21/10]; +mateigen(A) +mateigen(A*1.) +mateigen(A,1) +M=[x,x+y;x+1,1];charpoly(M,w) +v=[1,1.,Mod(1,3),1/2,1+O(3),I,quadgen(5),matid(2)*Mod(1,3),matid(2)*Mod(1,2^64+13)]; +for(i=1,#v,print(charpoly(v[i]))) +charpoly(matid(4),,0) +charpoly(matid(4),,3) +charpoly(matid(4)*(2^64+13)) +m=[1,2,3,4;5,6,7,8;9,10,11,12;1,5,7,11]; +charpoly(m*Mod(1,3)) +charpoly(m*Mod(1,2^64+13)) +matadjoint(matid(2),1) +matadjoint([;]) +matadjoint(Mat(1)) +matadjoint([x,0,0;0,0,0;0,0,0]) +matadjoint([Mod(1,2)*x,0,0;0,0,0;0,0,0]) +charpoly(x*matid(3)) +minpoly(Mod(x+1,x^4+1)) +minpoly(Mod(x,x^2)) +minpoly(Mod(1,x^2+x+1)) +minpoly(Mod(1,x^24+1)) + +a=[1,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0;0,1,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0;0,0,1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0;-1,-1,-1,4,0,0,0,0,-1,0,0,0,0,0,0,0,0;0,0,0,0,1,0,0,-1,0,0,0,0,0,0,0,0,0;0,0,0,0,0,1,0,-1,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,1,-1,0,0,0,0,0,0,0,0,0;0,0,0,0,-1,-1,-1,4,-1,0,0,0,0,0,0,0,0;0,0,0,-1,0,0,0,-1,4,-1,-1,0,0,0,0,0,0;0,0,0,0,0,0,0,0,-1,1,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,-1,0,4,-1,-1,-1,0,0,0;0,0,0,0,0,0,0,0,0,0,-1,1,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,-1,0,1,0,0,0,0;0,0,0,0,0,0,0,0,0,0,-1,0,0,3,-1,0,-1;0,0,0,0,0,0,0,0,0,0,0,0,0,-1,3,-2,0;0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,2,0;0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,1]; +mateigen(a); +mateigen([;]) +mateigen([;],1) +mateigen(Mat(1)) +mateigen(Mat(1),1) + +\\ Errors, keep at end of file +charpoly(Mod('b, 'b^2 + Mod('a,'a^2+1)), 'newvar) +""" +import unittest +from cypari2 import Pari, PariError + +pari = Pari() + + +class TestCharpoly(unittest.TestCase): + def setUp(self): + pari.set_real_precision(38) + + def tearDown(self): + pari.set_real_precision(15) + + def test_charpoly(self): + x = pari('x') + y = pari('y') + self.assertEquals(pari.charpoly('[x,x+1;1,2]', y, 0), '(-y + 1)*x + (y^2 - 2*y - 1)') + self.assertEquals(pari.charpoly('[x,x+1;1,2]', y, 1), '(-y + 1)*x + (y^2 - 2*y - 1)') + self.assertEquals(pari.charpoly('[x,x+1;1,2]', y, 2), '(-y + 1)*x + (y^2 - 2*y - 1)') + self.assertEquals(pari.charpoly('[x,x+1;1,2]', y, 3), '(-y + 1)*x + (y^2 - 2*y - 1)') + self.assertEquals(pari.charpoly('[0,0,2,2;0,0,2,2;2,2,0,0;2,2,0,0]'), 'x^4 - 16*x^2') + self.assertEquals(pari.charpoly('[0,0,2,2;0,0,2,2;2,2,0,0;2,2,0,0]', None, 4), 'x^4 - 16*x^2') + + M = '[x,x+y;x+1,1]'; + self.assertEquals(pari.charpoly(M, pari('w')), '-x^2 + (-y - w)*x + (-y + (w^2 - w))') + v = [1, pari('1.'), pari.Mod(1, 3), '1/2', '1+O(3)', 'I', + pari.quadgen(5), pari.matid(2) * pari.Mod(1, 3), + pari.matid(2) * pari.Mod(1, 2 ** 64 + 13)]; + + res = ['x - 1', + 'x - 1.0000000000000000000000000000000000000', + 'x + Mod(2, 3)', + 'x - 1/2', + 'x + (2 + O(3))', + 'x^2 + 1', + 'x^2 - x - 1', + 'Mod(1, 3)*x^2 + Mod(1, 3)*x + Mod(1, 3)', + 'Mod(1, 18446744073709551629)*x^2 + Mod(18446744073709551627, 18446744073709551629)*x + Mod(1, ' + '18446744073709551629)'] + + for i in range(0, len(v)): + self.assertEquals(pari.charpoly(v[i]), res[i]) + self.assertEquals(pari.charpoly(pari.matid(4), None, 0), 'x^4 - 4*x^3 + 6*x^2 - 4*x + 1') + self.assertEquals(pari.charpoly(pari.matid(4), None, 3), 'x^4 - 4*x^3 + 6*x^2 - 4*x + 1') + self.assertEquals(pari.charpoly(pari.matid(4) * (2 ** 64 + 13)), + 'x^4 - 73786976294838206516*x^3 + 2041694201525630783657939720089299321846*x^2 - ' + '25108406941546723108427206932497066002105857518694949724756*x + ' + '115792089237316195749980275248795307917777354730270819790751905975615430356881' + ) + m = pari('[1,2,3,4;5,6,7,8;9,10,11,12;1,5,7,11]'); + self.assertEquals(pari.charpoly(m * pari.Mod(1, 3)), + 'Mod(1, 3)*x^4 + Mod(1, 3)*x^3 + Mod(1, 3)*x^2 + Mod(1, 3)*x') + self.assertEquals(pari.charpoly(m * pari.Mod(1, 2 ** 64 + 13)), + 'Mod(1, 18446744073709551629)*x^4 + Mod(18446744073709551600, 18446744073709551629)*x^3 + ' + 'Mod(46, 18446744073709551629)*x^2 + Mod(16, 18446744073709551629)*x') + with self.assertRaises(PariError) as context: + pari.charpoly(x * pari.matid(3)) + self.assertTrue('incorrect priority in charpoly: variable x = x' in str(context.exception)) + + def test_matadjoint(self): + self.assertEquals(pari.matadjoint(pari.matid(2), 1), '[1, 0; 0, 1]') + self.assertEquals(pari.matadjoint('[;]'), '[;]') + self.assertEquals(pari.matadjoint(pari.Mat(1)), 'Mat(1)') + self.assertEquals(pari.matadjoint('[x,0,0;0,0,0;0,0,0]'), '[0, 0, 0; 0, 0, 0; 0, 0, 0]') + self.assertEquals(pari.matadjoint('[Mod(1,2)*x,0,0;0,0,0;0,0,0]'), + '[Mod(0, 2), Mod(0, 2), Mod(0, 2); Mod(0, 2), Mod(0, 2), Mod(0, 2)' + '; Mod(0, 2), Mod(0, 2), Mod(0, 2)]') + + def test_minpoly(self): + x = pari('x') + self.assertEquals(pari.minpoly(pari.Mod(x + 1, x ** 4 + 1)), 'x^4 - 4*x^3 + 6*x^2 - 4*x + 2') + self.assertEquals(pari.minpoly(pari.Mod(x, x ** 2)), 'x^2') + self.assertEquals(pari.minpoly(pari.Mod(1, x ** 2 + x + 1)), 'x - 1') + self.assertEquals(pari.minpoly(pari.Mod(1, x ** 24 + 1)), 'x - 1') + + def test_mateigen(self): + A = '[5/3,7/45;0,21/10]'; + self.assertEquals(pari.mateigen(A), '[1, 14/39; 0, 1]') + self.assertEquals(str(pari.mateigen(A * pari('1.'), precision=128)), + '[1, 0.35897435897435897435897435897435897438; 0, 1]') + self.assertEquals(pari.mateigen(A, 1), '[[5/3, 21/10], [1, 14/39; 0, 1]]') + + a = ('[1,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0;0,1,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0;0,0,1,-1,0,0,0,0,' + '0,0,0,0,0,0,0,0,0;-1,-1,-1,4,0,0,0,0,-1,0,0,0,0,0,0,0,0;0,0,0,0,1,0,0,-1,0,0,0,0,0,0,0,0' + ',0;0,0,0,0,0,1,0,-1,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,1,-1,0,0,0,0,0,0,0,0,0;0,0,0,0,-1,-1,-' + '1,4,-1,0,0,0,0,0,0,0,0;0,0,0,-1,0,0,0,-1,4,-1,-1,0,0,0,0,0,0;0,0,0,0,0,0,0,0,-1,1,0,0,0,' + '0,0,0,0;0,0,0,0,0,0,0,0,-1,0,4,-1,-1,-1,0,0,0;0,0,0,0,0,0,0,0,0,0,-1,1,0,0,0,0,0;0,0,0,0' + ',0,0,0,0,0,0,-1,0,1,0,0,0,0;0,0,0,0,0,0,0,0,0,0,-1,0,0,3,-1,0,-1;0,0,0,0,0,0,0,0,0,0,0,0' + ',0,-1,3,-2,0;0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,2,0;0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,1]') + + pari.mateigen(a, precision=128) + self.assertEquals(pari.mateigen('[;]', precision=128), '[]') + self.assertEquals(pari.mateigen('[;]', 1, precision=128), '[[], [;]]') + self.assertEquals(pari.mateigen(pari.Mat(1), precision=128), 'Mat(1)') + self.assertEquals(pari.mateigen(pari.Mat(1), 1, precision=128), '[[1], Mat(1)]') +"""**** Original expected results **** + +(-y + 1)*x + (y^2 - 2*y - 1) +(-y + 1)*x + (y^2 - 2*y - 1) +(-y + 1)*x + (y^2 - 2*y - 1) +(-y + 1)*x + (y^2 - 2*y - 1) +x^4 - 16*x^2 +x^4 - 16*x^2 +x^2 - 4*x + +[1 14/39] + +[0 1] + + +[1 0.35897435897435897435897435897435897438] + +[0 1] + +[[5/3, 21/10], [1, 14/39; 0, 1]] +-x^2 + (-y - w)*x + (-y + (w^2 - w)) +x - 1 +x - 1.0000000000000000000000000000000000000 +x + Mod(2, 3) +x - 1/2 +x + (2 + O(3)) +x^2 + 1 +x^2 - x - 1 +Mod(1, 3)*x^2 + Mod(1, 3)*x + Mod(1, 3) +Mod(1, 18446744073709551629)*x^2 + Mod(18446744073709551627, 184467440737095 +51629)*x + Mod(1, 18446744073709551629) +x^4 - 4*x^3 + 6*x^2 - 4*x + 1 +x^4 - 4*x^3 + 6*x^2 - 4*x + 1 +x^4 - 73786976294838206516*x^3 + 2041694201525630783657939720089299321846*x^ +2 - 25108406941546723108427206932497066002105857518694949724756*x + 11579208 +9237316195749980275248795307917777354730270819790751905975615430356881 +Mod(1, 3)*x^4 + Mod(1, 3)*x^3 + Mod(1, 3)*x^2 + Mod(1, 3)*x +Mod(1, 18446744073709551629)*x^4 + Mod(18446744073709551600, 184467440737095 +51629)*x^3 + Mod(46, 18446744073709551629)*x^2 + Mod(16, 1844674407370955162 +9)*x + +[1 0] + +[0 1] + +[;] + +[1] + + +[0 0 0] + +[0 0 0] + +[0 0 0] + + +[Mod(0, 2) Mod(0, 2) Mod(0, 2)] + +[Mod(0, 2) Mod(0, 2) Mod(0, 2)] + +[Mod(0, 2) Mod(0, 2) Mod(0, 2)] + + *** at top-level: charpoly(x*matid(3)) + *** ^-------------------- + *** charpoly: incorrect priority in charpoly: variable x = x +x^4 - 4*x^3 + 6*x^2 - 4*x + 2 +x^2 +x - 1 +x - 1 +[] +[[], [;]] + +[1] + +[[1], Mat(1)] + *** at top-level: charpoly(Mod('b,'b^2 + *** ^-------------------- + *** charpoly: incorrect priority in RgXQ_charpoly: variable newvar < a + +""" From 3e0d9b386e85df22ce37dcfaedb79772270fed9b Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Wed, 18 Oct 2017 10:48:32 +0200 Subject: [PATCH 14/28] Unittest replace call precision=127 by precision=128 --- tests/unittests/ellanal.py | 16 ++++---- tests/unittests/gamma.py | 72 ++++++++++++++++++------------------ tests/unittests/lambert.py | 4 +- tests/unittests/linear.py | 4 +- tests/unittests/log.py | 8 ++-- tests/unittests/modfun.py | 8 ++-- tests/unittests/norm.py | 4 +- tests/unittests/number.py | 10 ++--- tests/unittests/polylog.py | 10 ++--- tests/unittests/qfb.py | 2 +- tests/unittests/rootsreal.py | 40 ++++++++++---------- tests/unittests/ser.py | 12 +++--- tests/unittests/zeta.py | 28 +++++++------- 13 files changed, 109 insertions(+), 109 deletions(-) diff --git a/tests/unittests/ellanal.py b/tests/unittests/ellanal.py index d4f9056..40ccb51 100644 --- a/tests/unittests/ellanal.py +++ b/tests/unittests/ellanal.py @@ -54,8 +54,8 @@ def test_ellanal(self): pari.set_real_precision(38) def rk(x): - x = pari.ellinit(x, precision=127) - return pari.ellanalyticrank(x, precision=127) + x = pari.ellinit(x, precision=128) + return pari.ellanalyticrank(x, precision=128) self.assertEquals(str(rk([0, -1, 1, -10, -20])), '[0, 0.25384186085591068433775892335090946105]') self.assertEquals(str(rk([0, 0, 1, -1, 0])), '[1, 0.30599977383405230182048368332167647445]') @@ -67,7 +67,7 @@ def test_ellheegner(self): pari.set_real_precision(38) def he(x): - x = pari.ellinit(x, precision=127) + x = pari.ellinit(x, precision=128) return pari.ellheegner(x) self.assertEquals(str(he([1, 1, 0, -1297, -18530])), '[-339/16, 691/64]') @@ -84,11 +84,11 @@ def he(x): def test_ellL1(self): pari.set_real_precision(38) - L = pari.ellinit([0, 0, 1, 7, 6], precision=127); - self.assertEquals(str(pari.ellL1(L, precision=127)), '0') - self.assertEquals(str(pari.ellL1(L, 1, precision=127)), '2.8053554406276820682921020105298729343') - self.assertEquals(str(pari.ellL1(L, 3, precision=127)), '98.900778292211279593460469548777701093') - self.assertEquals(str(pari.ellL1(pari.ellinit([0, 1, 1, -2, 0], precision=127), 2, precision=127)), + L = pari.ellinit([0, 0, 1, 7, 6], precision=128); + self.assertEquals(str(pari.ellL1(L, precision=128)), '0') + self.assertEquals(str(pari.ellL1(L, 1, precision=128)), '2.8053554406276820682921020105298729343') + self.assertEquals(str(pari.ellL1(L, 3, precision=128)), '98.900778292211279593460469548777701093') + self.assertEquals(str(pari.ellL1(pari.ellinit([0, 1, 1, -2, 0], precision=128), 2, precision=128)), '1.5186330005768535404603852157894440381') pari.set_real_precision(115) self.assertEquals(pari.ellL1(L, precision=383), '0') diff --git a/tests/unittests/gamma.py b/tests/unittests/gamma.py index 6a0e6dd..bfdc0a7 100644 --- a/tests/unittests/gamma.py +++ b/tests/unittests/gamma.py @@ -72,7 +72,7 @@ def tearDown(self): pari.set_series_precision(16) def test_gamma(self): - self.assertEquals(str(pari.gamma('2+I+x', precision=127)), + self.assertEquals(str(pari.gamma('2+I+x', precision=128)), '(0.65296549642016672783864624794608469715 + 0.3430658398165453575' + '8873598697831148676*I) + (0.19044897540645184469078131473790885364 + 0.580552467319476' + '92349794265298068695525*I)*x + (0.090862784286733058570355592072096462602 + 0.21088392' + @@ -80,43 +80,43 @@ def test_gamma(self): '.15168994440796279268955277197772465641*I)*x^3 + (-0.009313921054078589415919785948439' + '2067432 + 0.033064651796439913976828620551277428299*I)*x^4 + (0.0066762623841895560506' + '752315759505427095 + 0.015164046675666586697065188398143396917*I)*x^5 + O(x^6)') - self.assertEquals(str(pari.gamma('1+x', precision=127)), '1 - 0.57721566490153286060651209008240243104*x ' + + self.assertEquals(str(pari.gamma('1+x', precision=128)), '1 - 0.57721566490153286060651209008240243104*x ' + '+ 0.98905599532797255539539565150063470794*x^2 - 0.90747907608088628901656016735627511' + '493*x^3 + 0.98172808683440018733638029402185085036*x^4 - 0.981995068903145202104701413' + '79137467551*x^5 + O(x^6)') - self.assertEquals(str(pari.gamma('2+x', precision=127)), '1 + 0.42278433509846713939348790991759756896*x ' + + self.assertEquals(str(pari.gamma('2+x', precision=128)), '1 + 0.42278433509846713939348790991759756896*x ' + '+ 0.41184033042643969478888356141823227689*x^2 + 0.08157691924708626637883548414435959' + '3009*x^3 + 0.074249010753513898319820126665575735431*x^4 - 0.0002669820687450147683211' + '1976952382515602*x^5 + O(x^6)') - self.assertEquals(str(pari.gamma('-2+x', precision=127)), '0.50000000000000000000000000000000000000*x^-1 ' + + self.assertEquals(str(pari.gamma('-2+x', precision=128)), '0.50000000000000000000000000000000000000*x^-1 ' + '+ 0.46139216754923356969674395495879878448 + 0.93661624898783663224281375818851553069*' + 'x + 0.72048875166669501900756857612523634633*x^2 + 1.103289046423324306058136132104522' + '1793*x^3 + O(x^4)') - self.assertEquals(str(pari.gamma('-1/2+x', precision=127)), '-3.5449077018110320545963349666822903656 - 0' + + self.assertEquals(str(pari.gamma('-1/2+x', precision=128)), '-3.5449077018110320545963349666822903656 - 0' + '.12935358979554005531547953707588123112*x - 15.838884621997332891305490359174586834*x^' + '2 - 0.088235140923071374511750322744686276244*x^3 - 63.9341199241678177373752902777138' + '85431*x^4 - 0.042848354492868684268292005312709223076*x^5 + O(x^6)') - self.assertEquals(str(pari.gamma('1+a*x+O(x^2)', precision=127)), + self.assertEquals(str(pari.gamma('1+a*x+O(x^2)', precision=128)), '1 - 0.57721566490153286060651209008240243104*a*x + O(x^2)') with self.assertRaises(PariError) as context: - pari.gamma('O(x)', precision=127) + pari.gamma('O(x)', precision=128) self.assertTrue('domain error in gamma: argument = 0' in str(context.exception)) - self.assertEquals(str(pari.gamma('x', precision=127)), 'x^-1 - 0.57721566490153286060651209008240243104 + ' + + self.assertEquals(str(pari.gamma('x', precision=128)), 'x^-1 - 0.57721566490153286060651209008240243104 + ' + '0.98905599532797255539539565150063470794*x - 0.90747907608088628901656016735627511493*x' + '^2 + 0.98172808683440018733638029402185085036*x^3 - 0.981995068903145202104701413791374' + '67551*x^4 + O(x^5)') - self.assertEquals(str(pari.gamma(1000, precision=127)), '4.0238726007709377354370243392300398572 E2564') - self.assertEquals(str(pari.gamma('x+O(x^2)', precision=127)), 'x^-1 + O(x^0)') - self.assertEquals(str(pari.gamma('-1-10^-16', precision=127)), '9999999999999999.5772156649015330017905') - self.assertEquals(str(pari.gamma('10^-16', precision=127)), '9999999999999999.4227843350984672382991') + self.assertEquals(str(pari.gamma(1000, precision=128)), '4.0238726007709377354370243392300398572 E2564') + self.assertEquals(str(pari.gamma('x+O(x^2)', precision=128)), 'x^-1 + O(x^0)') + self.assertEquals(str(pari.gamma('-1-10^-16', precision=128)), '9999999999999999.5772156649015330017905') + self.assertEquals(str(pari.gamma('10^-16', precision=128)), '9999999999999999.4227843350984672382991') self.assertEquals(str(pari.binomial('2^64+1', 2)), '170141183460469231740910675752738881536') self.assertEquals(str(pari.binomial('1001.', 1000)), '1001.0000000000000000000000000000000000') - self.assertEquals(str(pari.gammah(400, precision=127)), '3.2007257594901922498857741835634344245 E867') - self.assertEquals(str(pari.gammah('400+I', precision=127)), + self.assertEquals(str(pari.gammah(400, precision=128)), '3.2007257594901922498857741835634344245 E867') + self.assertEquals(str(pari.gammah('400+I', precision=128)), '3.0616681090421088936612867355651954590 E867 - 9.1937706728127042134545128900883765323 E' + '866*I') @@ -129,7 +129,7 @@ def test_gamma(self): '95286760197004854674329979420483457441111886014601499071559796851143') def test_psi(self): - self.assertEquals(str(pari.psi('2+I+x', precision=127)), '(0.59465032062247697727187848272191072247 + 0.5' + + self.assertEquals(str(pari.psi('2+I+x', precision=128)), '(0.59465032062247697727187848272191072247 + 0.5' + '7667404746858117413405079475000049045*I) + (0.46300009662276378629832651818418579441 -' + ' 0.29423354275931886558301361715690299591*I)*x + (-0.065723534206032414131682728509702' + '607416 + 0.13332642517253310620134768881568504070*I)*x^2 + (-0.00381240815891599630224' + @@ -137,28 +137,28 @@ def test_psi(self): '168721646303099647994255377 + 0.017474497859917982232442372031895951470*I)*x^4 + (-0.0' + '077757069690405743408170730434310459472 - 0.0040345642341327827815714280332882428196*I' + ')*x^5 + O(x^6)') - self.assertEquals(str(pari.psi('1+x', precision=127)), '-0.57721566490153286060651209008240243104 + 1.644' + + self.assertEquals(str(pari.psi('1+x', precision=128)), '-0.57721566490153286060651209008240243104 + 1.644' + '9340668482264364724151666460251892*x - 1.2020569031595942853997381615114499908*x^2 + 1' + '.0823232337111381915160036965411679028*x^3 - 1.0369277551433699263313654864570341681*x' + '^4 + 1.0173430619844491397145179297909205279*x^5 + O(x^6)') - self.assertEquals(str(pari.psi('-2+x', precision=127)), '-x^-1 + 0.92278433509846713939348790991759756896' + + self.assertEquals(str(pari.psi('-2+x', precision=128)), '-x^-1 + 0.92278433509846713939348790991759756896' + ' + 2.8949340668482264364724151666460251892*x - 0.0770569031595942853997381615114499907' + '62*x^2 + 2.1448232337111381915160036965411679028*x^3 + O(x^4)') - self.assertEquals(str(pari.psi('x', precision=127)), '-x^-1 - 0.57721566490153286060651209008240243104 + 1' + + self.assertEquals(str(pari.psi('x', precision=128)), '-x^-1 - 0.57721566490153286060651209008240243104 + 1' + '.6449340668482264364724151666460251892*x - 1.2020569031595942853997381615114499908*x^2 ' + '+ 1.0823232337111381915160036965411679028*x^3 - 1.0369277551433699263313654864570341681' + '*x^4 + 1.0173430619844491397145179297909205279*x^5 + O(x^6)') with self.assertRaises(PariError) as context: - pari.psi('O(x)', precision=127) + pari.psi('O(x)', precision=128) self.assertTrue('domain error in psi: argument = 0' in str(context.exception)) - self.assertEquals(str(pari.psi('2^400', precision=127)), '277.25887222397812376689284858327062723') - self.assertEquals(str(pari.psi('-1.5', precision=127)), '0.70315664064524318722569033366791109947') - self.assertEquals(str(pari.psi('x+O(x^2)', precision=127)), '-x^-1 + O(x^0)') + self.assertEquals(str(pari.psi('2^400', precision=128)), '277.25887222397812376689284858327062723') + self.assertEquals(str(pari.psi('-1.5', precision=128)), '0.70315664064524318722569033366791109947') + self.assertEquals(str(pari.psi('x+O(x^2)', precision=128)), '-x^-1 + O(x^0)') def test_lngamma(self): - self.assertEquals(str(pari.lngamma('2+I+x', precision=127)), '(-0.30434960902188368417660077077485938103 ' + + self.assertEquals(str(pari.lngamma('2+I+x', precision=128)), '(-0.30434960902188368417660077077485938103 ' + '+ 0.48375784292991511172812918802297918039*I) + (0.59465032062247697727187848272191072' + '247 + 0.57667404746858117413405079475000049045*I)*x + (0.23150004831138189314916325909' + '209289721 - 0.14711677137965943279150680857845149795*I)*x^2 + (-0.02190784473534413804' + @@ -166,35 +166,35 @@ def test_lngamma(self): '03972899907556180572534221362410 - 0.013220274110915027434116360959758682565*I)*x^4 + ' + '(0.0023292347420337443292606199295988510753 + 0.00349489957198359644648847440637919029' + '41*I)*x^5 + O(x^6)') - self.assertEquals(str(pari.lngamma('1+x', precision=127)), '-0.57721566490153286060651209008240243104*x +' + + self.assertEquals(str(pari.lngamma('1+x', precision=128)), '-0.57721566490153286060651209008240243104*x +' + ' 0.82246703342411321823620758332301259461*x^2 - 0.400685634386531428466579387170483330' + '25*x^3 + 0.27058080842778454787900092413529197569*x^4 - 0.2073855510286739852662730972' + '9140683361*x^5 + O(x^6)') with self.assertRaises(PariError) as context: - pari.lngamma('-2+x', precision=127) + pari.lngamma('-2+x', precision=128) self.assertTrue('domain error in intformal: residue(series, pole) != 0' in str(context.exception)) - self.assertEquals(str(pari.lngamma('2+x', precision=127)), '0.42278433509846713939348790991759756896*x + ' + + self.assertEquals(str(pari.lngamma('2+x', precision=128)), '0.42278433509846713939348790991759756896*x + ' + '0.32246703342411321823620758332301259461*x^2 - 0.0673523010531980951332460538371499969' + '21*x^3 + 0.020580808427784547879000924135291975694*x^4 - 0.007385551028673985266273097' + '2914068336108*x^5 + O(x^6)') - self.assertEquals(str(pari.lngamma(1, precision=127)), '0.E-38') - self.assertEquals(str(pari.lngamma('1.', precision=127)), '0.E-38') - self.assertEquals(str(pari.lngamma('1+a*x+O(x^2)', precision=127)), + self.assertEquals(str(pari.lngamma(1, precision=128)), '0.E-38') + self.assertEquals(str(pari.lngamma('1.', precision=128)), '0.E-38') + self.assertEquals(str(pari.lngamma('1+a*x+O(x^2)', precision=128)), '-0.57721566490153286060651209008240243104*a*x + O(x^2)') with self.assertRaises(PariError) as context: - pari.lngamma('O(x)', precision=127) + pari.lngamma('O(x)', precision=128) self.assertTrue('domain error in lngamma: argument = 0' in str(context.exception)) - self.assertEquals(str(pari.lngamma('-1-10^-16', precision=127)), + self.assertEquals(str(pari.lngamma('-1-10^-16', precision=128)), '36.841361487904730902009429765103126607 - 6.2831853071795864769252867665590057684*I') - self.assertEquals(str(pari.lngamma('10^-16', precision=127)), '36.841361487904730886566296784796549486') + self.assertEquals(str(pari.lngamma('10^-16', precision=128)), '36.841361487904730886566296784796549486') - self.assertEquals(str(pari.lngamma('2^301', precision=127)), '8.4592930575197658134779513864578051837 E92') - self.assertEquals(str(pari.lngamma('2^301 + 2*I', precision=127)), + self.assertEquals(str(pari.lngamma('2^301', precision=128)), '8.4592930575197658134779513864578051837 E92') + self.assertEquals(str(pari.lngamma('2^301 + 2*I', precision=128)), '8.4592930575197658134779513864578051837 E92 + 417.27460269708707626917373711782229398*I') - self.assertEquals(str(pari.lngamma('2^64 + 2*I', precision=127)), + self.assertEquals(str(pari.lngamma('2^64 + 2*I', precision=128)), '799877009219260410589.21059353880333769 + 88.722839111672999605351501438022325492*I') - self.assertEquals(str(pari.lngamma('-200.5', precision=127)), + self.assertEquals(str(pari.lngamma('-200.5', precision=128)), '-864.73828787067971564321683481711497423 - 631.46012337154844093099132003918007972*I') pari.set_real_precision(115) diff --git a/tests/unittests/lambert.py b/tests/unittests/lambert.py index 81fb748..53c3797 100644 --- a/tests/unittests/lambert.py +++ b/tests/unittests/lambert.py @@ -42,7 +42,7 @@ class TestLambert(unittest.TestCase): def test_lambert(self): - def do(y, precision=127): + def do(y, precision=128): x = pari.lambertw(y, precision=precision) return pari.exp(x)*x/y; with self.assertRaises(PariError) as context: @@ -59,7 +59,7 @@ def do(y, precision=127): '999999999999999999999999999999999999999999999999999999999999999999999999999999999' + '999999999999999999999999999999999999999999999999999999999999999') - def do2(y, precision=127): + def do2(y, precision=128): x = pari.lambertw(y, precision=precision) e = pari.normlp(pari.Vec(pari.exp(x)*x - y)) self.assertLessEqual(e, 5e-38) diff --git a/tests/unittests/linear.py b/tests/unittests/linear.py index 9a23cf0..e754fb6 100644 --- a/tests/unittests/linear.py +++ b/tests/unittests/linear.py @@ -236,7 +236,7 @@ def test_linear(self): self.assertEquals(pari.matdet('[1,2,3;1,5,6;9,8,7]',1), '-30') self.assertEquals(pari.matdetint('[1,2,3;4,5,6]'), '3') self.assertEquals(pari.matdiagonal('[2,4,6]'), '[2,0,0;0,4,0;0,0,6]') - self.assertEquals(str(pari.mateigen('[1,2,3;4,5,6;7,8,9]', precision=127)), + self.assertEquals(str(pari.mateigen('[1,2,3;4,5,6;7,8,9]', precision=128)), '[1, -1.2833494518006402717978106547571267252, 0.2833494518006402717978' + '1065475712672521; -2, -0.14167472590032013589890532737856336261, 0.6416' + '7472590032013589890532737856336260; 1, 1, 1]') @@ -323,7 +323,7 @@ def test_linear(self): self.assertEquals(pari.qfgaussred(pari.mathilbert(5)), '[1, 1/2, 1/3, 1/4, 1/5; 0, 1/12, 1, 9/10, 4/5; 0, 0, 1/180, 3/2, 12/7; 0, 0, 0, 1/2800, ' + '2; 0, 0, 0, 0, 1/44100]') - self.assertEquals(str(pari.qfjacobi(pari.mathilbert(6), precision=127)), + self.assertEquals(str(pari.qfjacobi(pari.mathilbert(6), precision=128)), '[[1.0827994845655497685388772372251778091 E-7, 1.2570757122625194922982397996498755378 E' + '-5, 0.00061574835418265769764919938428527140434, 0.0163215213198758221243450795641915058' + '90, 0.24236087057520955213572841585070114077, 1.6188998589243390969705881471257800713]~,' + diff --git a/tests/unittests/log.py b/tests/unittests/log.py index 31f64e4..d8bbbde 100644 --- a/tests/unittests/log.py +++ b/tests/unittests/log.py @@ -18,11 +18,11 @@ class TestLog(unittest.TestCase): def test_log(self): oldprec = pari.set_real_precision(38) - self.assertEquals(str(pari.log('1+10^-30', precision=127)), '9.9999999999999999999999999999950000000 E-31') - self.assertEquals(str(pari.lngamma('1+10^-30', precision=127)), '-5.7721566490153286060651209008157996401 E-31') - self.assertEquals(str(pari.lngamma('10^-30', precision=127)), '69.077552789821370520539743640530349012') + self.assertEquals(str(pari.log('1+10^-30', precision=128)), '9.9999999999999999999999999999950000000 E-31') + self.assertEquals(str(pari.lngamma('1+10^-30', precision=128)), '-5.7721566490153286060651209008157996401 E-31') + self.assertEquals(str(pari.lngamma('10^-30', precision=128)), '69.077552789821370520539743640530349012') with self.assertRaises(PariError) as context: - pari.log('2+O(33)', precision=127) + pari.log('2+O(33)', precision=128) self.assertTrue('not a prime number in p-adic log: 33' in str(context.exception)) pari.set_real_precision(oldprec) diff --git a/tests/unittests/modfun.py b/tests/unittests/modfun.py index bb9c8e8..b49ffcc 100644 --- a/tests/unittests/modfun.py +++ b/tests/unittests/modfun.py @@ -29,19 +29,19 @@ def test_eta(self): self.assertEqual(pari.eta('2+O(2^20)'), '1 + 2 + 2^3 + 2^4 + 2^7 + 2^12 + 2^13 + 2^14 + 2^16 + 2^17 + 2^18 + 2^19 + O(2^20)') self.assertEqual(pari.eta('x+x^2+x^3+x^4+O(x^5)'), '1 - x - 2*x^2 - 3*x^3 - 4*x^4 + O(x^5)') - self.assertEqual(str(pari.eta('I', precision=127)), '0.99812906992595851327996232224527387813') + self.assertEqual(str(pari.eta('I', precision=128)), '0.99812906992595851327996232224527387813') def test_ellj(self): self.assertEqual(pari.ellj('2+O(2^20)'), '2^-1 + 2^5 + 2^7 + 2^8 + 2^10 + 2^12 + 2^16 + O(2^18)') self.assertEqual(pari.ellj('x+x^2+x^3+x^4+O(x^5)'), 'x^-1 + 743 + 196884*x + 21690644*x^2 + O(x^3)') def test_theta(self): - self.assertEqual(str(pari.theta('1/2', 'I', precision=127)), + self.assertEqual(str(pari.theta('1/2', 'I', precision=128)), '0.E-38 - 0.50432357748832834893222560519660217759*I') def test_weber(self): - self.assertEqual(str(pari.weber('1.0*I', 1, precision=127)), '1.0905077326652576592070106557607079790') - self.assertEqual(str(pari.weber('1+I', precision=127)), + self.assertEqual(str(pari.weber('1.0*I', 1, precision=128)), '1.0905077326652576592070106557607079790') + self.assertEqual(str(pari.weber('1+I', precision=128)), '1.0811782878393746833655992417658285836 - 0.14233982193131805512395869109512286588*I') """**** Original expected results **** diff --git a/tests/unittests/norm.py b/tests/unittests/norm.py index 626c950..fc382b0 100644 --- a/tests/unittests/norm.py +++ b/tests/unittests/norm.py @@ -46,8 +46,8 @@ def test_norm(self): self.assertEqual(pari.normlp('I', 1), '1') pari.set_real_precision(38) - F = [lambda x: pari.normlp(x, 1, precision=127), lambda x: pari.normlp(x, 2, precision=127), - lambda x: pari.normlp(x, '2.5', precision=127), lambda x: pari.normlp(x, precision=127)]; + F = [lambda x: pari.normlp(x, 1, precision=128), lambda x: pari.normlp(x, 2, precision=128), + lambda x: pari.normlp(x, '2.5', precision=128), lambda x: pari.normlp(x, precision=128)]; res = [['6', '10', diff --git a/tests/unittests/number.py b/tests/unittests/number.py index 077610e..70f86fc 100644 --- a/tests/unittests/number.py +++ b/tests/unittests/number.py @@ -244,20 +244,20 @@ def test_qfb(self): def test_qfbred(self): self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, 12), 0, -1)), 'Qfb(3, -2, 4)') - self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=127))), + self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=128))), 'Qfb(3, 16, -7, 1.5000000000000000000000000000000000000)') - self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=127), 2, None, 18)), + self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=128), 2, None, 18)), 'Qfb(3, 16, -7, 1.5000000000000000000000000000000000000)') - self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=127), 1)), + self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=128), 1)), 'Qfb(-20, -10, 3, 2.1074451073987839947135880252731470616)') - self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=127), 3, None, 18)), + self.assertEqual(str(pari.qfbred(pari.Qfb(3, 10, -20, 1.5, precision=128), 3, None, 18)), 'Qfb(-20, -10, 3, 1.5000000000000000000000000000000000000)') def test_quadfct(self): self.assertEqual(str(pari.quaddisc(-252)), '-7') self.assertEqual(str(pari.quadgen(-11)), 'w') self.assertEqual(str(pari.quadpoly(-11)), 'x^2 - x + 3') - self.assertEqual(str(pari.quadregulator(17, precision=127)), '2.0947125472611012942448228460655286535') + self.assertEqual(str(pari.quadregulator(17, precision=128)), '2.0947125472611012942448228460655286535') self.assertEqual(str(pari.quadunit(17)), '3 + 2*w') def test_sigma(self): diff --git a/tests/unittests/polylog.py b/tests/unittests/polylog.py index 1409b08..7b3143c 100644 --- a/tests/unittests/polylog.py +++ b/tests/unittests/polylog.py @@ -35,19 +35,19 @@ def test_polylog(self): '7621770489264556951963565*I') self.assertEquals(str(pari.polylog(3, '3.9')), '4.3226178452644705784020044544722613393 - 2.909518771772' + '2594640746948896647103179*I') - self.assertEquals(str(pari.polylog(2, pari.Mod('x', 'x^2+1'), precision=127)), '[-0.20561675835602830455905189583075314' + + self.assertEquals(str(pari.polylog(2, pari.Mod('x', 'x^2+1'), precision=128)), '[-0.20561675835602830455905189583075314' + '866 - 0.91596559417721901505460351493238411074*I, -0.20561675835602830455905189583075' + '314866 + 0.91596559417721901505460351493238411074*I]~') self.assertEquals(str(pari.polylog(2, ['0.5', '0.6'])), '[0.58224052646501250590265632015968010874, 0.72' + '758630771633338951353629684048110789]') self.assertEquals(str(pari.polylog(2, 'x+O(x^5)')), 'x + 1/4*x^2 + 1/9*x^3 + 1/16*x^4 + O(x^5)') - self.assertEquals(str(pari.polylog(2, '1/2 + x + O(x^5)', precision=127)), '0.58224052646501250590265632015968010874 + ' + + self.assertEquals(str(pari.polylog(2, '1/2 + x + O(x^5)', precision=128)), '0.58224052646501250590265632015968010874 + ' + '1.3862943611198906188344642429163531362*x + 0.61370563888010938116553575708364686385*' + 'x^2 + 0.51505914815985415844595232388847084820*x^3 + 0.560744611093552095664404847500' + '62706103*x^4 + O(x^5)') - self.assertEquals(str(pari.dilog(-4, precision=127)), '-2.3699397969983658319855374253503230488') - self.assertEquals(str(pari.polylog(2, '1+I', 1, precision=127)), '0.91596559417721901505460351493238411077') - self.assertEquals(str(pari.polylog(1, 2, 3, precision=127)), '0.34657359027997265470861606072908828404') + self.assertEquals(str(pari.dilog(-4, precision=128)), '-2.3699397969983658319855374253503230488') + self.assertEquals(str(pari.polylog(2, '1+I', 1, precision=128)), '0.91596559417721901505460351493238411077') + self.assertEquals(str(pari.polylog(1, 2, 3, precision=128)), '0.34657359027997265470861606072908828404') pari.set_real_precision_bits(320); self.assertEquals(pari.bitprecision(pari.dilog('2.0')), '320') def test_polylog_error_cases(self): diff --git a/tests/unittests/qfb.py b/tests/unittests/qfb.py index 7ec42ac..7e21ea3 100644 --- a/tests/unittests/qfb.py +++ b/tests/unittests/qfb.py @@ -73,7 +73,7 @@ def vec(x): self.assertEquals(pari.qfbred(q), 'Qfb(1, 1, 6)') self.assertEquals(pari.qfbredsl2(q), '[Qfb(1, 1, 6), [22479, 76177; -39508, -133885]]') - q = pari.Qfb('1099511627776', '1879224363605', '802966544317', precision=127); + q = pari.Qfb('1099511627776', '1879224363605', '802966544317', precision=128); U = pari.qfbredsl2(q)[1] self.assertEquals(U, '[127327, -416128; -148995, 486943]') self.assertEquals(pari.qfeval(q, U), 'Qfb(4, 3, -3, 0.E-38)') diff --git a/tests/unittests/rootsreal.py b/tests/unittests/rootsreal.py index 8995542..f30951a 100644 --- a/tests/unittests/rootsreal.py +++ b/tests/unittests/rootsreal.py @@ -122,39 +122,39 @@ def test_rootsreal(self): self.assertEquals(str(pari.polsturm(T, '2.', 3)), '2') self.assertEquals(str(pari.polsturm(T, None, 2)), '2') self.assertEquals(str(pari.polrootsreal('x^10 + 23*x^9 + 19*x^8 + 18*x^7 + 39*x^6 + 41*x^5 + 46*x^4 + 24*x^3' - ' - 4*x^2 + 2*x + 42', precision=127)), + ' - 4*x^2 + 2*x + 42', precision=128)), '[-22.176420046821213834911725420609849287, -1.2204011038823372357354593544256902868]~') - self.assertEquals(str(pari.polrootsreal(pari.polchebyshev(9), precision=127)), + self.assertEquals(str(pari.polrootsreal(pari.polchebyshev(9), precision=128)), '[-0.98480775301220805936674302458952301367, -0.86602540378443864676372317075293618347, -' + '0.64278760968653932632264340990726343291, -0.34202014332566873304409961468225958076, 0.E' + '-38, 0.34202014332566873304409961468225958076, 0.64278760968653932632264340990726343291,' + ' 0.86602540378443864676372317075293618347, 0.98480775301220805936674302458952301367]~') - self.assertEquals(str(pari.polrootsreal(pari.polchebyshev(10), precision=127)), + self.assertEquals(str(pari.polrootsreal(pari.polchebyshev(10), precision=128)), '[-0.98768834059513772619004024769343726076, -0.89100652418836786235970957141362631277, -' + '0.70710678118654752440084436210484903928, -0.45399049973954679156040836635787119898, -0.' + '15643446504023086901010531946716689231, 0.15643446504023086901010531946716689231, 0.4539' + '9049973954679156040836635787119898, 0.70710678118654752440084436210484903928, 0.89100652' + '418836786235970957141362631277, 0.98768834059513772619004024769343726076]~') - self.assertEquals(str(pari.polrootsreal('x^0', precision=127)), '[]~') - self.assertEquals(str(pari.polrootsreal(1, precision=127)), '[]~') + self.assertEquals(str(pari.polrootsreal('x^0', precision=128)), '[]~') + self.assertEquals(str(pari.polrootsreal(1, precision=128)), '[]~') with self.assertRaises(PariError) as context: - pari.polrootsreal(0, precision=127) + pari.polrootsreal(0, precision=128) self.assertTrue('zero polynomial in realroots' in str(context.exception)) with self.assertRaises(PariError) as context: - pari.polrootsreal(pari.Pol(0), precision=127) + pari.polrootsreal(pari.Pol(0), precision=128) self.assertTrue('zero polynomial in realroots' in str(context.exception)) with self.assertRaises(PariError) as context: - pari.polrootsreal(pari.Mod(1, 2), precision=127) + pari.polrootsreal(pari.Mod(1, 2), precision=128) self.assertTrue('incorrect type in realroots (t_INTMOD)' in str(context.exception)) self.assertEquals(pari.polroots('(x^3-6*x^2+11*x-6)*x+0.'), '[0.E-38 + 0.E-38*I, 1.0000000000000000000000000000000000000 + 0.E-38*I, 2.00000000000000' + '00000000000000000000000 + 0.E-38*I, 3.0000000000000000000000000000000000000 + 0.E-38*I]~') self.assertEquals(pari.polroots(1), '[]~') - self.assertEquals(str(pari.polrootsreal(T, [1, 1], precision=127)), + self.assertEquals(str(pari.polrootsreal(T, [1, 1], precision=128)), '[1.0000000000000000000000000000000000000]~') - self.assertEquals(str(pari.polrootsreal(T, [0, 0], precision=127)), '[]~') + self.assertEquals(str(pari.polrootsreal(T, [0, 0], precision=128)), '[]~') self.assertEquals(str(pari.polsturm(T, [1, 1])), '1') self.assertEquals(str(pari.polsturm(T, [2, 1])), '0') @@ -165,14 +165,14 @@ def test_rootsreal(self): self.assertEquals(str(pari.polrootsreal('x', [1, 2])), '[]~') self.assertEquals(str(pari.polrootsreal('x', [-2, -1])), '[]~') - self.assertEquals(str(pari.polrootsreal('x', [-1, 1], precision=127)), '[0.E-38]~') + self.assertEquals(str(pari.polrootsreal('x', [-1, 1], precision=128)), '[0.E-38]~') - self.assertEquals(str(pari.polrootsreal('x^3-2', precision=127)), '[1.2599210498948731647672106072782283506]~') - self.assertEquals(str(pari.polrootsreal('x^3+2', precision=127)), '[-1.2599210498948731647672106072782283506]~') + self.assertEquals(str(pari.polrootsreal('x^3-2', precision=128)), '[1.2599210498948731647672106072782283506]~') + self.assertEquals(str(pari.polrootsreal('x^3+2', precision=128)), '[-1.2599210498948731647672106072782283506]~') # #1605 self.assertEquals(str(pari.polsturm('33*x^2-4*x-1')), '2') - self.assertEquals(str(pari.polrootsreal('4*x', precision=127)), '[0.E-38]~') + self.assertEquals(str(pari.polrootsreal('4*x', precision=128)), '[0.E-38]~') self.assertEquals(str(pari.polsturm('-4*x')), '1') with self.assertRaises(PariError) as context: pari.polsturm('(x^4-2)^2') @@ -180,7 +180,7 @@ def test_rootsreal(self): # #1807 T = 'x^3+x^2-x+2'; - self.assertEquals(str(pari.polrootsreal(T, precision=127)), '[-2.0000000000000000000000000000000000000]~') + self.assertEquals(str(pari.polrootsreal(T, precision=128)), '[-2.0000000000000000000000000000000000000]~') self.assertEquals(str(pari.polsturm(T)), '1') self.assertEquals(str(pari.polsturm(T, [-3, -1])), '1') self.assertEquals(str(pari.polsturm(T, [-2, -1])), '1') @@ -194,18 +194,18 @@ def test_rootsreal(self): self.assertEquals(str(pari.polsturm(T, [1, 3])), '1') # #1808 - self.assertEquals(str(pari.polrootsreal('3*x^3-4*x^2+3*x-1', precision=127)), + self.assertEquals(str(pari.polrootsreal('3*x^3-4*x^2+3*x-1', precision=128)), '[0.59441447601624956642908249516963028371]~') # #1809 - self.assertEquals(str(pari.polrootsreal('x^3-3*x^2-3*x+2', precision=127)), + self.assertEquals(str(pari.polrootsreal('x^3-3*x^2-3*x+2', precision=128)), '[-1.1451026912004224304268100262663119669, 0.47602360291813403446915767711979045497, ' '3.6690790882822883959576523491465215119]~') # #1810 - self.assertEquals(str(pari.polrootsreal('x^3-x^2', precision=127)), + self.assertEquals(str(pari.polrootsreal('x^3-x^2', precision=128)), '[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000]~') - self.assertEquals(str(pari.polrootsreal('(x^3-x^2)*(x-2)^3*(x-3)^2', precision=127)), + self.assertEquals(str(pari.polrootsreal('(x^3-x^2)*(x-2)^3*(x-3)^2', precision=128)), '[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000, 2.00000000000000000000' + '00000000000000000, 2.0000000000000000000000000000000000000, 2.000000000000000000' + '0000000000000000000, 3.0000000000000000000000000000000000000, 3.0000000000000000' + @@ -217,7 +217,7 @@ def test_rootsreal(self): # #1884 pari.set_real_precision(38) self.assertEquals(str(pari.polsturm('x^2-1', [-1, 1])), '2') - self.assertEquals(str(pari.polrootsreal('x^2-1', [-1, 1], precision=127)), + self.assertEquals(str(pari.polrootsreal('x^2-1', [-1, 1], precision=128)), '[-1.0000000000000000000000000000000000000, 1.0000000000000000000000000000000000000]~') """**** Original expected results **** diff --git a/tests/unittests/ser.py b/tests/unittests/ser.py index 29113a4..7ad4a25 100644 --- a/tests/unittests/ser.py +++ b/tests/unittests/ser.py @@ -130,14 +130,14 @@ def test_ser(self): '[0.88137358701954302523260932497979230903 + O(x^16)]'] for i in range(0, len(f)): - self.assertEquals(str(f[i](s, precision=127)), res1[i]); - self.assertEquals(str(f[i]('O(x^5)', precision=127)), res2[i]); - self.assertEquals(str(f[i]([pari.Pol(1)], precision=127)), res3[i]); + self.assertEquals(str(f[i](s, precision=128)), res1[i]); + self.assertEquals(str(f[i]('O(x^5)', precision=128)), res2[i]); + self.assertEquals(str(f[i]([pari.Pol(1)], precision=128)), res3[i]); - self.assertEquals(str(pari.atanh(s, precision=127)), 'x + x^2 + 1/3*x^3 + x^4 + O(x^5)') - self.assertEquals(str(pari.atanh('O(x^5)', precision=127)), 'O(x^5)') + self.assertEquals(str(pari.atanh(s, precision=128)), 'x + x^2 + 1/3*x^3 + x^4 + O(x^5)') + self.assertEquals(str(pari.atanh('O(x^5)', precision=128)), 'O(x^5)') with self.assertRaises(PariError) as context: - pari.atanh([pari.Pol(1)], precision=127) + pari.atanh([pari.Pol(1)], precision=128) self.assertTrue('impossible inverse in div_ser: O(x^16)' in str(context.exception)) self.assertEquals(pari.trace('I*x+1+O(x^2)'), '2 + O(x^2)') self.assertEquals(pari.norm('I*x+1+O(x^2)'), '1 + O(x^2)') diff --git a/tests/unittests/zeta.py b/tests/unittests/zeta.py index 7962a1d..e9dd849 100644 --- a/tests/unittests/zeta.py +++ b/tests/unittests/zeta.py @@ -33,30 +33,30 @@ def test_zeta(self): pari.set_real_precision(38) pari.allocatemem(2e7); self.assertEquals(pari.zeta('3+O(5^10)'), '2*5^-1 + 2*5 + 3*5^2 + 3*5^4 + 3*5^5 + 2*5^6 + 5^7 + 4*5^8 + O(5^9)') - self.assertEquals(pari.zeta('1 + I/100', precision=127), + self.assertEquals(pari.zeta('1 + I/100', precision=128), '0.57721614942066140874800424251188396262 - 99.999271841202858157138397118797159155*I') - self.assertEquals(pari.zeta('1000.5', precision=127), '1.0000000000000000000000000000000000000') - self.assertEquals(pari.zeta(1000, precision=127), '1.0000000000000000000000000000000000000') - self.assertEquals(str(pari.zeta(100, precision=127)), '1.0000000000000000000000000000007888609') - self.assertEquals(str(pari.zeta(31, precision=127)), '1.0000000004656629065033784072989233251') - self.assertEquals(str(pari.zeta('100+100*I', precision=127)), + self.assertEquals(pari.zeta('1000.5', precision=128), '1.0000000000000000000000000000000000000') + self.assertEquals(pari.zeta(1000, precision=128), '1.0000000000000000000000000000000000000') + self.assertEquals(str(pari.zeta(100, precision=128)), '1.0000000000000000000000000000007888609') + self.assertEquals(str(pari.zeta(31, precision=128)), '1.0000000004656629065033784072989233251') + self.assertEquals(str(pari.zeta('100+100*I', precision=128)), '1.0000000000000000000000000000007731864 - 1.5647480679975229240431199238639049803 E-31*I') - self.assertEquals(str(pari.zeta('60+I', precision=127)), + self.assertEquals(str(pari.zeta('60+I', precision=128)), '1.0000000000000000006672083904260744090 - 5.5421056315169138713580539141777567374 E-19*I') - self.assertEquals(str(pari.zeta('-1000+I', precision=127)), '-1.8236338315400224657144248914124703368 E1769 + ' + self.assertEquals(str(pari.zeta('-1000+I', precision=128)), '-1.8236338315400224657144248914124703368 E1769 + ' '6.8223788001755144705322033655798283436 E1768*I') - self.assertEquals(pari.zeta('2+O(2^10)', precision=127), '2^-1 + 1 + 2^2 + 2^3 + 2^5 + 2^6 + 2^7 + O(2^9)') - self.assertEquals(pari.zeta(pow(2, 64), precision=127), '1.0000000000000000000000000000000000000') - self.assertEquals(pari.zeta('-2^64', precision=127), '0.E-38') + self.assertEquals(pari.zeta('2+O(2^10)', precision=128), '2^-1 + 1 + 2^2 + 2^3 + 2^5 + 2^6 + 2^7 + O(2^9)') + self.assertEquals(pari.zeta(pow(2, 64), precision=128), '1.0000000000000000000000000000000000000') + self.assertEquals(pari.zeta('-2^64', precision=128), '0.E-38') with self.assertRaises(PariError) as context: pari.zeta('-1-2^64') self.assertTrue('overflow in zeta [large negative argument]' in str(context.exception)) - self.assertEquals(str(pari.zeta('2+1e-101*I', precision=127)), + self.assertEquals(str(pari.zeta('2+1e-101*I', precision=128)), '1.6449340668482264364724151666460251892 - 9.3754825431584375370257409456786497790 E-102*I') - self.assertEquals(str(pari.zeta('1.01', precision=127)), '100.57794333849687249028215428579024415') - self.assertEquals(str(pari.zeta('1e-32', precision=127)), '-0.50000000000000000000000000000000918939') + self.assertEquals(str(pari.zeta('1.01', precision=128)), '100.57794333849687249028215428579024415') + self.assertEquals(str(pari.zeta('1e-32', precision=128)), '-0.50000000000000000000000000000000918939') pari.set_real_precision(15) """**** Original expected results **** From 71048130ce706971d756d33d1642c0621cba93db Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Thu, 9 Nov 2017 14:06:51 +0100 Subject: [PATCH 15/28] number.py add precision to factorial call --- tests/unittests/number.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unittests/number.py b/tests/unittests/number.py index 70f86fc..2d5d7c8 100644 --- a/tests/unittests/number.py +++ b/tests/unittests/number.py @@ -187,7 +187,7 @@ def test_factor(self): self.assertEqual(str(pari.centerlift(pari.lift(pari.factorff('x^3+x^2+x-1', 3, 't^3+t^2+t-1')))), '[x - t, 1; x + (t^2 + t - 1), 1; x + (-t^2 - 1), 1]') self.assertEqual(str(pari('10!')), '3628800') - self.assertEqual(str(pari.factorial(10)), '3628800.0000000000000000000000000000000') + self.assertEqual(str(pari.factorial(10, 127)), '3628800.0000000000000000000000000000000') def test_factormod(self): self.assertEqual(str(pari.factormod('x^11+1', 7)), From 572a44204ec82c10f49b10a358e90db305b0af10 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Thu, 9 Nov 2017 14:19:25 +0100 Subject: [PATCH 16/28] add unittest to the 'make check' command --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 0900896..0e7f16c 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ install: check: $(PYTHON) tests/rundoctest.py + $(PYTHON) tests/unittests/alltest.py dist: chmod go+rX-w -R . From f097e44368f0c6d97662520f5abb800f0eac4326 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Thu, 9 Nov 2017 15:48:38 +0100 Subject: [PATCH 17/28] alltest.py set return code to 1 if faillures in test suite --- tests/unittests/alltest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index d9f2172..ce3711a 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -1,4 +1,5 @@ import unittest +import sys testmodules = [ 'bern', @@ -64,4 +65,6 @@ # else, just load all the test cases from the module. suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t)) -unittest.TextTestRunner().run(suite) +res = unittest.TextTestRunner().run(suite) +retcode = 0 if res.wasSuccessful() else 1 +sys.exit(retcode) From 471bdd5d8b8a10fb7eef3076164fb6d7555a31f1 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Fri, 10 Nov 2017 14:47:03 +0100 Subject: [PATCH 18/28] alltest.py run a test unit only if his required extension are installed. --- tests/unittests/alltest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index ce3711a..d1122ce 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -53,8 +53,15 @@ 'charpoly' ] +require_galpol = ["galpol"] +require_seadata = ["ellmodulareqn"] + +galpol_installed = True +seadata_installed = True + suite = unittest.TestSuite() + for t in testmodules: try: # If the module defines a suite() function, call it to get the suite. From 677b3d3b95db85e4a348c57afdf33778d8328817 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Fri, 10 Nov 2017 15:34:14 +0100 Subject: [PATCH 19/28] alltest.py run a test unit only if his required extension are installed. --- tests/unittests/alltest.py | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index d1122ce..2e24818 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -1,5 +1,8 @@ import unittest import sys +from cypari2 import Pari, PariError + +pari = Pari() testmodules = [ 'bern', @@ -59,18 +62,36 @@ galpol_installed = True seadata_installed = True +# test extensions presence. +try: + pari.ellmodulareqn(2) +except PariError as e: + if "error opening seadata file" in str(e): + seadata_installed = False + else: + raise e + +try: + pari.galoisgetpol(8) +except PariError as e: + if "error opening galpol file" in str(e): + galpol_installed = True + else: + raise e + suite = unittest.TestSuite() for t in testmodules: - try: - # If the module defines a suite() function, call it to get the suite. - mod = __import__(t, globals(), locals(), ['suite']) - suitefn = getattr(mod, 'suite') - suite.addTest(suitefn()) - except (ImportError, AttributeError): - # else, just load all the test cases from the module. - suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t)) + if not ((t in require_galpol and not galpol_installed) or (t in require_seadata and not seadata_installed)): + try: + # If the module defines a suite() function, call it to get the suite. + mod = __import__(t, globals(), locals(), ['suite']) + suitefn = getattr(mod, 'suite') + suite.addTest(suitefn()) + except (ImportError, AttributeError): + # else, just load all the test cases from the module. + suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t)) res = unittest.TextTestRunner().run(suite) retcode = 0 if res.wasSuccessful() else 1 From e50d5d16d830970a1a61f769f4c1eff1fbf472ca Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Fri, 10 Nov 2017 15:56:05 +0100 Subject: [PATCH 20/28] To squash --- tests/unittests/alltest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 2e24818..dba13b6 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -75,7 +75,7 @@ pari.galoisgetpol(8) except PariError as e: if "error opening galpol file" in str(e): - galpol_installed = True + galpol_installed = False else: raise e From be420a8e4f0f932251338135d1a6890c143e8159 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Fri, 10 Nov 2017 16:24:49 +0100 Subject: [PATCH 21/28] testutils : xrange compatibility for python3 --- tests/unittests/testutils.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/unittests/testutils.py b/tests/unittests/testutils.py index 1245392..3cbad0b 100644 --- a/tests/unittests/testutils.py +++ b/tests/unittests/testutils.py @@ -1,7 +1,13 @@ +import sys + +if sys.version_info < (3, 0): + range = xrange + + def primes(n): """ Returns a list of primes < n """ - sieve = [True] * int(n/2) - for i in xrange(3,int(n**0.5)+1,2): - if sieve[i/2]: - sieve[i*i/2::i] = [False] * ((n-i*i-1)/(2*i)+1) - return [2] + [2*i+1 for i in xrange(1,n/2) if sieve[i]] + sieve = [True] * int(n / 2) + for i in range(3, int(n ** 0.5) + 1, 2): + if sieve[i / 2]: + sieve[i * i / 2::i] = [False] * ((n - i * i - 1) / (2 * i) + 1) + return [2] + [2 * i + 1 for i in range(1, n / 2) if sieve[i]] From 19dc4534a1f9c2578e66ca465ac137e4ccef7faa Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Mon, 13 Nov 2017 11:55:04 +0100 Subject: [PATCH 22/28] unittests : Compatibility with python3 --- tests/unittests/bern.py | 6 +- tests/unittests/bit.py | 190 +++++++++++++++++------------------ tests/unittests/testutils.py | 6 +- 3 files changed, 101 insertions(+), 101 deletions(-) diff --git a/tests/unittests/bern.py b/tests/unittests/bern.py index 1e321ed..9b7b12e 100644 --- a/tests/unittests/bern.py +++ b/tests/unittests/bern.py @@ -35,16 +35,16 @@ def test_bern(self): with self.assertRaises(PariError) as context: pari.bernfrac(-1) - self.assertTrue('domain error in bernfrac: index < 0' in context.exception) + self.assertTrue('domain error in bernfrac: index < 0' in str(context.exception)) with self.assertRaises(PariError) as context: pari.bernreal(-1) - self.assertTrue('domain error in bernreal: index < 0' in context.exception) + self.assertTrue('domain error in bernreal: index < 0' in str(context.exception)) with self.assertRaises(PariError) as context: pari.bernpol(-1) - self.assertTrue('domain error in bernpol: index < 0' in context.exception) + self.assertTrue('domain error in bernpol: index < 0' in str(context.exception)) def test_bernvec(self): self.assertEquals(pari.bernvec(30), '[1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510, 43867/798,' + diff --git a/tests/unittests/bit.py b/tests/unittests/bit.py index 7ebf644..b6bdcde 100644 --- a/tests/unittests/bit.py +++ b/tests/unittests/bit.py @@ -73,126 +73,126 @@ def test_bit(self): res = [['[0, 0, 0]', '[0, 3, 0]', '[0, -3, 0]', - '[0, 36893488147419103231L, 0]', - '[0, 340282366920938463481821351505477763073L, 0]', - '[0, -340282366920938463481821351505477763073L, 0]', - '[0, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', + '[0, 36893488147419103231, 0]', + '[0, 340282366920938463481821351505477763073, 0]', + '[0, -340282366920938463481821351505477763073, 0]', + '[0, I, forbidden bitwise and t_INT , t_COMPLEX]', '[3, 3, 3]', '[3, -3, 1]', - '[3, 36893488147419103231L, 3]', - '[3, 340282366920938463481821351505477763073L, 1]', - '[3, -340282366920938463481821351505477763073L, 3]', - '[3, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', + '[3, 36893488147419103231, 3]', + '[3, 340282366920938463481821351505477763073, 1]', + '[3, -340282366920938463481821351505477763073, 3]', + '[3, I, forbidden bitwise and t_INT , t_COMPLEX]', '[-3, -3, -3]', - '[-3, 36893488147419103231L, 36893488147419103229]', - '[-3, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763073]', - '[-3, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763075]', - '[-3, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', - '[36893488147419103231L, 36893488147419103231L, 36893488147419103231]', - '[36893488147419103231L, 340282366920938463481821351505477763073L, 18446744073709551617]', - '[36893488147419103231L, -340282366920938463481821351505477763073L, 18446744073709551615]', - '[36893488147419103231L, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', - '[340282366920938463481821351505477763073L, 340282366920938463481821351505477763073L, ' + '[-3, 36893488147419103231, 36893488147419103229]', + '[-3, 340282366920938463481821351505477763073, 340282366920938463481821351505477763073]', + '[-3, -340282366920938463481821351505477763073, -340282366920938463481821351505477763075]', + '[-3, I, forbidden bitwise and t_INT , t_COMPLEX]', + '[36893488147419103231, 36893488147419103231, 36893488147419103231]', + '[36893488147419103231, 340282366920938463481821351505477763073, 18446744073709551617]', + '[36893488147419103231, -340282366920938463481821351505477763073, 18446744073709551615]', + '[36893488147419103231, I, forbidden bitwise and t_INT , t_COMPLEX]', + '[340282366920938463481821351505477763073, 340282366920938463481821351505477763073, ' '340282366920938463481821351505477763073]', - '[340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, 1]', - '[340282366920938463481821351505477763073L, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', - '[-340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, ' + '[340282366920938463481821351505477763073, -340282366920938463481821351505477763073, 1]', + '[340282366920938463481821351505477763073, I, forbidden bitwise and t_INT , t_COMPLEX]', + '[-340282366920938463481821351505477763073, -340282366920938463481821351505477763073, ' '-340282366920938463481821351505477763073]', - '[-340282366920938463481821351505477763073L, I, \'forbidden bitwise and t_INT , t_COMPLEX\']', - '[I, I, \'forbidden bitwise and t_COMPLEX , t_COMPLEX\']'], + '[-340282366920938463481821351505477763073, I, forbidden bitwise and t_INT , t_COMPLEX]', + '[I, I, forbidden bitwise and t_COMPLEX , t_COMPLEX]'], ['[0, 0, 0]', '[0, 3, 0]', '[0, -3, 0]', - '[0, 36893488147419103231L, 0]', - '[0, 340282366920938463481821351505477763073L, 0]', - '[0, -340282366920938463481821351505477763073L, 0]', - '[0, I, \'forbidden bitwise negated imply t_INT , t_COMPLEX\']', + '[0, 36893488147419103231, 0]', + '[0, 340282366920938463481821351505477763073, 0]', + '[0, -340282366920938463481821351505477763073, 0]', + '[0, I, forbidden bitwise negated imply t_INT , t_COMPLEX]', '[3, 3, 0]', '[3, -3, 2]', - '[3, 36893488147419103231L, 0]', - '[3, 340282366920938463481821351505477763073L, 2]', - '[3, -340282366920938463481821351505477763073L, 0]', - '[3, I, \'forbidden bitwise negated imply t_INT , t_COMPLEX\']', + '[3, 36893488147419103231, 0]', + '[3, 340282366920938463481821351505477763073, 2]', + '[3, -340282366920938463481821351505477763073, 0]', + '[3, I, forbidden bitwise negated imply t_INT , t_COMPLEX]', '[-3, -3, 0]', - '[-3, 36893488147419103231L, -36893488147419103232]', - '[-3, 340282366920938463481821351505477763073L, -340282366920938463481821351505477763076]', - '[-3, -340282366920938463481821351505477763073L, 340282366920938463481821351505477763072]', - '[-3, I, \'forbidden bitwise negated imply t_INT , t_COMPLEX\']', - '[36893488147419103231L, 36893488147419103231L, 0]', - '[36893488147419103231L, 340282366920938463481821351505477763073L, 18446744073709551614]', - '[36893488147419103231L, -340282366920938463481821351505477763073L, 18446744073709551616]', - '[36893488147419103231L, I, \'forbidden bitwise negated imply t_INT , t_COMPLEX\']', - '[340282366920938463481821351505477763073L, 340282366920938463481821351505477763073L, 0]', - '[340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, ' + '[-3, 36893488147419103231, -36893488147419103232]', + '[-3, 340282366920938463481821351505477763073, -340282366920938463481821351505477763076]', + '[-3, -340282366920938463481821351505477763073, 340282366920938463481821351505477763072]', + '[-3, I, forbidden bitwise negated imply t_INT , t_COMPLEX]', + '[36893488147419103231, 36893488147419103231, 0]', + '[36893488147419103231, 340282366920938463481821351505477763073, 18446744073709551614]', + '[36893488147419103231, -340282366920938463481821351505477763073, 18446744073709551616]', + '[36893488147419103231, I, forbidden bitwise negated imply t_INT , t_COMPLEX]', + '[340282366920938463481821351505477763073, 340282366920938463481821351505477763073, 0]', + '[340282366920938463481821351505477763073, -340282366920938463481821351505477763073, ' '340282366920938463481821351505477763072]', - '[340282366920938463481821351505477763073L, I, \'forbidden bitwise negated imply t_INT , ' - 't_COMPLEX\']', - '[-340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, 0]', - '[-340282366920938463481821351505477763073L, I, \'forbidden bitwise negated imply t_INT , ' - 't_COMPLEX\']', - '[I, I, \'forbidden bitwise negated imply t_COMPLEX , t_COMPLEX\']'], + '[340282366920938463481821351505477763073, I, forbidden bitwise negated imply t_INT , ' + 't_COMPLEX]', + '[-340282366920938463481821351505477763073, -340282366920938463481821351505477763073, 0]', + '[-340282366920938463481821351505477763073, I, forbidden bitwise negated imply t_INT , ' + 't_COMPLEX]', + '[I, I, forbidden bitwise negated imply t_COMPLEX , t_COMPLEX]'], ['[0, 0, 0]', '[0, 3, 3]', '[0, -3, -3]', - '[0, 36893488147419103231L, 36893488147419103231]', - '[0, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763073]', - '[0, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763073]', - '[0, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', + '[0, 36893488147419103231, 36893488147419103231]', + '[0, 340282366920938463481821351505477763073, 340282366920938463481821351505477763073]', + '[0, -340282366920938463481821351505477763073, -340282366920938463481821351505477763073]', + '[0, I, forbidden bitwise or t_INT , t_COMPLEX]', '[3, 3, 3]', '[3, -3, -1]', - '[3, 36893488147419103231L, 36893488147419103231]', - '[3, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763075]', - '[3, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763073]', - '[3, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', + '[3, 36893488147419103231, 36893488147419103231]', + '[3, 340282366920938463481821351505477763073, 340282366920938463481821351505477763075]', + '[3, -340282366920938463481821351505477763073, -340282366920938463481821351505477763073]', + '[3, I, forbidden bitwise or t_INT , t_COMPLEX]', '[-3, -3, -3]', - '[-3, 36893488147419103231L, -1]', - '[-3, 340282366920938463481821351505477763073L, -3]', - '[-3, -340282366920938463481821351505477763073L, -1]', - '[-3, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', - '[36893488147419103231L, 36893488147419103231L, 36893488147419103231]', - '[36893488147419103231L, 340282366920938463481821351505477763073L, ' + '[-3, 36893488147419103231, -1]', + '[-3, 340282366920938463481821351505477763073, -3]', + '[-3, -340282366920938463481821351505477763073, -1]', + '[-3, I, forbidden bitwise or t_INT , t_COMPLEX]', + '[36893488147419103231, 36893488147419103231, 36893488147419103231]', + '[36893488147419103231, 340282366920938463481821351505477763073, ' '340282366920938463500268095579187314687]', - '[36893488147419103231L, -340282366920938463481821351505477763073L, ' + '[36893488147419103231, -340282366920938463481821351505477763073, ' '-340282366920938463463374607431768211457]', - '[36893488147419103231L, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', - '[340282366920938463481821351505477763073L, 340282366920938463481821351505477763073L, ' + '[36893488147419103231, I, forbidden bitwise or t_INT , t_COMPLEX]', + '[340282366920938463481821351505477763073, 340282366920938463481821351505477763073, ' '340282366920938463481821351505477763073]', - '[340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, -1]', - '[340282366920938463481821351505477763073L, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', - '[-340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, ' + '[340282366920938463481821351505477763073, -340282366920938463481821351505477763073, -1]', + '[340282366920938463481821351505477763073, I, forbidden bitwise or t_INT , t_COMPLEX]', + '[-340282366920938463481821351505477763073, -340282366920938463481821351505477763073, ' '-340282366920938463481821351505477763073]', - '[-340282366920938463481821351505477763073L, I, \'forbidden bitwise or t_INT , t_COMPLEX\']', - '[I, I, \'forbidden bitwise or t_COMPLEX , t_COMPLEX\']'], + '[-340282366920938463481821351505477763073, I, forbidden bitwise or t_INT , t_COMPLEX]', + '[I, I, forbidden bitwise or t_COMPLEX , t_COMPLEX]'], ['[0, 0, 0]', '[0, 3, 3]', '[0, -3, -3]', - '[0, 36893488147419103231L, 36893488147419103231]', - '[0, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763073]', - '[0, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763073]', - '[0, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', + '[0, 36893488147419103231, 36893488147419103231]', + '[0, 340282366920938463481821351505477763073, 340282366920938463481821351505477763073]', + '[0, -340282366920938463481821351505477763073, -340282366920938463481821351505477763073]', + '[0, I, forbidden bitwise xor t_INT , t_COMPLEX]', '[3, 3, 0]', '[3, -3, -2]', - '[3, 36893488147419103231L, 36893488147419103228]', - '[3, 340282366920938463481821351505477763073L, 340282366920938463481821351505477763074]', - '[3, -340282366920938463481821351505477763073L, -340282366920938463481821351505477763076]', - '[3, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', + '[3, 36893488147419103231, 36893488147419103228]', + '[3, 340282366920938463481821351505477763073, 340282366920938463481821351505477763074]', + '[3, -340282366920938463481821351505477763073, -340282366920938463481821351505477763076]', + '[3, I, forbidden bitwise xor t_INT , t_COMPLEX]', '[-3, -3, 0]', - '[-3, 36893488147419103231L, -36893488147419103230]', - '[-3, 340282366920938463481821351505477763073L, -340282366920938463481821351505477763076]', - '[-3, -340282366920938463481821351505477763073L, 340282366920938463481821351505477763074]', - '[-3, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', - '[36893488147419103231L, 36893488147419103231L, 0]', - '[36893488147419103231L, 340282366920938463481821351505477763073L, ' + '[-3, 36893488147419103231, -36893488147419103230]', + '[-3, 340282366920938463481821351505477763073, -340282366920938463481821351505477763076]', + '[-3, -340282366920938463481821351505477763073, 340282366920938463481821351505477763074]', + '[-3, I, forbidden bitwise xor t_INT , t_COMPLEX]', + '[36893488147419103231, 36893488147419103231, 0]', + '[36893488147419103231, 340282366920938463481821351505477763073, ' '340282366920938463481821351505477763070]', - '[36893488147419103231L, -340282366920938463481821351505477763073L, ' + '[36893488147419103231, -340282366920938463481821351505477763073, ' '-340282366920938463481821351505477763072]', - '[36893488147419103231L, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', - '[340282366920938463481821351505477763073L, 340282366920938463481821351505477763073L, 0]', - '[340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, -2]', - '[340282366920938463481821351505477763073L, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', - '[-340282366920938463481821351505477763073L, -340282366920938463481821351505477763073L, 0]', - '[-340282366920938463481821351505477763073L, I, \'forbidden bitwise xor t_INT , t_COMPLEX\']', - '[I, I, \'forbidden bitwise xor t_COMPLEX , t_COMPLEX\']']] + '[36893488147419103231, I, forbidden bitwise xor t_INT , t_COMPLEX]', + '[340282366920938463481821351505477763073, 340282366920938463481821351505477763073, 0]', + '[340282366920938463481821351505477763073, -340282366920938463481821351505477763073, -2]', + '[340282366920938463481821351505477763073, I, forbidden bitwise xor t_INT , t_COMPLEX]', + '[-340282366920938463481821351505477763073, -340282366920938463481821351505477763073, 0]', + '[-340282366920938463481821351505477763073, I, forbidden bitwise xor t_INT , t_COMPLEX]', + '[I, I, forbidden bitwise xor t_COMPLEX , t_COMPLEX]']] args = [0, 3, -3, 2 ** 65 - 1, N, -N, pari('I')]; funs = [pari.bitand, pari.bitnegimply, pari.bitor, pari.bitxor]; @@ -204,7 +204,7 @@ def test_bit(self): for j in range(i, len(args)): u = args[i] v = args[j] - self.assertEquals(str([u, v, self.iferr(f, u, v)]), res[a][k]) + self.assertEquals("[%s, %s, %s]" % (u, v, self.iferr(f, u, v)), res[a][k]) k += 1 pari.bittest(-1,10) @@ -213,7 +213,7 @@ def test_bitneg(self): def iferrbn(u): try: - return [u, pari.bitneg(u,65),pari.bitneg(u)] + return '[%s, %s, %s]' % (u, pari.bitneg(u, 65), pari.bitneg(u)) except PariError as e: return str(e) N = 2 ** 128 + 2 ** 64 + 1; @@ -222,10 +222,10 @@ def iferrbn(u): res = ['[0, 36893488147419103231, -1]', '[3, 36893488147419103228, -4]', '[-3, 2, 2]', - '[36893488147419103231L, 0, -36893488147419103232]', - '[340282366920938463481821351505477763073L, 18446744073709551614, ' + '[36893488147419103231, 0, -36893488147419103232]', + '[340282366920938463481821351505477763073, 18446744073709551614, ' '-340282366920938463481821351505477763074]', - '[-340282366920938463481821351505477763073L, 18446744073709551616, 34028236692093846348182135150547776' + '[-340282366920938463481821351505477763073, 18446744073709551616, 34028236692093846348182135150547776' '3072]', 'incorrect type in bitwise negation (t_COMPLEX)'] diff --git a/tests/unittests/testutils.py b/tests/unittests/testutils.py index 3cbad0b..1bc1835 100644 --- a/tests/unittests/testutils.py +++ b/tests/unittests/testutils.py @@ -8,6 +8,6 @@ def primes(n): """ Returns a list of primes < n """ sieve = [True] * int(n / 2) for i in range(3, int(n ** 0.5) + 1, 2): - if sieve[i / 2]: - sieve[i * i / 2::i] = [False] * ((n - i * i - 1) / (2 * i) + 1) - return [2] + [2 * i + 1 for i in range(1, n / 2) if sieve[i]] + if sieve[int(i / 2)]: + sieve[int(i * i / 2)::i] = [False] * int((n - i * i - 1) / (2 * i) + 1) + return [2] + [2 * i + 1 for i in range(1, int(n / 2)) if sieve[i]] From 54dcdf460f6f5e67d15f9c8ce27e2430f51f6f85 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Wed, 15 Nov 2017 17:48:06 +0100 Subject: [PATCH 23/28] unittests : remove tests not working with snapshots version of gap bestappr ellanal idealramgroups quadray polred --- tests/unittests/alltest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index dba13b6..4e61955 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -6,20 +6,20 @@ testmodules = [ 'bern', - 'bestappr', + # 'bestappr', 'set', 'polylog', 'subcyclo', 'characteristic', 'chinese', 'disc', - 'ellanal', + # 'ellanal', 'ellmodulareqn', 'factorint', 'gamma', 'galpol', 'idealappr', - 'idealramgroups', + # 'idealramgroups', 'isprime', 'lambert', 'lex', @@ -44,14 +44,14 @@ 'qfb', 'qfbclassno', 'qfsolve', - 'quadray', + # 'quadray', 'rootsreal', 'ser', 'subst', 'sumdedekind', 'sumformal', 'zeta', - 'polred', + # 'polred', 'bit', 'charpoly' ] From 11024a2a3b32a7b32710a88ffc61acb729b7d189 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Wed, 17 Jan 2018 14:19:58 +0100 Subject: [PATCH 24/28] unittests : remove tests not working with 2.8.1.beta version of gap polylog gamma nfsplitting rootsreal ser subst --- tests/unittests/alltest.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 4e61955..760ba79 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -8,7 +8,7 @@ 'bern', # 'bestappr', 'set', - 'polylog', + # 'polylog', 'subcyclo', 'characteristic', 'chinese', @@ -16,7 +16,7 @@ # 'ellanal', 'ellmodulareqn', 'factorint', - 'gamma', + # 'gamma', 'galpol', 'idealappr', # 'idealramgroups', @@ -34,7 +34,7 @@ 'modfun', 'modular', 'nfrootsof1', - 'nfsplitting', + # 'nfsplitting', 'norm', 'number', 'pol', @@ -45,9 +45,9 @@ 'qfbclassno', 'qfsolve', # 'quadray', - 'rootsreal', - 'ser', - 'subst', + # 'rootsreal', + # 'ser', + # 'subst', 'sumdedekind', 'sumformal', 'zeta', From c5eae74c7d0b2e6cfa2d824a41e08a5ad216b262 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Wed, 17 Jan 2018 14:52:19 +0100 Subject: [PATCH 25/28] unittests : Build a sample branch with only fully working tests Test working with 2.9.3 2.8.1.beta and snapshot versions --- tests/unittests/alltest.py | 21 +- tests/unittests/bestappr.py | 76 - tests/unittests/contfrac.py | 39 - tests/unittests/ellanal.py | 149 -- tests/unittests/gamma.py | 342 ----- tests/unittests/idealramgroups.py | 109 -- tests/unittests/polred.py | 289 ---- tests/unittests/polylog.py | 95 -- tests/unittests/quadray.py | 2219 ----------------------------- tests/unittests/rootsreal.py | 314 ---- tests/unittests/ser.py | 314 ---- tests/unittests/set.py | 3 - tests/unittests/subst.py | 147 -- 13 files changed, 5 insertions(+), 4112 deletions(-) delete mode 100644 tests/unittests/bestappr.py delete mode 100644 tests/unittests/ellanal.py delete mode 100644 tests/unittests/gamma.py delete mode 100644 tests/unittests/idealramgroups.py delete mode 100644 tests/unittests/polred.py delete mode 100644 tests/unittests/polylog.py delete mode 100644 tests/unittests/quadray.py delete mode 100644 tests/unittests/rootsreal.py delete mode 100644 tests/unittests/ser.py delete mode 100644 tests/unittests/subst.py diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 760ba79..78795b0 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -6,20 +6,17 @@ testmodules = [ 'bern', - # 'bestappr', 'set', - # 'polylog', - 'subcyclo', + 'bit', 'characteristic', + 'charpoly', 'chinese', + 'contfrac', 'disc', - # 'ellanal', 'ellmodulareqn', 'factorint', - # 'gamma', 'galpol', 'idealappr', - # 'idealramgroups', 'isprime', 'lambert', 'lex', @@ -28,13 +25,11 @@ 'list', 'log', 'mathnf', - 'contfrac', 'minim', 'minmax', 'modfun', 'modular', 'nfrootsof1', - # 'nfsplitting', 'norm', 'number', 'pol', @@ -44,16 +39,10 @@ 'qfb', 'qfbclassno', 'qfsolve', - # 'quadray', - # 'rootsreal', - # 'ser', - # 'subst', + 'subcyclo', 'sumdedekind', 'sumformal', - 'zeta', - # 'polred', - 'bit', - 'charpoly' + 'zeta' ] require_galpol = ["galpol"] diff --git a/tests/unittests/bestappr.py b/tests/unittests/bestappr.py deleted file mode 100644 index c8f0478..0000000 --- a/tests/unittests/bestappr.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/19/2017 - -"""Original pari/GP test file bestappr : -bestappr(-1./7, 7) -bestappr(-1./7, 6) -bestappr(Mod(-1/7,100)) -bestappr(Mod(-1/7,100), 6) -bestappr(Mod(-1/7,100), 7) -bestappr(-1/7 + O(5^10)) -bestappr(-1/7 + O(5^10), 6) -type( bestappr(1+0.*I) ) - -bestapprPade((x^3+1)/(x^10+2)) -bestapprPade((x^3+1)/(x^10+2), 4) -bestapprPade(1/(1+x+O(x^10))) -bestapprPade(1/(1+x+O(x^10)), 5) -bestapprPade(1/(1+x^6+O(x^13)), 5) -bestapprPade(1/(1+x^6+O(x^13))) -bestapprPade(Mod(x^3+x^2+x+1, x^5-2)) -bestapprPade(x^2+x^3+x^4+O(x^5)) -bestapprPade(x^-4+x^-3+x^-2+O(x^-1)) -bestapprPade(x^10/(1-x)^11+O(x^22)) -""" -import unittest -import cypari2 - -pari = cypari2.Pari() - - -class TestBestappr(unittest.TestCase): - def test_bestappr(self): - self.assertEquals(pari.bestappr(-1./7, 7), '-1/7') - self.assertEquals(pari.bestappr(-1./7, 6), '-1/6') - self.assertEquals(pari.bestappr(pari.Mod('-1/7', 100)), '-1/7') - self.assertEquals(pari.bestappr(pari.Mod('-1/7', 100), 6), '[]') - self.assertEquals(pari.bestappr(pari.Mod('-1/7', 100), 7), '-1/7') - self.assertEquals(pari.bestappr('-1/7 + O(5^10)'), '-1/7') - self.assertEquals(pari.bestappr('-1/7 + O(5^10)', 6), '[]') - self.assertEquals(pari.type( pari.bestappr('1+0.*I')), '"t_INT"') - self.assertEquals(pari.bestapprPade('(x^3+1)/(x^10+2)'), '(x^3 + 1)/(x^10 + 2)') - self.assertEquals(pari.bestapprPade('(x^3+1)/(x^10+2)', 4), '1/2*x^3 + 1/2') - self.assertEquals(pari.bestapprPade('1/(1+x+O(x^10))'), '1/(x + 1)') - self.assertEquals(pari.bestapprPade('1/(1+x+O(x^10))', 5), '1/(x + 1)') - self.assertEquals(pari.bestapprPade('1/(1+x^6+O(x^13))', 5), '[]') - self.assertEquals(pari.bestapprPade('1/(1+x^6+O(x^13))'), '1/(x^6 + 1)') - self.assertEquals(pari.bestapprPade(pari.Mod('x^3+x^2+x+1', 'x^5-2')), '(x - 2)/(-x^2 + x)') - self.assertEquals(pari.bestapprPade('x^2+x^3+x^4+O(x^5)'), 'x^2/(-x + 1)') - self.assertEquals(pari.bestapprPade('x^-4+x^-3+x^-2+O(x^-1)'), '1/(-x^5 + x^4)') - self.assertEquals(pari.bestapprPade('x^10/(1-x)^11+O(x^22)'), """x^10/(-x^11 + 11*x^10 - 55*x^9 + 165*x^8 - - 330*x^7 + 462*x^6 - 462*x^5 + 330*x^4 - 165*x^3 + 55*x^2 - 11*x + 1)""") - -""" **** Expected results **** - --1/7 --1/6 --1/7 -[] --1/7 --1/7 -[] -"t_INT" -(x^3 + 1)/(x^10 + 2) -1/2*x^3 + 1/2 -1/(x + 1) -1/(x + 1) -[] -1/(x^6 + 1) -(x - 2)/(-x^2 + x) -x^2/(-x + 1) -1/(-x^5 + x^4) -x^10/(-x^11 + 11*x^10 - 55*x^9 + 165*x^8 - 330*x^7 + 462*x^6 - 462*x^5 + 330 -*x^4 - 165*x^3 + 55*x^2 - 11*x + 1) - -""" diff --git a/tests/unittests/contfrac.py b/tests/unittests/contfrac.py index 7e48d8a..bf767e3 100644 --- a/tests/unittests/contfrac.py +++ b/tests/unittests/contfrac.py @@ -20,7 +20,6 @@ contfracpnqn(v,0) contfracpnqn(v,1) contfracpnqn(v,2) - s=exp(x); contfracinit(s,0) contfracinit(s,1) @@ -94,75 +93,38 @@ def test_contfrac(self): self.assertTrue('incorrect type in contfracinit (t_INT)' in str(context.exception)) """**** Original expected results **** - *** at top-level: contfrac(1,[],-1) *** ^----------------- *** contfrac: domain error in contfrac: nmax < 0 *** at top-level: contfracpnqn(Vecsmal *** ^-------------------- *** contfracpnqn: incorrect type in pnqn (t_VECSMALL). - [1 0] - [0 1] - [;] [;] - [2 1] - [1 0] - - [2] - [1] - - [2] - [1] - - [10 3] - [ 7 2] - - [1] - [1] - - [1 3] - [1 2] - - [1 3 10] - [1 2 7] - - [144 22] - [ 33 5] - - [4] - [1] - - [4 22] - [1 5] - - [4 22 144] - [1 5 33] - [[], []] [[-1], []] [[-1], [1/2]] @@ -181,5 +143,4 @@ def test_contfrac(self): *** at top-level: contfracinit(1) *** ^--------------- *** contfracinit: incorrect type in contfracinit (t_INT). - """ diff --git a/tests/unittests/ellanal.py b/tests/unittests/ellanal.py deleted file mode 100644 index 40ccb51..0000000 --- a/tests/unittests/ellanal.py +++ /dev/null @@ -1,149 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 - -"""Original pari/GP test file ellanal : -default(realprecision,38); -rk(x)=x=ellinit(x);ellanalyticrank(x); -rk([0, -1, 1, -10, -20]) -rk([0, 0, 1, -1, 0]) -rk([0, 1, 1, -2, 0]) -rk([0, 0, 1, -7, 6]) -rk([-5187, 176830]) - -he(x)=x=ellinit(x);ellheegner(x); -he([1, 1, 0, -1297, -18530]) -he([0, -1, 1, -33, 93]) -he([-157^2,0]) -he([0,0,-9/484,0,-27/234256]) -getheap()[1] - -E=ellinit([0,-1437004800,0,458885065605120000,0]); -ellglobalred(E); ellheegner(E) - -L = ellinit([0,0,1,7,6]); -ellL1(L) -ellL1(L,1) -ellL1(L,3) -ellL1(ellinit([0,1,1,-2,0]),2) -default(realprecision,115); -ellL1(L) -ellL1(L,1) -ellL1(L,3) -ellL1(ellinit([0,1,1,-2,0]),2) - -default(realprecision,19); -ellmoddegree(ellinit([0,1,0,-4,-4])) -ellmoddegree(ellinit([-4,0])) -ellmoddegree(ellinit([0,-1,0,4,-4])) -ellmoddegree(ellinit([0,-1,0,-8,-16])) -ellmoddegree(ellinit([0,0,1,0,-7])) -ellmoddegree(ellinit([1,-1,0,0,-5])) -ellmoddegree(ellinit([1,-1,0,-69,-208])) -localbitprec(9); ellmoddegree(ellinit([0, -1, 1, 0, 0])) -""" -import unittest -from cypari2 import Pari, PariError - -pari = Pari() - - -class TestEllanal(unittest.TestCase): - - def test_ellanal(self): - pari.set_real_precision(38) - - def rk(x): - x = pari.ellinit(x, precision=128) - return pari.ellanalyticrank(x, precision=128) - - self.assertEquals(str(rk([0, -1, 1, -10, -20])), '[0, 0.25384186085591068433775892335090946105]') - self.assertEquals(str(rk([0, 0, 1, -1, 0])), '[1, 0.30599977383405230182048368332167647445]') - self.assertEquals(str(rk([0, 1, 1, -2, 0])), '[2, 1.5186330005768535404603852157894440381]') - self.assertEquals(str(rk([0, 0, 1, -7, 6])), '[3, 10.391099400715804138751850510360917070]') - self.assertEquals(str(rk([-5187, 176830])), '[5, 9997.0334671722554999496820788093288461]') - - def test_ellheegner(self): - pari.set_real_precision(38) - - def he(x): - x = pari.ellinit(x, precision=128) - return pari.ellheegner(x) - - self.assertEquals(str(he([1, 1, 0, -1297, -18530])), '[-339/16, 691/64]') - self.assertEquals(str(he([0, -1, 1, -33, 93])), '[-3, 12]') - self.assertEquals(str(he(['-157^2', 0])), - '[69648970982596494254458225/166136231668185267540804, ' - '538962435089604615078004307258785218335/67716816556077455999228495435742408]') - self.assertEquals(str(he([0, 0, '-9/484', 0, '-27/234256'])), '[553/17424, 25469/2299968]') - # self.assertEquals(str(pari.getheap()[0]), '30') - - E = pari.ellinit([0, -1437004800, 0, 458885065605120000, 0]); - pari.ellglobalred(E); - self.assertEquals(str(pari.ellheegner(E)), '[1317254400, 19916886528000]') - - def test_ellL1(self): - pari.set_real_precision(38) - L = pari.ellinit([0, 0, 1, 7, 6], precision=128); - self.assertEquals(str(pari.ellL1(L, precision=128)), '0') - self.assertEquals(str(pari.ellL1(L, 1, precision=128)), '2.8053554406276820682921020105298729343') - self.assertEquals(str(pari.ellL1(L, 3, precision=128)), '98.900778292211279593460469548777701093') - self.assertEquals(str(pari.ellL1(pari.ellinit([0, 1, 1, -2, 0], precision=128), 2, precision=128)), - '1.5186330005768535404603852157894440381') - pari.set_real_precision(115) - self.assertEquals(pari.ellL1(L, precision=383), '0') - self.assertEquals(str(pari.ellL1(L, 1, precision=383)), '2.8053554406276820682921020105298729342739341928943' + - '14010515738738778963706069444052334712747100820315923332165307854') - self.assertEquals(str(pari.ellL1(L, 3, precision=383)), '98.900778292211279593460469548777701093725662786697' + - '61921051303471931786459834656024843050255154457301289878660746149') - self.assertEquals(str(pari.ellL1(pari.ellinit([0, 1, 1, -2, 0]), 2, precision=383)), '1.51863300057685354046' + - '03852157894440381561950329898487031716101850959821454955611048804318700046577183337542984' + - '13640') - - def test_ellmoddegree(self): - # pari.set_real_precision(19) - self.assertEquals(pari.ellmoddegree(pari.ellinit([0, 1, 0, -4, -4]), precision=64), '[2, -53]') - self.assertEquals(pari.ellmoddegree(pari.ellinit([-4, 0]), precision=64), '[2, -53]') - self.assertEquals(pari.ellmoddegree(pari.ellinit([0, -1, 0, 4, -4]), precision=64), '[4, -55]') - self.assertEquals(pari.ellmoddegree(pari.ellinit([0, -1, 0, -8, -16]), precision=64), '[8, -54]') - self.assertEquals(pari.ellmoddegree(pari.ellinit([0, 0, 1, 0, -7]), precision=64), '[1, -55]') - self.assertEquals(pari.ellmoddegree(pari.ellinit([1, -1, 0, 0, -5]), precision=64), '[2, -56]') - self.assertEquals(pari.ellmoddegree(pari.ellinit([1, -1, 0, -69, -208]), precision=64), '[72, -62]') - # pari.localbitprec(9); - self.assertEquals(pari.ellmoddegree(pari.ellinit([0, -1, 1, 0, 0]), precision=9), '[1/5, -11]') - -"""**** Original expected results **** - -[0, 0.25384186085591068433775892335090946105] -[1, 0.30599977383405230182048368332167647445] -[2, 1.5186330005768535404603852157894440381] -[3, 10.391099400715804138751850510360917070] -[5, 9997.0334671722554999496820788093288461] -[-339/16, 691/64] -[-3, 12] -[69648970982596494254458225/166136231668185267540804, 5389624350896046150780 -04307258785218335/67716816556077455999228495435742408] -[553/17424, 25469/2299968] -30 -[1317254400, 19916886528000] -0 -2.8053554406276820682921020105298729343 -98.900778292211279593460469548777701093 -1.5186330005768535404603852157894440381 -0 -2.80535544062768206829210201052987293427393419289431401051573873877896370606 -9444052334712747100820315923332165307854 -98.9007782922112795934604695487777010937256627866976192105130347193178645983 -4656024843050255154457301289878660746149 -1.51863300057685354046038521578944403815619503298984870317161018509598214549 -5561104880431870004657718333754298413640 -[2, -53] -[2, -53] -[4, -55] -[8, -54] -[1, -55] -[2, -56] -[72, -62] -[1/5, -11] - -""" diff --git a/tests/unittests/gamma.py b/tests/unittests/gamma.py deleted file mode 100644 index bfdc0a7..0000000 --- a/tests/unittests/gamma.py +++ /dev/null @@ -1,342 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 - -"""Original pari/GP test file gamma : -default(realprecision,38); -default(seriesprecision,6); -gamma(2+I+x) -gamma(1+x) -gamma(2+x) -gamma(-2+x) -lngamma(2+I+x) -lngamma(1+x) -lngamma(-2+x) -lngamma(2+x) -lngamma(1) -lngamma(1.) -psi(2+I+x) -psi(1+x) -psi(-2+x) -gamma(-1/2+x) -gamma(1+a*x+O(x^2)) -lngamma(1+a*x+O(x^2)) -gamma(O(x)) -lngamma(O(x)) -psi(O(x)) - -psi(x) -gamma(x) -gamma(1000) -psi(2^400) -psi(-1.5) -psi(x+O(x^2)) -gamma(x+O(x^2)) -gamma(-1-10^-16) -gamma(10^-16) -lngamma(-1-10^-16) -lngamma(10^-16) - -binomial(2^64+1,2) -binomial(1001.,1000) - -lngamma(2^301) -lngamma(2^301 + 2*I) -lngamma(2^64 + 2*I) -lngamma(-200.5) -gammah(400) -gammah(400+I) -default(realprecision,115); -lngamma(2^301 + 2*I) -lngamma(2^301 + 200*I) -default(realprecision,154); -lngamma(2^301 + 2000*I) - -gamma(1+10^-30) -gamma(-1e-6) -""" -import unittest -from cypari2 import Pari, PariError - -pari = Pari() - - -class TestGamma(unittest.TestCase): - - def setUp(self): - pari.set_real_precision(38) - pari.set_series_precision(6) - - def tearDown(self): - pari.set_real_precision(15) - pari.set_series_precision(16) - - def test_gamma(self): - self.assertEquals(str(pari.gamma('2+I+x', precision=128)), - '(0.65296549642016672783864624794608469715 + 0.3430658398165453575' + - '8873598697831148676*I) + (0.19044897540645184469078131473790885364 + 0.580552467319476' + - '92349794265298068695525*I)*x + (0.090862784286733058570355592072096462602 + 0.21088392' + - '899265350361451872767550590408*I)*x^2 + (0.034253752000523576920016074597694397590 + 0' + - '.15168994440796279268955277197772465641*I)*x^3 + (-0.009313921054078589415919785948439' + - '2067432 + 0.033064651796439913976828620551277428299*I)*x^4 + (0.0066762623841895560506' + - '752315759505427095 + 0.015164046675666586697065188398143396917*I)*x^5 + O(x^6)') - self.assertEquals(str(pari.gamma('1+x', precision=128)), '1 - 0.57721566490153286060651209008240243104*x ' + - '+ 0.98905599532797255539539565150063470794*x^2 - 0.90747907608088628901656016735627511' + - '493*x^3 + 0.98172808683440018733638029402185085036*x^4 - 0.981995068903145202104701413' + - '79137467551*x^5 + O(x^6)') - self.assertEquals(str(pari.gamma('2+x', precision=128)), '1 + 0.42278433509846713939348790991759756896*x ' + - '+ 0.41184033042643969478888356141823227689*x^2 + 0.08157691924708626637883548414435959' + - '3009*x^3 + 0.074249010753513898319820126665575735431*x^4 - 0.0002669820687450147683211' + - '1976952382515602*x^5 + O(x^6)') - self.assertEquals(str(pari.gamma('-2+x', precision=128)), '0.50000000000000000000000000000000000000*x^-1 ' + - '+ 0.46139216754923356969674395495879878448 + 0.93661624898783663224281375818851553069*' + - 'x + 0.72048875166669501900756857612523634633*x^2 + 1.103289046423324306058136132104522' + - '1793*x^3 + O(x^4)') - self.assertEquals(str(pari.gamma('-1/2+x', precision=128)), '-3.5449077018110320545963349666822903656 - 0' + - '.12935358979554005531547953707588123112*x - 15.838884621997332891305490359174586834*x^' + - '2 - 0.088235140923071374511750322744686276244*x^3 - 63.9341199241678177373752902777138' + - '85431*x^4 - 0.042848354492868684268292005312709223076*x^5 + O(x^6)') - self.assertEquals(str(pari.gamma('1+a*x+O(x^2)', precision=128)), - '1 - 0.57721566490153286060651209008240243104*a*x + O(x^2)') - - with self.assertRaises(PariError) as context: - pari.gamma('O(x)', precision=128) - self.assertTrue('domain error in gamma: argument = 0' in str(context.exception)) - - self.assertEquals(str(pari.gamma('x', precision=128)), 'x^-1 - 0.57721566490153286060651209008240243104 + ' + - '0.98905599532797255539539565150063470794*x - 0.90747907608088628901656016735627511493*x' + - '^2 + 0.98172808683440018733638029402185085036*x^3 - 0.981995068903145202104701413791374' + - '67551*x^4 + O(x^5)') - self.assertEquals(str(pari.gamma(1000, precision=128)), '4.0238726007709377354370243392300398572 E2564') - self.assertEquals(str(pari.gamma('x+O(x^2)', precision=128)), 'x^-1 + O(x^0)') - self.assertEquals(str(pari.gamma('-1-10^-16', precision=128)), '9999999999999999.5772156649015330017905') - self.assertEquals(str(pari.gamma('10^-16', precision=128)), '9999999999999999.4227843350984672382991') - - self.assertEquals(str(pari.binomial('2^64+1', 2)), '170141183460469231740910675752738881536') - self.assertEquals(str(pari.binomial('1001.', 1000)), '1001.0000000000000000000000000000000000') - - self.assertEquals(str(pari.gammah(400, precision=128)), '3.2007257594901922498857741835634344245 E867') - self.assertEquals(str(pari.gammah('400+I', precision=128)), - '3.0616681090421088936612867355651954590 E867 - 9.1937706728127042134545128900883765323 E' + - '866*I') - - pari.set_real_precision(154) - self.assertEquals(str(pari.gamma('1+10^-30', precision=512)), - '0.99999999999999999999999999999942278433509846713939348790991858662495316863661547179684' + - '57324923439953758567745265933287771985525453403691462945597162933800') - self.assertEquals(str(pari.gamma('-1e-6', precision=512)), - '-1000000.5772166539584356686368774405975327324364299837039157908236471064277420795292528' + - '95286760197004854674329979420483457441111886014601499071559796851143') - - def test_psi(self): - self.assertEquals(str(pari.psi('2+I+x', precision=128)), '(0.59465032062247697727187848272191072247 + 0.5' + - '7667404746858117413405079475000049045*I) + (0.46300009662276378629832651818418579441 -' + - ' 0.29423354275931886558301361715690299591*I)*x + (-0.065723534206032414131682728509702' + - '607416 + 0.13332642517253310620134768881568504070*I)*x^2 + (-0.00381240815891599630224' + - '72229013688544964 - 0.052881096443660109736465443839034730260*I)*x^3 + (0.011646173710' + - '168721646303099647994255377 + 0.017474497859917982232442372031895951470*I)*x^4 + (-0.0' + - '077757069690405743408170730434310459472 - 0.0040345642341327827815714280332882428196*I' + - ')*x^5 + O(x^6)') - self.assertEquals(str(pari.psi('1+x', precision=128)), '-0.57721566490153286060651209008240243104 + 1.644' + - '9340668482264364724151666460251892*x - 1.2020569031595942853997381615114499908*x^2 + 1' + - '.0823232337111381915160036965411679028*x^3 - 1.0369277551433699263313654864570341681*x' + - '^4 + 1.0173430619844491397145179297909205279*x^5 + O(x^6)') - self.assertEquals(str(pari.psi('-2+x', precision=128)), '-x^-1 + 0.92278433509846713939348790991759756896' + - ' + 2.8949340668482264364724151666460251892*x - 0.0770569031595942853997381615114499907' + - '62*x^2 + 2.1448232337111381915160036965411679028*x^3 + O(x^4)') - self.assertEquals(str(pari.psi('x', precision=128)), '-x^-1 - 0.57721566490153286060651209008240243104 + 1' + - '.6449340668482264364724151666460251892*x - 1.2020569031595942853997381615114499908*x^2 ' + - '+ 1.0823232337111381915160036965411679028*x^3 - 1.0369277551433699263313654864570341681' + - '*x^4 + 1.0173430619844491397145179297909205279*x^5 + O(x^6)') - - with self.assertRaises(PariError) as context: - pari.psi('O(x)', precision=128) - self.assertTrue('domain error in psi: argument = 0' in str(context.exception)) - - self.assertEquals(str(pari.psi('2^400', precision=128)), '277.25887222397812376689284858327062723') - self.assertEquals(str(pari.psi('-1.5', precision=128)), '0.70315664064524318722569033366791109947') - self.assertEquals(str(pari.psi('x+O(x^2)', precision=128)), '-x^-1 + O(x^0)') - - def test_lngamma(self): - self.assertEquals(str(pari.lngamma('2+I+x', precision=128)), '(-0.30434960902188368417660077077485938103 ' + - '+ 0.48375784292991511172812918802297918039*I) + (0.59465032062247697727187848272191072' + - '247 + 0.57667404746858117413405079475000049045*I)*x + (0.23150004831138189314916325909' + - '209289721 - 0.14711677137965943279150680857845149795*I)*x^2 + (-0.02190784473534413804' + - '3894242836567535805 + 0.044442141724177702067115896271895013565*I)*x^3 + (-0.000953102' + - '03972899907556180572534221362410 - 0.013220274110915027434116360959758682565*I)*x^4 + ' + - '(0.0023292347420337443292606199295988510753 + 0.00349489957198359644648847440637919029' + - '41*I)*x^5 + O(x^6)') - self.assertEquals(str(pari.lngamma('1+x', precision=128)), '-0.57721566490153286060651209008240243104*x +' + - ' 0.82246703342411321823620758332301259461*x^2 - 0.400685634386531428466579387170483330' + - '25*x^3 + 0.27058080842778454787900092413529197569*x^4 - 0.2073855510286739852662730972' + - '9140683361*x^5 + O(x^6)') - with self.assertRaises(PariError) as context: - pari.lngamma('-2+x', precision=128) - self.assertTrue('domain error in intformal: residue(series, pole) != 0' in str(context.exception)) - self.assertEquals(str(pari.lngamma('2+x', precision=128)), '0.42278433509846713939348790991759756896*x + ' + - '0.32246703342411321823620758332301259461*x^2 - 0.0673523010531980951332460538371499969' + - '21*x^3 + 0.020580808427784547879000924135291975694*x^4 - 0.007385551028673985266273097' + - '2914068336108*x^5 + O(x^6)') - self.assertEquals(str(pari.lngamma(1, precision=128)), '0.E-38') - self.assertEquals(str(pari.lngamma('1.', precision=128)), '0.E-38') - self.assertEquals(str(pari.lngamma('1+a*x+O(x^2)', precision=128)), - '-0.57721566490153286060651209008240243104*a*x + O(x^2)') - with self.assertRaises(PariError) as context: - pari.lngamma('O(x)', precision=128) - self.assertTrue('domain error in lngamma: argument = 0' in str(context.exception)) - - self.assertEquals(str(pari.lngamma('-1-10^-16', precision=128)), - '36.841361487904730902009429765103126607 - 6.2831853071795864769252867665590057684*I') - self.assertEquals(str(pari.lngamma('10^-16', precision=128)), '36.841361487904730886566296784796549486') - - self.assertEquals(str(pari.lngamma('2^301', precision=128)), '8.4592930575197658134779513864578051837 E92') - self.assertEquals(str(pari.lngamma('2^301 + 2*I', precision=128)), - '8.4592930575197658134779513864578051837 E92 + 417.27460269708707626917373711782229398*I') - self.assertEquals(str(pari.lngamma('2^64 + 2*I', precision=128)), - '799877009219260410589.21059353880333769 + 88.722839111672999605351501438022325492*I') - self.assertEquals(str(pari.lngamma('-200.5', precision=128)), - '-864.73828787067971564321683481711497423 - 631.46012337154844093099132003918007972*I') - - pari.set_real_precision(115) - self.assertEquals(str(pari.lngamma('2^301 + 2*I', precision=383)), - '845929305751976581347795138645780518366096909527115472' + - '113667217165978056363716339197618169691.8420416798032146865778 + 417.2746026970870762691' + - '7373711782229398145108088487366298064936571502296042575621879472972285159859522702000524' + - '67288*I') - self.assertEquals(str(pari.lngamma('2^301 + 200*I', precision=383)), - '8459293057519765813477951386457805183660969095271154' + - '72113667217165978056363716339197618169691.8420416798032146865778 + 41727.460269708707626' + - '9173737117822293981451080884873662980649365715022960425756218794729722851598595227020005' + - '2467288*I') - - pari.set_real_precision(154) - self.assertEquals(str(pari.lngamma('2^301 + 2000*I', precision=512)), - '8459293057519765813477951386457805183660969095271154721136672171659780563637163391976181' + - '69691.8420416798032146865778407117373385742831330551204346169684432 + 417274.60269708707' + - '6269173737117822293981451080884873662980649365715022960425756218794729722851598595227020' + - '0052467287642139293693997776338197086953142287383*I') - -"""**** Original expected results **** - -(0.65296549642016672783864624794608469715 + 0.343065839816545357588735986978 -31148676*I) + (0.19044897540645184469078131473790885364 + 0.5805524673194769 -2349794265298068695525*I)*x + (0.090862784286733058570355592072096462602 + 0 -.21088392899265350361451872767550590408*I)*x^2 + (0.034253752000523576920016 -074597694397590 + 0.15168994440796279268955277197772465641*I)*x^3 + (-0.0093 -139210540785894159197859484392067432 + 0.03306465179643991397682862055127742 -8299*I)*x^4 + (0.0066762623841895560506752315759505427095 + 0.01516404667566 -6586697065188398143396917*I)*x^5 + O(x^6) -1 - 0.57721566490153286060651209008240243104*x + 0.9890559953279725553953956 -5150063470794*x^2 - 0.90747907608088628901656016735627511493*x^3 + 0.9817280 -8683440018733638029402185085036*x^4 - 0.981995068903145202104701413791374675 -51*x^5 + O(x^6) -1 + 0.42278433509846713939348790991759756896*x + 0.4118403304264396947888835 -6141823227689*x^2 + 0.081576919247086266378835484144359593009*x^3 + 0.074249 -010753513898319820126665575735431*x^4 - 0.0002669820687450147683211197695238 -2515602*x^5 + O(x^6) -0.50000000000000000000000000000000000000*x^-1 + 0.46139216754923356969674395 -495879878448 + 0.93661624898783663224281375818851553069*x + 0.72048875166669 -501900756857612523634633*x^2 + 1.1032890464233243060581361321045221793*x^3 + - O(x^4) -(-0.30434960902188368417660077077485938103 + 0.48375784292991511172812918802 -297918039*I) + (0.59465032062247697727187848272191072247 + 0.576674047468581 -17413405079475000049045*I)*x + (0.23150004831138189314916325909209289721 - 0 -.14711677137965943279150680857845149795*I)*x^2 + (-0.02190784473534413804389 -4242836567535805 + 0.044442141724177702067115896271895013565*I)*x^3 + (-0.00 -095310203972899907556180572534221362410 - 0.01322027411091502743411636095975 -8682565*I)*x^4 + (0.0023292347420337443292606199295988510753 + 0.00349489957 -19835964464884744063791902941*I)*x^5 + O(x^6) --0.57721566490153286060651209008240243104*x + 0.8224670334241132182362075833 -2301259461*x^2 - 0.40068563438653142846657938717048333025*x^3 + 0.2705808084 -2778454787900092413529197569*x^4 - 0.20738555102867398526627309729140683361* -x^5 + O(x^6) - *** at top-level: lngamma(-2+x) - *** ^------------- - *** lngamma: domain error in intformal: residue(series, pole) != 0 -0.42278433509846713939348790991759756896*x + 0.32246703342411321823620758332 -301259461*x^2 - 0.067352301053198095133246053837149996921*x^3 + 0.0205808084 -27784547879000924135291975694*x^4 - 0.00738555102867398526627309729140683361 -08*x^5 + O(x^6) -0.E-38 -0.E-38 -(0.59465032062247697727187848272191072247 + 0.576674047468581174134050794750 -00049045*I) + (0.46300009662276378629832651818418579441 - 0.2942335427593188 -6558301361715690299591*I)*x + (-0.065723534206032414131682728509702607416 + -0.13332642517253310620134768881568504070*I)*x^2 + (-0.0038124081589159963022 -472229013688544964 - 0.052881096443660109736465443839034730260*I)*x^3 + (0.0 -11646173710168721646303099647994255377 + 0.017474497859917982232442372031895 -951470*I)*x^4 + (-0.0077757069690405743408170730434310459472 - 0.00403456423 -41327827815714280332882428196*I)*x^5 + O(x^6) --0.57721566490153286060651209008240243104 + 1.644934066848226436472415166646 -0251892*x - 1.2020569031595942853997381615114499908*x^2 + 1.0823232337111381 -915160036965411679028*x^3 - 1.0369277551433699263313654864570341681*x^4 + 1. -0173430619844491397145179297909205279*x^5 + O(x^6) --x^-1 + 0.92278433509846713939348790991759756896 + 2.89493406684822643647241 -51666460251892*x - 0.077056903159594285399738161511449990762*x^2 + 2.1448232 -337111381915160036965411679028*x^3 + O(x^4) --3.5449077018110320545963349666822903656 - 0.1293535897955400553154795370758 -8123112*x - 15.838884621997332891305490359174586834*x^2 - 0.0882351409230713 -74511750322744686276244*x^3 - 63.934119924167817737375290277713885431*x^4 - -0.042848354492868684268292005312709223076*x^5 + O(x^6) -1 - 0.57721566490153286060651209008240243104*a*x + O(x^2) --0.57721566490153286060651209008240243104*a*x + O(x^2) - *** at top-level: gamma(O(x)) - *** ^----------- - *** gamma: domain error in gamma: argument = 0 - *** at top-level: lngamma(O(x)) - *** ^------------- - *** lngamma: domain error in lngamma: argument = 0 - *** at top-level: psi(O(x)) - *** ^--------- - *** psi: domain error in psi: argument = 0 --x^-1 - 0.57721566490153286060651209008240243104 + 1.64493406684822643647241 -51666460251892*x - 1.2020569031595942853997381615114499908*x^2 + 1.082323233 -7111381915160036965411679028*x^3 - 1.0369277551433699263313654864570341681*x -^4 + 1.0173430619844491397145179297909205279*x^5 + O(x^6) -x^-1 - 0.57721566490153286060651209008240243104 + 0.989055995327972555395395 -65150063470794*x - 0.90747907608088628901656016735627511493*x^2 + 0.98172808 -683440018733638029402185085036*x^3 - 0.9819950689031452021047014137913746755 -1*x^4 + O(x^5) -4.0238726007709377354370243392300398572 E2564 -277.25887222397812376689284858327062723 -0.70315664064524318722569033366791109947 --x^-1 + O(x^0) -x^-1 + O(x^0) -9999999999999999.5772156649015330017905 -9999999999999999.4227843350984672382991 -36.841361487904730902009429765103126607 - 6.28318530717958647692528676655900 -57684*I -36.841361487904730886566296784796549486 -170141183460469231740910675752738881536 -1001.0000000000000000000000000000000000 -8.4592930575197658134779513864578051837 E92 -8.4592930575197658134779513864578051837 E92 + 417.27460269708707626917373711 -782229398*I -799877009219260410589.21059353880333769 + 88.7228391116729996053515014380223 -25492*I --864.73828787067971564321683481711497423 - 631.46012337154844093099132003918 -007972*I -3.2007257594901922498857741835634344245 E867 -3.0616681090421088936612867355651954590 E867 - 9.193770672812704213454512890 -0883765323 E866*I -8459293057519765813477951386457805183660969095271154721136672171659780563637 -16339197618169691.8420416798032146865778 + 417.27460269708707626917373711782 -2293981451080884873662980649365715022960425756218794729722851598595227020005 -2467288*I -8459293057519765813477951386457805183660969095271154721136672171659780563637 -16339197618169691.8420416798032146865778 + 41727.460269708707626917373711782 -2293981451080884873662980649365715022960425756218794729722851598595227020005 -2467288*I -8459293057519765813477951386457805183660969095271154721136672171659780563637 -16339197618169691.8420416798032146865778407117373385742831330551204346169684 -432 + 417274.602697087076269173737117822293981451080884873662980649365715022 -9604257562187947297228515985952270200052467287642139293693997776338197086953 -142287383*I -0.99999999999999999999999999999942278433509846713939348790991858662495316863 -6615471796845732492343995375856774526593328777198552545340369146294559716293 -3800 --1000000.5772166539584356686368774405975327324364299837039157908236471064277 -4207952925289528676019700485467432997942048345744111188601460149907155979685 -1143 - -""" diff --git a/tests/unittests/idealramgroups.py b/tests/unittests/idealramgroups.py deleted file mode 100644 index d077e0c..0000000 --- a/tests/unittests/idealramgroups.py +++ /dev/null @@ -1,109 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 - -"""Original pari/GP test file idealramgroups : -{ - K=nfinit(x^30 - 240*x^28 + 24364*x^26 - 1366520*x^24 + 46492470*x^22 - 994986280*x^20 + 13527103660*x^18 - 116596891080*x^16 + 634140564945*x^14 - 2144111162280*x^12 + 4349007947424*x^10 - 4933119511040*x^8 + 2746986107136*x^6 - 564152514560*x^4 + 40138752000*x^2 - 409600000); - G=galoisinit(K); - forprime(p=2,37, - pr = idealprimedec(K,p)[1]; - print(pr.p,":", apply(galoisidentify,idealramgroups(K,G,pr)))) -} -K=nfinit(x^6 + 12*x^5 + 60*x^4 + 376*x^3 + 80268*x^2 + 4569240*x + 66227068); -G=galoisinit(K); -D=idealprimedec(K,29)[1]; -[idealfrobenius(K,G,D),idealramgroups(K,G,D)] - -K=nfinit(polcyclo(24)); -G=galoisinit(K); -P=idealprimedec(K,2)[1]; -idealramgroups(K,G,P) - -\\#1755 -P=x^8-12*x^6+36*x^4-36*x^2+9;N=nfinit(P);G=galoisinit(N); -idealramgroups(N,G,idealprimedec(N,3)[1]) -""" -import unittest -from testutils import primes -from cypari2 import Pari, PariError - -pari = Pari() - - -class TestIdealramgroups(unittest.TestCase): - def test_idealramgroups(self): - K = pari.nfinit('x^30 - 240*x^28 + 24364*x^26 - 1366520*x^24 + 46492470*x^22 - 994986280*x^20 + 13527103660' + - '*x^18 - 116596891080*x^16 + 634140564945*x^14 - 2144111162280*x^12 + 4349007947424*x^10 ' + - '- 4933119511040*x^8 + 2746986107136*x^6 - 564152514560*x^4 + 40138752000*x^2 - 409600000') - G = pari.galoisinit(K); - - l = ['2:[[2, 1], [2, 1], [2, 1], [2, 1]]', - '3:[[15, 1]]', - '5:[[2, 1], [2, 1]]', - '7:[[2, 1]]', - '11:[[2, 1]]', - '13:[[15, 1]]', - '17:[[2, 1]]', - '19:[[10, 1], [5, 1]]', - '23:[[2, 1]]', - '29:[[2, 1]]', - '31:[[15, 1]]', - '37:[[15, 1], [3, 1]]'] - - i = 0 - for p in primes(38): - pr = pari.idealprimedec(K, p)[0]; - self.assertEquals("%d:%s" % (p, pari.apply(pari.galoisidentify, pari.idealramgroups(K, G, pr))), l[i]) - i += 1 - - K = pari.nfinit('x^6 + 12*x^5 + 60*x^4 + 376*x^3 + 80268*x^2 + 4569240*x + 66227068'); - G = pari.galoisinit(K); - D = pari.idealprimedec(K, 29)[0]; - self.assertEquals(str(pari.idealfrobenius(K, G, D)), 'Vecsmall([6, 3, 2, 5, 4, 1])') - self.assertEquals(str(pari.idealramgroups(K, G, D)), '[[[Vecsmall([6, 3, 2, 5, 4, 1])], Vecsmall([2])]]') - - K = pari.nfinit(pari.polcyclo(24)); - G = pari.galoisinit(K); - P = pari.idealprimedec(K, 2)[0]; - self.assertEquals(pari.idealramgroups(K, G, P), - '[[[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7]), Vecsmall([3, 4, 1, 2, 7, 8, 5, 6]), Vecsmall([5, ' + - '6, 7, 8, 1, 2, 3, 4])], Vecsmall([2, 2, 2])], [[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7]), Vecs' + - 'mall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2, 2])], [[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7])' + - ', Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2, 2])], [[Vecsmall([3, 4, 1, 2, 7, 8, ' + - '5, 6])], Vecsmall([2])], [[Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2])]]') - - # 1755 - P = 'x^8-12*x^6+36*x^4-36*x^2+9'; - N = pari.nfinit(P); - G = pari.galoisinit(N); - self.assertEquals(pari.idealramgroups(N, G, pari.idealprimedec(N, 3)[0]), - '[[[Vecsmall([7, 1, 5, 3, 6, 4, 8, 2]), Vecsmall([3, 5, 8, 2, 7, 1, 4, 6])],Vecsmall([4, ' + - '2])], [[Vecsmall([7, 1, 5, 3, 6, 4, 8, 2])], Vecsmall([4])]]') - -"""**** Original expected results **** - -2:[[2, 1], [2, 1], [2, 1], [2, 1]] -3:[[15, 1]] -5:[[2, 1], [2, 1]] -7:[[2, 1]] -11:[[2, 1]] -13:[[15, 1]] -17:[[2, 1]] -19:[[10, 1], [5, 1]] -23:[[2, 1]] -29:[[2, 1]] -31:[[15, 1]] -37:[[15, 1], [3, 1]] -[Vecsmall([6, 3, 2, 5, 4, 1]), [[[Vecsmall([6, 3, 2, 5, 4, 1])], Vecsmall([2 -])]]] -[[[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7]), Vecsmall([3, 4, 1, 2, 7, 8, 5, 6]), V -ecsmall([5, 6, 7, 8, 1, 2, 3, 4])], Vecsmall([2, 2, 2])], [[Vecsmall([2, 1, -4, 3, 6, 5, 8, 7]), Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2, 2])], -[[Vecsmall([2, 1, 4, 3, 6, 5, 8, 7]), Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], V -ecsmall([2, 2])], [[Vecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2])], [[V -ecsmall([3, 4, 1, 2, 7, 8, 5, 6])], Vecsmall([2])]] -[[[Vecsmall([7, 1, 5, 3, 6, 4, 8, 2]), Vecsmall([3, 5, 8, 2, 7, 1, 4, 6])], -Vecsmall([4, 2])], [[Vecsmall([7, 1, 5, 3, 6, 4, 8, 2])], Vecsmall([4])]] - -""" diff --git a/tests/unittests/polred.py b/tests/unittests/polred.py deleted file mode 100644 index e6a5a44..0000000 --- a/tests/unittests/polred.py +++ /dev/null @@ -1,289 +0,0 @@ -# -*- coding: utf-8 -*- -# Created 09/26/2017 - -"""Original pari/GP test file polred : -rnfpolredbest(nfinit(quadpoly(5,y)),x^7-14*x^5+56*x^3-56*x+22) -\\ rnfpolred(nfinit(quadpoly(1996,y)),quadray(1996,1)) -\\ rnfpolred(nfinit(quadpoly(904,y)),quadray(904,1)) -K=nfinit(quadpoly(29,y)); T=quadray(29,17) -rnfpolredabs(K,T) -rnfpolredbest(K,T) -rnfpolredabs(K,[T,100],16) -rnfpolredbest(K,[T,100]) -K=nfinit(y^3-y-1); T=x^3-x-1; -rnfpolredabs(K,T) -rnfpolredabs(K,T,2) -[P,a]=rnfpolredbest(K,T,1); -subst(K.pol,y,a) -[P,a,b]=rnfpolredbest(K,T,3); -subst(K.pol,y,a) -substvec(T,[x,y],[a,b]) -rnfpolred(nfinit(quadpoly(1129,y)),quadray(1129,1)); - -nfinit(Pol([256,-2560,5120,6400,-60320,6976,116320,72560,-456615,270630,-129362])); -polredabs(quadpoly(14586217464)) -{ -p=x^32 - 1680*x^30 + 1026480*x^28 - 289096080*x^26 + 39933334980*x^24 - -2715474610800*x^22 + 88886222283600*x^20 - 1619990314513200*x^18 + -17928141864081750*x^16 - 125620995771054000*x^14 + 565267786831818000*x^12 - -1629524362237758000*x^10 + 2978275448322310500*x^8 - 3393290168363970000*x^6 + -2319247705779270000*x^4 - 866101453967610000*x^2 + 135345425000900625; -#polredabs(p,4) -} -polredabs(x^12+139968*x^10+24814646784*x^8+1854249948463104*x^6+177954917169813848064*x^4-1827912356210202139164672*x^2+68504919608701082757419237376); -polredabs(x^4+10^21*x^2+1) -polredabs(x^4+146077*x^2+2629386) -\\#1146 -polredabs(x^9-4*x^7-3*x^6+9*x^5+8*x^4-6*x^3-9*x^2-4*x-1) -\\#1228 -polredabs(x^5-13*x^3+3*x^2+5*x-1) -\\#1229 -polredabs(x^6+21471450*x^2+71643071500) -polredbest(x^6+21471450*x^2+71643071500) -polredbest(4*x^4+146077*x^2+2629386) - -polredabs(2*x+1) -polredabs(2*x+1,1) -polred([x,[1]]) -polred(2*x+1) -polred(2*x+1,1) -polred(4*x^2+1,2) -polredbest(2*x+1) -polredbest(2*x+1,1) -polredbest(4*x^2+1,1) -polredord(2*x+1) -polredord(4*x^2+1) -\\ #1519, test T->unscale != 1 -polredbest(x^8+24*x^6+80*x^5+1040*x^4-4288*x^3-12736*x^2-61952*x+311296,1) -\\ #1511 -polredabs(x^16-4*x^15-334*x^14+264*x^13+32231*x^12+57392*x^11-1031422*x^10-3628868*x^9+7185297*x^8+42417784*x^7+11283472*x^6-137773504*x^5-127243504*x^4+69059728*x^3+56307944*x^2-6264432*x+6436) -\\ #1653 -default(parisize, 3<<23); -f=x^40+10*x^39+75*x^38+410*x^37+1888*x^36+7364*x^35+25310*x^34+77140*x^33+211669*x^32+524946*x^31+1183823*x^30+2430610*x^29+4548530*x^28+7743916*x^27+11954920*x^26+16627228*x^25+20626386*x^24+22445616*x^23+20835590*x^22+15611648*x^21+8209812*x^20+1290846*x^19-2562740*x^18-2525172*x^17-76374*x^16+2095346*x^15+2320830*x^14+1050748*x^13-71120*x^12-238080*x^11+31952*x^10+106808*x^9+12549*x^8-18470*x^7-485*x^6+3202*x^5-232*x^4-430*x^3+150*x^2-20*x+1; -polredbest(f); -polredabs(x^5 - 331137220*x^4 + 37922047405356360*x^3 - 1127174691845938128093840*x^2 + 52208293424667465123438066822480*x - 16507431553557006099641796204889368224) - -f=5*x^12+13*x^4+11*x^3+2*x+1; -[g,h] = polredabs(f,1); [g,subst(f,x,h)] -""" -import unittest -from cypari2 import Pari, PariError - -pari = Pari() - - -class TestPolred(unittest.TestCase): - def test_polred(self): - y = pari('y') - x = pari('x') - self.assertEquals( - pari.rnfpolredbest(pari.nfinit(pari.quadpoly(5, y)), x ** 7 - 14 * x ** 5 + 56 * x ** 3 - 56 * x + 22), - 'x^7 + Mod(7*y, y^2 - y - 1)*x^6 + Mod(21*y + 7, y^2 - y - 1)*x^5 + 35*x^4 + Mod(-35*y - ' + - '14, y^2 - y - 1)*x^3 + Mod(-7*y - 77, y^2 - y - 1)*x^2 + Mod(14*y + 7, y^2 - y - 1)*x + ' + - 'Mod(-y + 44, y^2 - y - 1)') - # \\ pari.rnfpolred(pari.nfinit(pari.quadpoly(1996,y)),pari.quadray(1996,1)) - # \\ pari.rnfpolred(pari.nfinit(pari.quadpoly(904,y)),pari.quadray(904,1)) - K = pari.nfinit(pari.quadpoly(29, y)); - T = pari.quadray(29, 17) - self.assertEquals(T, - 'x^8 + Mod(-5265231366756*y - 11544453645457, y^2 - y - 7)*x^7 + Mod(28411458541660742678' + - '6*y + 622944640581258439174, y^2 - y - 7)*x^6 + Mod(-88698486784831757442657946*y - 1944' + - '78741347464554095950854, y^2 - y - 7)*x^5 + Mod(1457861838374320941446687517087*y + 3196' + - '482213651741289611519839129, y^2 - y - 7)*x^4 + Mod(-3466536016262523445329224834043387*' + - 'y - 7600665870589330277066596588522840, y^2 - y - 7)*x^3 + Mod(5000592518487564664208359' + - '83321373618*y + 1096421116344588264250099626740668170, y^2 - y - 7)*x^2 + Mod(-191620894' + - '46215341153510282273347908836*y - 42014460135353505823787366140454468112, y^2 - y - 7)*x' + - ' + Mod(100691810991091652032034511974871062155*y + 2207750929623871787473021021190225896' + - '88, y^2 - y - 7)') - self.assertEquals(pari.rnfpolredabs(K, T), - 'x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mod(-385*y - 2' + - '51, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod(-2451*y - 3350, y^2 - y ' + - '- 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod(-2050*y - 3861, y^2 - y - 7)*x + Mo' + - 'd(565*y + 1331, y^2 - y - 7)') - self.assertEquals(pari.rnfpolredbest(K, T), - 'x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mod(-385*y - 2' + - '51, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod(-2451*y - 3350, y^2 - y ' + - '- 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod(-2050*y - 3861, y^2 - y - 7)*x + Mo' + - 'd(565*y + 1331, y^2 - y - 7)') - self.assertEquals(pari.rnfpolredabs(K, [T, 100], 16), - 'x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mod(-385*y - 2' + - '51, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod(-2451*y - 3350, y^2 - y ' + - '- 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod(-2050*y - 3861, y^2 - y - 7)*x + Mo' + - 'd(565*y + 1331, y^2 - y - 7)') - self.assertEquals(pari.rnfpolredbest(K, [T, 100]), - 'x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mod(-385*y - 2' + - '51, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod(-2451*y - 3350, y^2 - y ' + - '- 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod(-2050*y - 3861, y^2 - y - 7)*x + Mo' + - 'd(565*y + 1331, y^2 - y - 7)') - K = pari.nfinit(y ** 3 - y - 1); - T = x ** 3 - x - 1; - self.assertEquals(pari.rnfpolredabs(K, T), - 'x^3 + Mod(y^2 - 2, y^3 - y - 1)*x^2 + Mod(-y + 1, y^3 - y - 1)*x + Mod(y - 1, y^3 - y - ' + - '1)') - self.assertEquals(pari.rnfpolredabs(K, T, 2), - 'x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1') - [P, a] = pari.rnfpolredbest(K, T, 1); - self.assertEquals(pari.subst(K[0], y, a), - 'Mod(0, x^3 + Mod(y^2 - y - 2, y^3 - y - 1)*x^2 + Mod(-y^2 + y + 1, y^3 - y - 1)*x + Mod(' + - 'y^2, y^3 - y - 1))') - [P, a, b] = pari.rnfpolredbest(K, T, 3); - self.assertEquals(pari.subst(K[0], y, a), - 'Mod(0, x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1)') - self.assertEquals(pari.substvec(T, [x, y], [a, b]), - 'Mod(0, x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1)') - pari.rnfpolred(pari.nfinit(pari.quadpoly(1129, y)), pari.quadray(1129, 1)); - - pari.nfinit(pari.Pol([256, -2560, 5120, 6400, -60320, 6976, 116320, 72560, -456615, 270630, -129362])); - self.assertEquals(pari.polredabs(pari.quadpoly(14586217464)), 'x^2 - 3646554366') - p = x ** 32 - 1680 * x ** 30 + 1026480 * x ** 28 - 289096080 * x ** 26 + 39933334980 * x ** 24 - \ - 2715474610800 * x ** 22 + 88886222283600 * x ** 20 - 1619990314513200 * x ** 18 + 17928141864081750 * x \ - ** 16 - 125620995771054000 * x ** 14 + 565267786831818000 * x ** 12 - 1629524362237758000 * x ** 10 + \ - 2978275448322310500 * x ** 8 - 3393290168363970000 * x ** 6 + 2319247705779270000 * x ** 4 - \ - 866101453967610000 * x ** 2 + 135345425000900625; - self.assertEquals(len(pari.polredabs(p,4)), 304) - pari.polredabs( - x ** 12 + 139968 * x ** 10 + 24814646784 * x ** 8 + 1854249948463104 * x ** 6 + 177954917169813848064 * x - ** 4 - 1827912356210202139164672 * x ** 2 + 68504919608701082757419237376); - self.assertEquals(pari.polredabs(x ** 4 + 10 ** 21 * x ** 2 + 1), 'x^4 + 1000000000000000000000*x^2 + 1') - self.assertEquals(pari.polredabs(x ** 4 + 146077 * x ** 2 + 2629386), 'x^4 + 146077*x^2 + 2629386') - # #1146 - self.assertEquals(pari.polredabs( - x ** 9 - 4 * x ** 7 - 3 * x ** 6 + 9 * x ** 5 + 8 * x ** 4 - 6 * x ** 3 - 9 * x ** 2 - 4 * x - 1), - 'x^9 - 4*x^7 - 3*x^6 + 9*x^5 + 8*x^4 - 6*x^3 - 9*x^2 - 4*x - 1') - # #1228 - self.assertEquals(pari.polredabs(x ** 5 - 13 * x ** 3 + 3 * x ** 2 + 5 * x - 1), - 'x^5 - 13*x^3 - 3*x^2 + 5*x + 1') - # #1229 - self.assertEquals(pari.polredabs(x ** 6 + 21471450 * x ** 2 + 71643071500), 'x^6 + 21471450*x^2 + 71643071500') - self.assertEquals(pari.polredbest(x ** 6 + 21471450 * x ** 2 + 71643071500), - 'x^6 - 12*x^4 - 24*x^3 + 21651666*x^2 - 257657256*x + 71814482884') - self.assertEquals(pari.polredbest(4 * x ** 4 + 146077 * x ** 2 + 2629386), 'x^4 + 146077*x^2 + 10517544') - - self.assertEquals(pari.polredabs(2 * x + 1), 'x') - self.assertEquals(pari.polredabs(2 * x + 1, 1), '[x, Mod(-1/2, x)]') - with self.assertRaises(PariError) as context: - pari.polred([x, [1]]) - self.assertTrue('domain error in gvaluation: p = 1' in str(context.exception)) - self.assertEquals(pari.polred(2 * x + 1), '[x - 1]') - self.assertEquals(pari.polred(2 * x + 1, 1), '[x - 1]') - self.assertEquals(pari.polred(4 * x ** 2 + 1, 2), '[1, x-1; 2*x, x^2+1]') - self.assertEquals(pari.polredbest(2 * x + 1), 'x + 1') - self.assertEquals(pari.polredbest(2 * x + 1, 1), '[x + 1, Mod(-1/2, x + 1)]') - self.assertEquals(pari.polredbest(4 * x ** 2 + 1, 1), '[x^2 + 1, Mod(1/2*x, x^2 + 1)]') - self.assertEquals(pari.polredord(2 * x + 1), '[2*x + 1]') - self.assertEquals(pari.polredord(4 * x ** 2 + 1), '[x - 1, x^2 + 1]') - # len(1519), test T->unscale != 1 - self.assertEquals(pari.polredbest( - x ** 8 + 24 * x ** 6 + 80 * x ** 5 + 1040 * x ** 4 - 4288 * x ** 3 - 12736 * x ** 2 - 61952 * x + 311296, - 1), - '[x^8 - 4*x^7 + 24*x^6 - 58*x^5 + 126*x^4 - 160*x^3 + 160*x^2 - 89*x + 26, Mod(-68/135*x^' + - '7 + 208/135*x^6 - 1378/135*x^5 + 56/3*x^4 - 194/5*x^3 + 4976/135*x^2 - 4492/135*x + 1856' + - '/135, x^8 - 4*x^7 + 24*x^6 - 58*x^5 + 126*x^4 - 160*x^3 + 160*x^2 - 89*x + 26)]') - # #1511 - self.assertEquals(pari.polredabs( - x ** 16 - 4 * x ** 15 - 334 * x ** 14 + 264 * x ** 13 + 32231 * x ** 12 + 57392 * x ** 11 - 1031422 * x - ** 10 - 3628868 * x ** 9 + 7185297 * x ** 8 + 42417784 * x ** 7 + 11283472 * x ** 6 - 137773504 * x ** 5 - - 127243504 * x ** 4 + 69059728 * x ** 3 + 56307944 * x ** 2 - 6264432 * x + 6436), - 'x^16 - 4*x^15 - 334*x^14 + 264*x^13 + 32231*x^12 + 57392*x^11 - 1031422*x^10 - 3628868*x' + - '^9 + 7185297*x^8 + 42417784*x^7 + 11283472*x^6 - 137773504*x^5 - 127243504*x^4 + 6905972' + - '8*x^3 + 56307944*x^2 - 6264432*x + 6436') - # #1653 - # pari.default(parisize, 3 << 23); - f = x ** 40 + 10 * x ** 39 + 75 * x ** 38 + 410 * x ** 37 + 1888 * x ** 36 + 7364 * x ** 35 + 25310 * x ** 34 \ - + 77140 * x ** 33 + 211669 * x ** 32 + 524946 * x ** 31 + 1183823 * x ** 30 + 2430610 * x ** 29 + 4548530 \ - * x ** \ - 28 + \ - 7743916 * x ** 27 + 11954920 * x ** 26 + 16627228 * x ** 25 + 20626386 * x ** 24 + 22445616 * x ** 23 + \ - 20835590 * x ** 22 + 15611648 * x ** 21 + 8209812 * x ** 20 + 1290846 * x ** 19 - 2562740 * x ** 18 - \ - 2525172 * x ** 17 - 76374 * x ** 16 + 2095346 * x ** 15 + 2320830 * x ** 14 + 1050748 * x ** 13 - 71120 * \ - x ** 12 \ - - 238080 * x ** 11 + 31952 * x ** 10 + 106808 * x ** 9 + 12549 * x ** 8 - 18470 * x ** 7 - 485 * x ** 6 + \ - 3202 * x ** 5 - 232 * x ** 4 - 430 * x ** 3 + 150 * x ** 2 - 20 * x + 1; - pari.polredbest(f); - self.assertEquals(pari.polredabs( - x ** 5 - 331137220 * x ** 4 + 37922047405356360 * x ** 3 - 1127174691845938128093840 * x ** 2 + - 52208293424667465123438066822480 * x - 16507431553557006099641796204889368224), 'x^5 + 5*x - 1') - - f = 5 * x ** 12 + 13 * x ** 4 + 11 * x ** 3 + 2 * x + 1; - [g, h] = pari.polredabs(f, 1); - self.assertEquals(g, 'x^12 - 2*x^11 - 11*x^9 + 13*x^8 + 5') - self.assertEquals(pari.subst(f, x, h), 'Mod(0, x^12 - 2*x^11 - 11*x^9 + 13*x^8 + 5)') - -"""**** Original expected results **** - -x^7 + Mod(7*y, y^2 - y - 1)*x^6 + Mod(21*y + 7, y^2 - y - 1)*x^5 + 35*x^4 + -Mod(-35*y - 14, y^2 - y - 1)*x^3 + Mod(-7*y - 77, y^2 - y - 1)*x^2 + Mod(14* -y + 7, y^2 - y - 1)*x + Mod(-y + 44, y^2 - y - 1) -x^8 + Mod(-5265231366756*y - 11544453645457, y^2 - y - 7)*x^7 + Mod(28411458 -5416607426786*y + 622944640581258439174, y^2 - y - 7)*x^6 + Mod(-88698486784 -831757442657946*y - 194478741347464554095950854, y^2 - y - 7)*x^5 + Mod(1457 -861838374320941446687517087*y + 3196482213651741289611519839129, y^2 - y - 7 -)*x^4 + Mod(-3466536016262523445329224834043387*y - 760066587058933027706659 -6588522840, y^2 - y - 7)*x^3 + Mod(500059251848756466420835983321373618*y + -1096421116344588264250099626740668170, y^2 - y - 7)*x^2 + Mod(-1916208944621 -5341153510282273347908836*y - 42014460135353505823787366140454468112, y^2 - -y - 7)*x + Mod(100691810991091652032034511974871062155*y + 22077509296238717 -8747302102119022589688, y^2 - y - 7) -x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mo -d(-385*y - 251, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod( --2451*y - 3350, y^2 - y - 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod -(-2050*y - 3861, y^2 - y - 7)*x + Mod(565*y + 1331, y^2 - y - 7) -x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mo -d(-385*y - 251, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod( --2451*y - 3350, y^2 - y - 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod -(-2050*y - 3861, y^2 - y - 7)*x + Mod(565*y + 1331, y^2 - y - 7) -x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mo -d(-385*y - 251, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod( --2451*y - 3350, y^2 - y - 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod -(-2050*y - 3861, y^2 - y - 7)*x + Mod(565*y + 1331, y^2 - y - 7) -x^8 + Mod(-8*y + 1, y^2 - y - 7)*x^7 + Mod(21*y + 189, y^2 - y - 7)*x^6 + Mo -d(-385*y - 251, y^2 - y - 7)*x^5 + Mod(695*y + 2955, y^2 - y - 7)*x^4 + Mod( --2451*y - 3350, y^2 - y - 7)*x^3 + Mod(2402*y + 6871, y^2 - y - 7)*x^2 + Mod -(-2050*y - 3861, y^2 - y - 7)*x + Mod(565*y + 1331, y^2 - y - 7) -x^3 + Mod(y^2 - 2, y^3 - y - 1)*x^2 + Mod(-y + 1, y^3 - y - 1)*x + Mod(y - 1 -, y^3 - y - 1) -x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1 -Mod(0, x^3 + Mod(y^2 - y - 2, y^3 - y - 1)*x^2 + Mod(-y^2 + y + 1, y^3 - y - - 1)*x + Mod(y^2, y^3 - y - 1)) -Mod(0, x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1) -Mod(0, x^9 - 4*x^8 + 8*x^7 - 9*x^6 + 7*x^5 - 3*x^4 - x^3 + 4*x^2 - 3*x + 1) - *** nfinit: Warning: non-monic polynomial. Result of the form [nf,c]. -x^2 - 3646554366 -304 -x^4 + 1000000000000000000000*x^2 + 1 -x^4 + 146077*x^2 + 2629386 -x^9 - 4*x^7 - 3*x^6 + 9*x^5 + 8*x^4 - 6*x^3 - 9*x^2 - 4*x - 1 -x^5 - 13*x^3 - 3*x^2 + 5*x + 1 -x^6 + 21471450*x^2 + 71643071500 -x^6 - 12*x^4 - 24*x^3 + 21651666*x^2 - 257657256*x + 71814482884 -x^4 + 146077*x^2 + 10517544 -x -[x, Mod(-1/2, x)] - *** at top-level: polred([x,[1]]) - *** ^--------------- - *** polred: domain error in gvaluation: p = 1 -[x - 1] -[x - 1] - -[ 1 x - 1] - -[2*x x^2 + 1] - -x + 1 -[x + 1, Mod(-1/2, x + 1)] -[x^2 + 1, Mod(1/2*x, x^2 + 1)] -[2*x + 1] -[x - 1, x^2 + 1] -[x^8 - 4*x^7 + 24*x^6 - 58*x^5 + 126*x^4 - 160*x^3 + 160*x^2 - 89*x + 26, Mo -d(-68/135*x^7 + 208/135*x^6 - 1378/135*x^5 + 56/3*x^4 - 194/5*x^3 + 4976/135 -*x^2 - 4492/135*x + 1856/135, x^8 - 4*x^7 + 24*x^6 - 58*x^5 + 126*x^4 - 160* -x^3 + 160*x^2 - 89*x + 26)] -x^16 - 4*x^15 - 334*x^14 + 264*x^13 + 32231*x^12 + 57392*x^11 - 1031422*x^10 - - 3628868*x^9 + 7185297*x^8 + 42417784*x^7 + 11283472*x^6 - 137773504*x^5 - - 127243504*x^4 + 69059728*x^3 + 56307944*x^2 - 6264432*x + 6436 - *** Warning: new stack size = 25165824 (24.000 Mbytes). -x^5 + 5*x - 1 -[x^12 - 2*x^11 - 11*x^9 + 13*x^8 + 5, Mod(0, x^12 - 2*x^11 - 11*x^9 + 13*x^8 - + 5)] - -""" diff --git a/tests/unittests/polylog.py b/tests/unittests/polylog.py deleted file mode 100644 index 7b3143c..0000000 --- a/tests/unittests/polylog.py +++ /dev/null @@ -1,95 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 - -"""Original pari/GP test file polylog : -default(realprecision,38); -polylog(3,0.9) -polylog(2,3.9) -polylog(3,3.9) -polylog(2,Mod(x,x^2+1)) -polylog(2,[0.5,0.6]) -polylog(2,x+O(x^5)) -polylog(2,1/2+x+O(x^5)) -dilog(-4) -polylog(2,1+I,1) -polylog(1,2,3) -localbitprec(320);bitprecision(dilog(2.0)) - -\\errors -polylog(3,2,5) -polylog(2,Mod(1,2),0) -polylog(3,"",0) -""" -import unittest -from cypari2 import Pari, PariError - -pari = Pari() - - -class TestPolylog(unittest.TestCase): - def test_polylog(self): - pari.set_real_precision(38) - self.assertEquals(str(pari.polylog(3, '0.9')), '1.0496589501864398696458324932101000704') - self.assertEquals(str(pari.polylog(2, '3.9')), '2.0886953792151632708518141489041442185 - 4.275633941038' + - '7621770489264556951963565*I') - self.assertEquals(str(pari.polylog(3, '3.9')), '4.3226178452644705784020044544722613393 - 2.909518771772' + - '2594640746948896647103179*I') - self.assertEquals(str(pari.polylog(2, pari.Mod('x', 'x^2+1'), precision=128)), '[-0.20561675835602830455905189583075314' + - '866 - 0.91596559417721901505460351493238411074*I, -0.20561675835602830455905189583075' + - '314866 + 0.91596559417721901505460351493238411074*I]~') - self.assertEquals(str(pari.polylog(2, ['0.5', '0.6'])), '[0.58224052646501250590265632015968010874, 0.72' + - '758630771633338951353629684048110789]') - self.assertEquals(str(pari.polylog(2, 'x+O(x^5)')), 'x + 1/4*x^2 + 1/9*x^3 + 1/16*x^4 + O(x^5)') - self.assertEquals(str(pari.polylog(2, '1/2 + x + O(x^5)', precision=128)), '0.58224052646501250590265632015968010874 + ' + - '1.3862943611198906188344642429163531362*x + 0.61370563888010938116553575708364686385*' + - 'x^2 + 0.51505914815985415844595232388847084820*x^3 + 0.560744611093552095664404847500' + - '62706103*x^4 + O(x^5)') - self.assertEquals(str(pari.dilog(-4, precision=128)), '-2.3699397969983658319855374253503230488') - self.assertEquals(str(pari.polylog(2, '1+I', 1, precision=128)), '0.91596559417721901505460351493238411077') - self.assertEquals(str(pari.polylog(1, 2, 3, precision=128)), '0.34657359027997265470861606072908828404') - pari.set_real_precision_bits(320); - self.assertEquals(pari.bitprecision(pari.dilog('2.0')), '320') - def test_polylog_error_cases(self): - with self.assertRaises(PariError) as context: - pari.polylog(3, 2, 5) - self.assertTrue('invalid flag in polylog' in str(context.exception)) - with self.assertRaises(PariError) as context: - pari.polylog(2, pari.Mod(1, 2), 0) - self.assertTrue('sorry, padic polylogarithm is not yet implemented' in str(context.exception)) - with self.assertRaises(PariError) as context: - pari.polylog(3, '""', 0) - self.assertTrue('incorrect type in gpolylog (t_STR)' in str(context.exception)) - -"""**** Original expected results **** - -1.0496589501864398696458324932101000704 -2.0886953792151632708518141489041442185 - 4.27563394103876217704892645569519 -63565*I -4.3226178452644705784020044544722613393 - 2.90951877177225946407469488966471 -03179*I -[-0.20561675835602830455905189583075314866 - 0.91596559417721901505460351493 -238411074*I, -0.20561675835602830455905189583075314866 + 0.91596559417721901 -505460351493238411074*I]~ -[0.58224052646501250590265632015968010874, 0.7275863077163333895135362968404 -8110789] -x + 1/4*x^2 + 1/9*x^3 + 1/16*x^4 + O(x^5) -0.58224052646501250590265632015968010874 + 1.3862943611198906188344642429163 -531362*x + 0.61370563888010938116553575708364686385*x^2 + 0.5150591481598541 -5844595232388847084820*x^3 + 0.56074461109355209566440484750062706103*x^4 + -O(x^5) --2.3699397969983658319855374253503230488 -0.91596559417721901505460351493238411077 -0.34657359027997265470861606072908828404 -320 - *** at top-level: polylog(3,2,5) - *** ^-------------- - *** polylog: invalid flag in polylog. - *** at top-level: polylog(2,Mod(1,2),0 - *** ^-------------------- - *** polylog: sorry, padic polylogarithm is not yet implemented. - *** at top-level: polylog(3,"",0) - *** ^--------------- - *** polylog: incorrect type in gpolylog (t_STR). - -""" diff --git a/tests/unittests/quadray.py b/tests/unittests/quadray.py deleted file mode 100644 index 2a02632..0000000 --- a/tests/unittests/quadray.py +++ /dev/null @@ -1,2219 +0,0 @@ -# -*- coding: utf-8 -*- -# Created 09/26/2017 - -"""Original pari/GP test file quadray : -default(realprecision,38); -\\ all quad imaginary whose class group has exponent 2 -v=[-15,-35,-51,-91,-115,-123,-187,-195,-235,-267,-403,-427,-435,-483,-555,-595,-627,-715,-795,-1155,-1435,-1995, --3003,-3315,-20,-24,-40,-52,-84,-88,-120,-132,-148,-168,-228,-232,-280,-312,-340,-372,-408,-420,-520,-532,-660,-708, --760,-840,-1012,-1092,-1320,-1380,-1428,-1540,-1848,-5460]; -for(i=1, #v, print(v[i]": "quadhilbert(v[i]))) - -quadhilbert(-4036) -quadhilbert(-300003) -quadhilbert(-3628843) - -Q(D,f) = lift(quadray(D,f)); -Q(-4,31) -Q(-11,2) -Q(-15,3) -Q(-179,2) -Q(-2276,2) -Q(-251,2) -Q(-35,2) -Q(-4,31) -Q(-51,3) -Q(8-48*3,2) -Q(1-48*3,3) -Q(1-48*3,4) -Q(40-48*3,6) -Q(-7,7) - -K = bnfinit(y^2+5); -P5=idealprimedec(K,5)[1]; -Q(K,P5) - -K = bnfinit(y^2+5*12); -P2=idealprimedec(K,2)[1]; -P5=idealprimedec(K,5)[1]; -Q(K,idealmul(K,P2,P5)) - -\\#1633 -quadray(-11,3) -""" -import unittest -from cypari2 import Pari, PariError - -pari = Pari() - - -class TestQuadray(unittest.TestCase): - - def setUp(self): - pari.set_real_precision(38) - - def tearDown(self): - pari.set_real_precision(15) - - def test_quadhilbert(self): - # all quad imaginary whose class group has exponent 2 - v = [-15, -35, -51, -91, -115, -123, -187, -195, -235, -267, -403, -427, -435, -483, -555, -595, -627, -715, - -795, -1155, -1435, -1995, -3003, -3315, -20, -24, -40, -52, -84, -88, -120, -132, -148, -168, -228, -232, - -280, -312, -340, -372, -408, -420, -520, -532, -660, -708, -760, -840, -1012, -1092, -1320, -1380, -1428, - -1540, -1848, -5460]; - - res = ['-15: x^2 - x + 1', '-35: x^2 - x - 1', '-51: x^2 - x + 1', '-91: x^2 - x + 2', '-115: x^2 - x - 1', - '-123: x^2 - x + 1', '-187: x^2 - x + 3', '-195: x^4 - x^3 + 2*x^2 + x + 1', '-235: x^2 - x - 1', - '-267: x^2 - x + 1', '-403: x^2 - x - 3', '-427: x^2 - x + 2', '-435: x^4 - x^3 + 2*x^2 + x + 1', - '-483: x^4 - x^3 - x^2 - 2*x + 4', '-555: x^4 - x^3 + 2*x^2 + x + 1', - '-595: x^4 - x^3 + 5*x^2 + 2*x + 4', '-627: x^4 - x^3 - 2*x^2 - 3*x + 9', - '-715: x^4 - x^3 + 8*x^2 + 3*x + 9', '-795: x^4 - x^3 + 2*x^2 + x + 1', - '-1155: x^8 + 15*x^6 + 32*x^4 + 15*x^2 + 1', '-1435: x^4 - x^3 + 5*x^2 + 2*x + 4', - '-1995: x^8 + 15*x^6 + 32*x^4 + 15*x^2 + 1', '-3003: x^8 - 9*x^6 + 80*x^4 - 9*x^2 + 1', - '-3315: x^8 + 9*x^6 + 77*x^4 + 36*x^2 + 16', '-20: x^2 + 1', '-24: x^2 - 2', '-40: x^2 + 2', - '-52: x^2 + 1', '-84: x^4 - x^2 + 1', '-88: x^2 - 2', '-120: x^4 + 2*x^2 + 4', '-132: x^4 - x^2 + 1', - '-148: x^2 + 1', '-168: x^4 - 2*x^3 + x^2 + 6*x + 3', '-228: x^4 - x^2 + 1', '-232: x^2 + 2', - '-280: x^4 - 2*x^3 - 5*x^2 + 6*x - 1', '-312: x^4 + 2*x^2 + 4', '-340: x^4 + 3*x^2 + 1', - '-372: x^4 - x^2 + 1', '-408: x^4 + 2*x^2 + 4', '-420: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1', - '-520: x^4 + 6*x^2 + 4', '-532: x^4 - 3*x^2 + 4', '-660: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1', - '-708: x^4 - x^2 + 1', '-760: x^4 - 2*x^3 - 5*x^2 + 6*x - 1', - '-840: x^8 - 4*x^7 - 2*x^6 + 20*x^5 - 3*x^4 - 32*x^3 + 64*x^2 - 44*x + 19', '-1012: x^4 - 5*x^2 + 9', - '-1092: x^8 + 3*x^6 + 5*x^4 + 12*x^2 + 16', - '-1320: x^8 - 4*x^7 - 2*x^6 + 20*x^5 - 3*x^4 - 32*x^3 + 64*x^2 - 44*x + 19', - '-1380: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1', '-1428: x^8 + 3*x^6 + 5*x^4 + 12*x^2 + 16', - '-1540: x^8 - 4*x^7 + 20*x^6 - 46*x^5 + 93*x^4 - 114*x^3 + 92*x^2 - 42*x + 9', - '-1848: x^8 - 2*x^7 + 3*x^6 - 14*x^5 + 65*x^4 - 64*x^3 + 46*x^2 + 24*x + 4', - '-5460: x^16 + 9*x^14 + 44*x^12 + 261*x^10 + 1029*x^8 + 1044*x^6 + 704*x^4 + 576*x^2 + 256'] - - for i in range(0, len(v)): - self.assertEquals("%d: %s" % (v[i], str(pari.quadhilbert(v[i]))), res[i]) - - self.assertEquals(pari.quadhilbert(-4036), - 'x^20 + 27*x^19 + 601*x^18 - 4014*x^17 + 9878*x^16 - 12222*x^15 + 8299*x^14 + 513*x^13 - ' - '12221*x^12 + 18036*x^11 - 17652*x^10 + 18036*x^9 - 12221*x^8 + 513*x^7 + 8299*x^6 - ' - '12222*x^5 + 9878*x^4 - 4014*x^3 + 601*x^2 + 27*x + 1') - self.assertEquals(pari.quadhilbert(-300003), - 'x^88 - 40020669926358941160*x^87 + 24818793423306608856949584839454391158484*x^86 - ' - '451973748435231895940407803697160552367624*x^85 + ' - '121004331374769746054948634032289469332999202*x^84 + ' - '10059034519705811655247252004833057160111397504*x^83 + ' - '351284965440856373689297063590147136894509846260*x^82 + ' - '7076787287183022340559185242964779073439110772112*x^81 + ' - '74248642221523801590984436783829317747047323123243*x^80 + ' - '30166690492982121753760926852522076770892257842640*x^79 - ' - '8503049963424563714394067134889147531482230019127096*x^78 - ' - '6465786499366041070602916523486769538280412443510592*x^77 + ' - '4215064044607823828889410160434091263108115351306399268*x^76 + ' - '119525498598846149476451596656291689313170011135603889064*x^75 + ' - '2071860433925692542602963337465946582420808944831769026648*x^74 + ' - '27044235010859245155886182817332705345839764731121161439752*x^73 + ' - '285289444253762620585561596576563633155859094294552566693317*x^72 + ' - '2511360320483460798105377398519192324398612242438706127652544*x^71 + ' - '18767162620094934148004508464072766541604227783326918296860524*x^70 + ' - '120423236654140529086575067911655764408706511359484732574173280*x^69 + ' - '669881737151097381424117880193907743151768744395737304965311638*x^68 + ' - '3260304883724581257592451461949148632593587481718123636435123040*x^67 + ' - '14012181744323597034445628272252822116949974099153581386829916444*x^66 + ' - '53675674441854876609489208131197694348596313231643993076280314304*x^65 + ' - '184958607344821493362485971605260396892443743494472396759635803315*x^64 + ' - '578456213592452525292885126678569328965911834184953238551507495512*x^63 + ' - '1655681703347654445227821014576515450466671643615335188802513429760*x^62 + ' - '4368788406187872397696253062497812500894047454768846457782824580152*x^61 + ' - '10689014728609577470291601910791767817886254017900185293235705392064*x^60 + ' - '24343515731554312300763001600607496079487124511808873652848483412160*x^59 + ' - '51692913516558114572724264591367158576380942435990299052219843612304*x^58 + ' - '102299833075028113525891123945574251052215437006684583051817380710576*x^57 + ' - '188216797464058241448403558395102741401235865324690992824034126437157*x^56 + ' - '320604903257057655562250252261154391117300969466803557524988405580272*x^55 + ' - '502625712033018630870239698213303008551061011852403188260952091908532*x^54 + ' - '719344126023656757735145641575616692987264009491520118662670217955328*x^53 + ' - '928638160219283330700409020325566534550048821651703177989079236808666*x^52 + ' - '1060255920795694954480037612092276836813066528658822564102146651872808*x^51 + ' - '1030158921568551185533700012926850740762293883499745887488519869745108*x^50 + ' - '771562428494427189300153767022260995609490878443644218508155682351496*x^49 + ' - '273465978073331113489250648988966144580871198921998690911757680224167*x^48 - ' - '392300511978594197023702549831167038133623220261146198494006317061248*x^47 - ' - '1075315660772763567397744183394797701786847214693166357365831146616968*x^46 - ' - '1589451619928021606930471659130946568147974811578111348229080651241920*x^45 - ' - '1780728558455357793403089789263493950243261264268279117584476244784076*x^44 - ' - '1589451619928021606930471659130946568147974811578111348229080651241920*x^43 - ' - '1075315660772763567397744183394797701786847214693166357365831146616968*x^42 - ' - '392300511978594197023702549831167038133623220261146198494006317061248*x^41 + ' - '273465978073331113489250648988966144580871198921998690911757680224167*x^40 + ' - '771562428494427189300153767022260995609490878443644218508155682351496*x^39 + ' - '1030158921568551185533700012926850740762293883499745887488519869745108*x^38 + ' - '1060255920795694954480037612092276836813066528658822564102146651872808*x^37 + ' - '928638160219283330700409020325566534550048821651703177989079236808666*x^36 + ' - '719344126023656757735145641575616692987264009491520118662670217955328*x^35 + ' - '502625712033018630870239698213303008551061011852403188260952091908532*x^34 + ' - '320604903257057655562250252261154391117300969466803557524988405580272*x^33 + ' - '188216797464058241448403558395102741401235865324690992824034126437157*x^32 + ' - '102299833075028113525891123945574251052215437006684583051817380710576*x^31 + ' - '51692913516558114572724264591367158576380942435990299052219843612304*x^30 + ' - '24343515731554312300763001600607496079487124511808873652848483412160*x^29 + ' - '10689014728609577470291601910791767817886254017900185293235705392064*x^28 + ' - '4368788406187872397696253062497812500894047454768846457782824580152*x^27 + ' - '1655681703347654445227821014576515450466671643615335188802513429760*x^26 + ' - '578456213592452525292885126678569328965911834184953238551507495512*x^25 + ' - '184958607344821493362485971605260396892443743494472396759635803315*x^24 + ' - '53675674441854876609489208131197694348596313231643993076280314304*x^23 + ' - '14012181744323597034445628272252822116949974099153581386829916444*x^22 + ' - '3260304883724581257592451461949148632593587481718123636435123040*x^21 + ' - '669881737151097381424117880193907743151768744395737304965311638*x^20 + ' - '120423236654140529086575067911655764408706511359484732574173280*x^19 + ' - '18767162620094934148004508464072766541604227783326918296860524*x^18 + ' - '2511360320483460798105377398519192324398612242438706127652544*x^17 + ' - '285289444253762620585561596576563633155859094294552566693317*x^16 + ' - '27044235010859245155886182817332705345839764731121161439752*x^15 + ' - '2071860433925692542602963337465946582420808944831769026648*x^14 + ' - '119525498598846149476451596656291689313170011135603889064*x^13 + ' - '4215064044607823828889410160434091263108115351306399268*x^12 - ' - '6465786499366041070602916523486769538280412443510592*x^11 - ' - '8503049963424563714394067134889147531482230019127096*x^10 + ' - '30166690492982121753760926852522076770892257842640*x^9 + ' - '74248642221523801590984436783829317747047323123243*x^8 + ' - '7076787287183022340559185242964779073439110772112*x^7 + ' - '351284965440856373689297063590147136894509846260*x^6 + ' - '10059034519705811655247252004833057160111397504*x^5 + ' - '121004331374769746054948634032289469332999202*x^4 - ' - '451973748435231895940407803697160552367624*x^3 + ' - '24818793423306608856949584839454391158484*x^2 - 40020669926358941160*x + 1') - self.assertEquals(pari.quadhilbert(-3628843), - 'x^180 - 51943580593235209115083942712389400740668999369044471856895869572767632154790719' + - '027854950985687*x^179 + 2547067915519807589841747083394507454979001152704765378975382231' + - '0509943417124290253283094780925633779566003695241876256074642206756980781041312488539041' + - '15685519116107718359916443145223952387*x^178 + 85655320411540870157199561532055801425836' + - '8114267533599476048702248757890293199064738777403079498471755125850793975493242639458212' + - '28941841283820673569718022270291080598668993546776793532380154605306*x^177 + 76208050204' + - '9470459605610730457659988314295367866431312803463914686483313645385458348594743281778730' + - '9780316405557363093455779754923289560341458471739430940790778638046916838340664043983939' + - '99145427753183790*x^176 + 30895638763646696015321293816773247023116688803841722706690306' + - '4491469664464841619212321670236139534755552014956934619774127518218577390723469444090474' + - '70651675235147675440424833117756620892810879743135932320774*x^175 + 48840826629666655087' + - '6266596966764956978453838737444921031824468546499677022837850506165212536124471158220472' + - '9707795496142573176234783092771677458111505683044159569664292178132297884411168631004611' + - '840186992685967179*x^174 + 1240057512963777471437108925989820880369326742142684503704154' + - '2236588394867883751422682921563930587322023800866776334116548906703591687073852643697697' + - '71634896229758342146668333992396523446861599764973368284228647193399*x^173 + 77807342164' + - '2447925070552967910474570096831390766947550930281827860194252415153283906741350015821421' + - '7604880760978687846970230684361377176470035198102530788844464458277074023468487612291349' + - '8319164377230037354352780222249*x^172 - 266780829858115272388789250462200876445272313022' + - '9458822467054384295379499065005972497338635889603051515741573734931874924695776240830624' + - '574892617095865338408754338583352252844185648624921009766003486141241557823792412532*x^1' + - '71 + 14828387316468627026106844845255173547861518903858980498553897410830068279082086119' + - '1991101023068971076505863346789787263249012603070588113429175259599130772002329273816462' + - '4564498269365143236280388326494814603159167594322356*x^170 + 207271463025469452511301547' + - '0563866763470442289622005431908149562175074937534983815831470007001328441495857556306562' + - '9489929859046067396704298758192428085265010864076184580325469950195611900528695826173789' + - '8381117495750422003980*x^169 + 408279191365866825066950048755339668850856918564160819223' + - '9179402022231907134546562033748293990269539105395717958166111785640580545217576728755270' + - '122147606844109208571528880548539765523197876482624865506579220641586389147210551*x^168 ' + - '+ 25918908265304793393840999648343887547049043205616289992690167628330546413952017687984' + - '1374370584484171652371224698237130432347580881837999863417850984341421942163351457734024' + - '401203128996614247360365624068492442391061043753826375*x^167 + 1879533255028463945601845' + - '5766299939619922774191830896857155781644437858467387447729263235421421093239442057010359' + - '2891222145697906140096098002192358493430520998559970364061150923659276590113217049579865' + - '275822653265241753456459305677*x^166 - 9915213445331010597888861249891641758957210552260' + - '3788211580821293533752491951129117545101896722210096101308894624313777264446536224444928' + - '9299342835738733198847639642107862445603726950356560002044943147516502914989637844150139' + - '5456086*x^165 + 870693463207410936114722926699616258456056310070174066271951439226764821' + - '3754498248686363880077592953938815295745097173153881494887680426204688519814589792670887' + - '9854493196612672343274340176910775178567635481360192954408109761462192666*x^164 + 329126' + - '9524452623301119531480681600174871375032940729132937011163309205800336907034894612342659' + - '4086592059620504463833497832222752798945678653965532736640379616837610870910041078881143' + - '32138817034187287315453438080442501304279059153710266*x^163 - 48424697865100847085384804' + - '9302633937841710055009903257334888425404869825400256850368216570955809931099762277915963' + - '2947302543083592103973184476984040184063706178429518788857998006328077575074002632621344' + - '5261209232925320378956182578938287*x^162 + 236659655797827414747525596949802041692270215' + - '3951660811218931910650113398032807756856703811990539910072624737073791659677336884446347' + - '2189978353425224352092683872965220532855639893844358125373580233579396300331967493836532' + - '017339326648417*x^161 - 1786117002152727350652289985932216358955646217307235079098268964' + - '9038268799740362830643723969362443349590165531137151057640108919714216650854657781022747' + - '531810531359367179288752406620535700142801097476915172283884503644920276078920893715961*' + - 'x^160 + 54428865694162130728839491952070035616729751681833422007539166231352236561897735' + - '1536503454771579135051732246957859000664531476361357465221968827923591138659172463973059' + - '604218652821751160134239388400400287612441644522959559654240096950196384*x^159 - 1878459' + - '1944561923323443403812389538370992073242518317157665963817987346890603378811086853859511' + - '4584488231181453905560324154260960085054869261002833248663395080605671172589053299559751' + - '8093888779850319337022684143396368259434426190698508218580*x^158 - 184127686942437509991' + - '1682977301117955663562464265148547217904344728959181240974449884065092029207121963689896' + - '9097801966235466592457246648086083637230209961453625153292993135365454115585173733565794' + - '8991190630601809654864812836013412428233332508*x^157 + 627274533771428964278059773145144' + - '0214649776184728899306566105704002623998384634772568803482031749834965537790349722439019' + - '0783460776334008364647848917218509292774579507582801703470215614451182809842759120600950' + - '57054098527282956922223630676347544*x^156 - 13060449726788334974172743441897204816153610' + - '2040007979772040575444674674232960355098312210675279516213179933762412145661906540409844' + - '2047684342403483219640782130482104491066089970029539204229069505954201920366168890488132' + - '09519926849958791965413764*x^155 + 19392647894141536596820530391916502230151932745563014' + - '3663834027281436100078249122875790812671413557448312216090828906017332768865316251397616' + - '2542257999959114635645770848869066496229883200724281039999541182828857613242844117034223' + - '500903997780849964*x^154 - 2089740818515804351342583888534354748778120785097754268254968' + - '9561631642478447960323442191239518834708138540356262461766794170612666726815002322590819' + - '8816300820472000722481859827488891717051443056982529118511414369683957356587174149686533' + - '52018931248*x^153 + 16726466418820174491230008702941819854300761766363953593948968045530' + - '7948909314998339450215312030994224761215763294915115325960697513628674724029981734640823' + - '9753796627720037841404538619984615128342472905097168328653955912174273052746613900003371' + - '03156*x^152 - 11336714493365295420476716878286616778916616227898741966819659317216135015' + - '1363224665639827520548877905001507920274192410200096811676503284991805981968482979122155' + - '1667739765953276248859306767909175625527281202034750975189910458947747942582531447345892' + - '*x^151 + 9686019535728726397130721344019529061590234306774474243977568483913314292573821' + - '7830167297947427381690011105467748624943273307935251949965531278511638425579831074071240' + - '45733393614238847801073794953716312871037645627569348897599991117672316256550430096*x^15' + - '0 - 119041422102704367724958867098457501357876959518771350903901250601788826850635727322' + - '9685836102923546004288074231203712704038367025459784150851942453530296372505150600747245' + - '48258974287875801351389617602402488639578930420752407411968308213028222350043652*x^149 +' + - ' 139012312219226300551763729472511479283791955864842842045804673113892472659200893251349' + - '5230700512133349586477622659382430830580227004286576552217066462327575617168615769116046' + - '127120927944246516170867550604974904061166944942837594012909743669233042838778*x^148 - 1' + - '2355617672760404839249545405597763994014503311260818968588063469426319134171890936483322' + - '6610414204707108539398237402002063733385907199732687546442250415586621532467968769360415' + - '37325415712055287848699094590808089508684909536725801531454334504662219155298*x^147 + 78' + - '3388573214056722983337914730252820822685883998115176558789270644876608429607987213338588' + - '5377351843684550935440296918108559628783027245678129129584030825298526758499964573195767' + - '9014924167075059287317239791194977384286250565342370732550549861221973628014*x^146 - 337' + - '4295820526166964342476767733813903917055420548509812685321889562165936397719575630122778' + - '1033031405289508181701171026255806634894861047352747650017243235019037703269391120793396' + - '6365985588343500355068020592838333693543614719695933939552850201760137124456*x^145 + 126' + - '7022512449095517765635963857489440320956185849532448394191453064873093377283326533700392' + - '8417799194535821386624283453961529673399508105934582815314275613767863821942606944495384' + - '02376863382264434438107547454079981595409252310957914375045407870857103723132*x^144 - 15' + - '3719609646143637199240438779331521362833031099802285618952009014965538370060716502819704' + - '6414621578662674582267335714866655998331041679656464326243140403108570867049851413187917' + - '2395315308884725086995597751964859239544450069420287019254955379338574827976392*x^143 + ' + - '2752630473030549230951961180329787356710099537940382001402721757277246999726996317480093' + - '3499033033245674070755714623926429378341959406334701280151275325564888817651709058422638' + - '2448332343741276856590710765250075976268484026303268470337380600828996170962184046*x^142' + - ' - 3552309515782831333713946259135170281657716573143323431788455634749585422775719036317' + - '4499214513563023473509504110270823451072736365474101510708342773893392493005386523413398' + - '71040322822838485719858336476359261521139254885461283464480406069617193177086233150446*x' + - '^141 + 344658035549892464892757694547640229100351421351827480590692520449336404784117307' + - '4204168858308061107651714893324213121302115744578855158079577011771255876661225789242989' + - '6407970226952977125727065334346005607660813917854532265984271205078552129981020849945722' + - '662*x^140 - 2683737225161158395810730710084949190456447093682830001175926782807962713700' + - '0832711687386515408763301405334867356212670696857859739463338404796759488859624213038265' + - '8465725080645154791059956333436847011768914542767112707721040710586854450242752202162514' + - '502517912*x^139 + 1742444297891369493991077844263622734267621349666334184372478600323885' + - '9274274057411635646353155281298451648136704209002938845039923935043096379256494572178617' + - '7563429720654144039386133241554831725367065310144005542392522004164573773389413209463932' + - '3829473024157820*x^138 - 963039078892037951990470202746814269069659583041968061883126627' + - '3162745223389393610063433083213953579433149814915110781090875111324184920857033852183817' + - '9678717281819508263987198750195192482470099599676753469515874825778086427265666686153043' + - '22301287390305988300028*x^137 + 45744737624216083922286552321208151225120417276955454153' + - '6513601067533556875757151411210379160074536613917366414758841891936558857055575472010038' + - '0387991571208004231209540632005541320473220496426057337951511990255432188920461029857337' + - '1864198642424001195728006133182*x^136 - 186886057813652994911005666538436531742970264786' + - '5923884532083174762453088039579050264330873054622685850786797760199466038669915165632724' + - '2828342029961503563105432403558076696314924892635292347470913591761192303244237926059122' + - '9749107391665636207832174634098946284598*x^135 + 650930766688033291162528999671292641219' + - '5419508131658251738256220336229824442058592426074936635118330862929720868958836034224352' + - '2870910111386570744879615792041897647003539203014728725056852271334774934551704770874564' + - '5767806883427498415677547239236298519819304443846*x^134 - 188737857214948682414768736751' + - '1231259955360557324252646574814811972214651363818263080004881765201151009039934832304971' + - '7386130222854886605919808990597585617366670880266091842937662126151457793355558304191543' + - '21176614476225431341974175714575265820939899419742919508060*x^133 + 42953889394645520155' + - '7409655838948254975167613584775116826651538942451816286881091436166450578237021021126058' + - '7376408754507104013237607018922017023401049094197048725524392809860540776061068178741312' + - '168914092676961281988683451346980939322613643773108817289575967525206*x^132 - 6326172732' + - '8918865906350940397161109868277289808692349026207015730991196592142094811108152500708550' + - '7792610014228611379115265836635218591862448268530335248909968539052444135113205017957045' + - '2776530090912230189731431879125807895290459527651483474680605068851138729175634*x^131 - ' + - '1119917054839792275168890048605885705724336013260563577968638457421333926443835337621451' + - '6815220749891064364448374375377252006496924660040298690043694884815265937318132950430507' + - '8994688740647000779402755856689256783957036208034159102866400625978497921409668261262269' + - '2*x^130 + 427131422004946685256073833839324624512810532171083266005676807205793758031998' + - '1540501477952299826157540402130260426710231899734969840027495342743707520560577999976464' + - '4539342324945907217257015338807690270224780252688493775073451490812831750493851260007482' + - '523315136586*x^129 - 1480235901007106731418608864648162080286435090932830155336250065967' + - '6694697267415783980200503348765782212522356772330824651820513893406326947897903512259115' + - '9536438725785908614943188983682291413539553246441876994283071473752182291248178529493117' + - '079561875143739124185634*x^128 + 2461756416145658976796538485278045743286736401969417596' + - '6275458514450138575753439595259660114527770418601869322995580927692188758796260764328940' + - '7657987753382770716004973964128982846342663264119335560750008714258096212502569271025201' + - '095741906534219351860811124404494196*x^127 + 1990565893680671595442880060323376805411690' + - '8982420320234239133079106312028397798694740007864603898415855926572783576585034622967997' + - '5575446479539827712484639591071048813727255731760017261708300771575388890158591817638333' + - '201062459001177511936169630253047386566741135222*x^126 - 3016573234167548686525330843044' + - '1797191448447887193219597832133129727214089635223501342064521224438326191703259085520149' + - '6548201420356430642227248391186457171733887631493913310840727797524422777696065632512435' + - '5051502725255975073566061339620994099300340563608380613367050*x^125 + 125794814436296033' + - '3134666662231940352093525178726887316023131972692166583092196428964016422696026740138219' + - '5941050754678790203096370184903025817178707118551679807309549341318999724744130123636458' + - '246412550387700751891578989629129490134499746480541486417644003205338871882*x^124 - 3664' + - '7527126010505801731553608303394830636027063149652617096685333700696353823150401335975951' + - '7585684151976270223738380501428754257417253062108072762608015060889860062836269868824645' + - '9544729925465875848556894392587585369946240504832824795936818685295379822174025324728479' + - '2*x^123 + 847166740400182541685410295472670066112247306755245136353340233543806042517580' + - '5467559354137762254469896593139106830798735831123823275732509177781080628707431630216965' + - '5840667205157797595141889518050949723016737942549620483751941533243600758727975735045108' + - '792516939770864*x^122 - 1611469357174284617997847938011738534799737191324944707968337975' + - '1961340444008935754666780416238699732660665742711435647219232676062975775017270732119064' + - '5498819377245496716236524811771049606102487507016989267838733791065664530366349655384775' + - '511706599600386112512946557632*x^121 + 2522694849864480951479825412582961761101029175375' + - '0062990050323620295897587695065324670940000207944207812042399077482469097012869133985212' + - '6354595110186421998141347799854111539239085705015451817020704883026517132793698058647769' + - '011690212936405831828960609809154392310067086*x^120 - 3123954350950041465582224682058146' + - '6016766786100370771446195101114970617420873338985187231567399875364206176528467462373042' + - '9562551231647203516276142369010876697525206179883748370865834730988867057833796457914852' + - '097995716547367836013130298617785547855899873691057926811306*x^119 + 2609307345012843532' + - '2247521043157618871239206723903027929818592698185161383200388359536211219406343182592146' + - '9777713165902639697172972103293846309317995560069560008067067565135736757108179337687968' + - '541580428147949860084233825035556867616037181559579555206199159262851046258*x^118 - 5466' + - '2088841731030645691329700237358771258354132863645107344968862093509634579060272660594821' + - '9615697304857008627794014868256456846779843802852549787373412060095039379746983805031499' + - '6254429077961709963726138791862906553536781663415296571417609896418531671323802662549340' + - '*x^117 - 5018202172932723848612324641865970028936810684294735996033784923912076309299011' + - '5331307475563768776851277712661749540908097325081469303925458064884142328499816025881335' + - '3839212147718300729476653234198833090282154102884725904778754037483095258171403839074803' + - '113722901930619*x^116 + 1184061033368761585779174541867097405449294198484094378541103762' + - '3838485368610072441833481575794579330810980994347987985778741196393539613217121527222032' + - '6722407675369164351945267437588196190063225181878442213678933572194923238652257406338724' + - '9474397309298715042958501899245*x^115 - 176734272677759520180709847378647130652166835479' + - '0922710772327067981192822476939413912953115815829947318808933249885514336602487836197536' + - '9611127131928890515684844943744748937382837125994011164383657897820620204611774199772231' + - '48716322298719262705865767989172293892727336803*x^114 + 17753024853051994271617195180096' + - '5388948822797211110233322549229100349316200278964800334378539049137807103604832938442191' + - '8922891522117638503012421231548652255160959939943384670391834208434672810076000087641716' + - '214413857177876294347407269563098844605653811371200441716482612*x^113 - 6805580803942241' + - '5389652936779491502627000137416167108688643534238599366168143600213817710720422427390683' + - '2078455002177068865920164648302696976057624569611228684550845028525961920333227206075764' + - '665165228225992275397755618739608508043386038457848710886307936627814494090172*x^112 - 1' + - '7134585516899315397126185796595750959733583992327191799305914151591547485431128802404257' + - '5151000470170546561098255539115103462495893698791158298695666439760340532158299357619298' + - '1538366354538416065449072981604626649741228358475390951398611771434975819632467920927623' + - '648602*x^111 + 4755280354989431498567723580899120052471944522140383962676105128530062058' + - '7722433619265128807827867660253842829812945775112424974135372950240457723174510064115818' + - '0782938660497278340024396047755487444276112996589133828599729196840562852395386580009293' + - '3414124830547621130787*x^110 - 672428453981276033467643787358630417913935967603492325560' + - '3133878329081616256829860709938088561919816893627337618874976711707752413017492294772666' + - '8956608701940248392100508197963897501107885069331081963929674153546422780993129544541729' + - '43987260326378638622142759365186532673*x^109 + 55277967193070494108505087891929956655236' + - '8896876578268175977451438771610569912425740087266827286735858716699401268464277514456005' + - '1393232906738794805715412356740750890873873435323228244674952180988795091974844777831874' + - '994317609349719963129292674653332785827444869904448205*x^108 - 4161315914958260303700782' + - '1378021268206873842361757130321500129691291418451571447235232841374436360724745406285376' + - '5212695133675510221970937823367502714872526486917915543619099980370791896548285890991567' + - '929454475829428616802918715542674704594105656661109974298786084926216*x^107 - 6496855052' + - '0798695907403393041609584497177075677977387790836546826483076679272105467045939763911899' + - '8550485476554326886588603892066038792890904401145368943002404700917067207281102757826361' + - '3814365800831534860425823304346541483988808631718250457924535357455148087384017967480*x^' + - '106 + 1098870430388589282631528397531121024272278388444966028211338270018737204610302817' + - '4037252313156286126163656212719411476129738075670842090383242374345071869120294985233601' + - '2283553302430973984067783168941238662779103359925207129688403124462673408375334246270651' + - '23680989778324*x^105 - 10377690813223954987282809287979304216731816367846519432326529872' + - '0037037998871007531542818801529571100342530668243165130093328378888288095757828135898395' + - '4316998750686918822781402097384869911886550329315695833395559508114697511481921636949333' + - '4147767991300084429910831005417*x^104 + 698101866165819192934087787107108500858284600224' + - '7498545365034160553809386307776740323457684451079032740625501338477163577149719360331436' + - '8376111896927918312613660921244314336123841173727343108316374825964917374812406255193704' + - '15275231858412571456668503155908009579048097943*x^103 - 62618742936856051264116083169826' + - '9917762052785386210430790988069604384137878194361389699073225403863192706786752381073990' + - '4629809810678656127043145873535279223707645117591581849318483810783264428888878968101286' + - '898381392510682070079334990623735577742545874102235967038827767*x^102 + 8854771357713674' + - '7022744956480711506392268841458610902634308115200722800139381186371312709284888845303124' + - '9274119846056297769374759830206187529701190385641706923794555206972925920329373615467878' + - '5007420066778201855082685563641521979888163226986534911148352808279115809917358*x^101 - ' + - '4630158507380629238809331579153339113748480666810903470310745062885874214341010279973693' + - '3423690707497806772282673113820748775676920348192505254434973153766593145137560564910827' + - '8576436024400724045415341073044774340899126940121480972810775541169317239501263434110744' + - '8006498*x^100 - 198710643033628650225509663362197577826927493881160107853598678016947857' + - '1202782217427771679102488973287412379699901711653267226575231356112272871163670631271576' + - '7986161922405459911607294156345100185524317796050855692880590850929919374908662413690455' + - '670795224105490516738430*x^99 + 61161114864798684234619638515241969274900947726541371092' + - '8182024096556013358628686098937442753126225466775993244832015197487928804402237838654698' + - '1429567519154074102099915969249245522681842536878963413722812765223261014692404361511452' + - '9192462392320461821295874662972625510705*x^98 - 8585434072028582480876325305001979394403' + - '6802688174526254977465503397184149378268902368096758090513332370728027354524452052318746' + - '5238775079003930067906702538862010077151654142173689494119764321155798594114038476768325' + - '93424896146959490497405782950778627016658691250674749383*x^97 + 490657445429729269017920' + - '9687546883016620517611911217595219014813015157155188541123765870476789021829481317185682' + - '2346556428383215072814614042291152340886085128841976463982340477579191182175549956025163' + - '180298168574988817375881331870052016910321408923741313322367680681136483*x^96 + 58848035' + - '6039113348615320015128938548650997950279831325677040107085175877137589019325717560517114' + - '4175873327958813862484089151772708967824509071038232508873595271965775853620263242569539' + - '7040762304230638936597396706141037241892685559313526162149365318736429347633086308123732' + - '*x^95 - 17860801079269145558108858839465800861694899301727979464445269231194082523845268' + - '3644231985542836056355374630947740336929500805905936814782276246158348108920450307640490' + - '5279594814683042875309442804282180084144874679203484065337627335018821329076109362209930' + - '92559868115464848*x^94 + 208069889894993443875528674241467447097665069734682372239388187' + - '7584898564578710270984963067042166792938707718390759663409167550410773690988587940908229' + - '8810629516372158817839495918687295082228007905992804249154207283659484732476414136221785' + - '4738459946888011176892625701864148*x^93 - 8558642180093085759446360247311113597751122552' + - '0453134502272629591233109506642760602939655259317866169111674033411886153395302866756775' + - '2698318841217454487996891181376075586164380997562134304875334824868353460756829039238807' + - '66231253716972279618549611306311532332784130069552*x^92 - 136808840532983525733371616856' + - '9159837832704105092114010195321026892585608760869527424128221769318567475482882108641281' + - '2285087254525711762649195488713090158567261995935441375507973903437038954795573527871968' + - '5417161263340979324636115855437833626026464694567238228672113384692*x^91 + 3083618181674' + - '8862986568981166117178805224503007958449196073139881830099761716540415100166992970870487' + - '3373126707079788137630463247890473378063608477167239399012803238136948080412031233026613' + - '982019674842362996126760918598660881958154075853487234166732468962725982670350394704*x^9' + - '0 - 289813403115309877208771459417444034084104076525942453959151517396192830308839300938' + - '0304940043691096832523560373895822112785580806605470306384081427336961791157445910134361' + - '6657558236169574623914019563015278033757596207115604274416404619873976763726230361176862' + - '4103749962308*x^89 + 7261351663096262596547306421752519967664944352757042657548177074004' + - '3888677964659193629574783185110493910165175834232355443264530112794558163538094276674245' + - '6353777250207079910504846550724505962349124489646241318514590194031456960538083858615515' + - '96378474452839548918080875392*x^88 + 200713757916795743907199117219275583409438205206481' + - '7231942053479639672483761457404441185343078367224200214631098353066851895330784411098417' + - '9847059123493476869255490681758812078835010353226169335124724927063671787833803437569881' + - '8803110365779071391744233368892636267232901060*x^87 - 3415835276908504387639264828603304' + - '4774187543053163607988075369013939388738693955206826175246197239322189971974495529977902' + - '7964187271967842736546188163848500234007974342522989286125308388161626419574193744111685' + - '493591811397803624718762999077541037470623557200013418602943344*x^86 + 26018106816532769' + - '8245150891897217833740746455695910711621558284030232272450337410678138897855399057733160' + - '1290080284009751576485218063690521326598794386401757044711814737218799723053160173284842' + - '74431327228359292699165843454191912138368855662104946473338105764358284022377572*x^85 - ' + - '2856874975370233084322274278589877961032877493803575239781590446839383349838850110790540' + - '3648812210524131836405185194224569727115488819662642038492004860753207681555806490132240' + - '8777764393214575140844637199884061193474482510361153824419358509002112742441715082401720' + - '03554579*x^84 - 185573110599032244389576804101570527084348132767052973645572485911757964' + - '2729259313496498283495085435901054470028253519696177221666303588429341287116612944063277' + - '9930980074617184610893507366878734777801369439906065231112116255739189374932436800793331' + - '5027120013043270445299679*x^83 + 2505011717146723089065441083408757861755953848955478128' + - '1579315788118551389826559214390772170359816807605857234817507196713740188637976508883215' + - '5441207099939550265092616835796851183324429280208778387235792345466196695362647033860816' + - '591741894381954763538781291764410558313991*x^82 - 15662408051664865744305515416400268585' + - '8707005140734768431358693116067906764627153578291105594938316236476559924652536087221474' + - '7327428481537736097991348864523245930040968256420145471648072565808514922141517073790169' + - '54878586353260655456252800749153240368998676635038282783458*x^81 - 110122232113858116972' + - '1507332419217626139533538741568371707640584772284575411425487193490324697965695782353672' + - '6804651562314202917926303802799123092128511979632608781197616175423659408318430631980819' + - '40752141163524039580073927919234758170275433510727185538480748046492479002*x^80 + 111235' + - '6515565991619059989006694815879078560296078423847058721145611490097096177499329308286485' + - '9800983772015536955812993006164292522896328548114223502627261314995818846022537138353738' + - '2936471043674943875733948393580977308270455034395646105894483336815886915572733813700662' + - '098*x^79 - 12379020348161516025309044646747619580648761934003227421750700116671436042176' + - '9234916272072233533611217288217765756191391217561297135624913793687875324800704812356647' + - '6086580476470670309837456621193106958657582668447487991539286833570311349881787995504922' + - '66664939630915472321*x^78 + 644986875872857655262996287035726007280561305135592527328969' + - '1398310869281737114462536081840128975833012618005509907715818362445645383627908121382917' + - '0321954905360807167962624432083484022020100490514519446370251109469392581989219468104703' + - '815994294606723175356042055357536463*x^77 + 63235839859267049809559199735563111107772959' + - '0643279065161516476872358216246745464869001220997003579220969566678295926927380724469318' + - '0820646061252655605452155405279302221601675097138808481289458149019187488153428597505906' + - '544272968607176655503312813518126744417345713254937*x^76 - 44078594647751444164879473961' + - '6736767172580397703350036227284055841189462241423478207587609486288669494296553877901566' + - '6176696560512375877158819330911417133740272652713240509201629349247928261484764761607535' + - '7271699600397835695683804000368513801138734053137773265487620770740*x^75 + 4163724596067' + - '8029633714502640461515756555508490810389744160372165422901258844664633638080420838509725' + - '4183825084031238242659920649469803095136363601325670641983841752318619899012223863450049' + - '44369160662855082815945811862019931040144524924817805931389170550354597821348040080*x^74' + - ' - 1841618640811270401511432175617831231253958593984003709177376821791781406937773897678' + - '4965616639009339271691384715292287905120635576312602740572720848588646957621039854850944' + - '2271057810666957208785506157563444775542320444667725428466886116029471586504634731571639' + - '99798684880*x^73 - 294578669269207164351858864041819495442047310529305439637416055593898' + - '7162766090787137613214756965908109965354836546249973970248312691190106013609009604757153' + - '5265598414402965513205463264379299412109566296535132357163168956324179721078597937978114' + - '90919775354115913639814509*x^72 + 116883470301786694794010591992879058407629571150024093' + - '9987022716541425069544597244574520104343084383104865011959724834839983162277825538270746' + - '3446772861932339155184508820869149212080432712368832105052715439208219455860107443735640' + - '964550120659951748548591269958013706855735*x^71 - 96233761756284375166851705637988765498' + - '4035360777533599924501238654019753472075770114475997500703712345636146933048481913156972' + - '8222282643435839625366619931870580375861356912492503081505744917112845601154976973694850' + - '812401604169633188754326586393031543351085785683934150011*x^70 + 37267526278532141730147' + - '9191315018709879694200950624463483534818687462182483196524893477069492199183695934342797' + - '9443422541400774200071792159898119676377645076117186837758856316037294986738729314820403' + - '721251876970586201378729901384977948736920393075869570682078658147246402*x^69 + 66642651' + - '0972147250271674030285069053867664571435989654117857022519140952074877015468046625019973' + - '6611736393102501735086158169777441544677276373221138134247693297469341782443037607433520' + - '29769119406856393323456137797429785528262266490880097793589266781529161410379918516384*x' + - '^68 - 2071555886582548648202364839293338433538502314782709935428769719703150188593756759' + - '8754776341070959559300033350049099637806096997987389425073233030518177133541278388985086' + - '9677900862255541990737579183726492903476789901947898423219398782945711055270770359481994' + - '5405714241304*x^67 + 1533378023324702195795907021652744267401738630185227412509325644190' + - '9317029060634416164456507736338956677716876820335111092883359676091733924360756222980274' + - '7370137957394804745995747839571913841959663322372004062970960303273926632557205330806272' + - '2007360886556152476819257995*x^66 - 5448017961352466895430876138677711451586142556869905' + - '0923629567132295720176133619693154821070667944641266645518897058051151574185925738097096' + - '4727783399666659463150181605583241877853317021881869642804656561081278038800895125315270' + - '990349472650330347825776795872045310257331*x^65 - 78282421232046072085247087260513054476' + - '2708527084437003056042757425879840311742564964306395494649198588136505247411015510613617' + - '4626341971660657174623635643361033447842931974752694105386561563527872379266026890354875' + - '8991779230812111021711115289261014249648789576891768349*x^64 + 2418346331507395736897573' + - '1685948955785280205832899561229060484737296889625174282028447265005271786499423067709898' + - '2383233013445921259592253155244901132311176213343245514384663220466022004662645372736932' + - '980342522547214216764952766269941267448422272698762518675998018630028*x^63 - 16663393527' + - '3057052036394074533228174051713767874841092049487380884240739808770868074829519386018865' + - '1033998690460694765201373162084931956959579021291104734490414034641765919862359175005557' + - '76980880906162338772064438815695697212726685067553375670752590808120744985654078946*x^62' + - ' + 5704492208044898871301938876854561565186231725938262332193484731157547462002602737462' + - '8326609599969839661227441248222824316513410409807491982186685917971756931992668327222699' + - '3124978375915590166093644975322115153886997250434245039161542480933535080758204601595606' + - '73674726*x^61 + 379845061301619031112865499569621029871812941926085546779444789597593099' + - '2185392685054292994780700584857914762885227739218300244363323904098764703684336132560431' + - '3463057739669057343485520202139735014463468397975802705055082320020672357668103919450487' + - '46973605012517899250*x^60 - 179994905002158006799826158124801226676759820818759151640774' + - '6996243019260988129520947344375845837479437547362213685858458636627876349240778913114811' + - '5802682216654123834671962143534932353646239716399699703995056735350754413864198251245974' + - '003144472609691094329488186488560*x^59 + 11998226516599704445263680513536575275844740648' + - '8957084977949573347857695876784671990551742747300499572181058411486617608702328068732650' + - '5629115939022842470427461330036765855159497439548922287873385610065932336872210754766024' + - '3619913236809974787583082322603729616639857984*x^58 - 4144983433033950261622731813081470' + - '7770527336969337928516945498045682599969641411081917892253423829261056426615066350997839' + - '9625851001202727382175592869116981671084834588433023053079795144037278276800237512170953' + - '7071990233421247209452432417836264144119102122277397817768*x^57 + 1512962577111507743190' + - '8669956206219042935389498880634946383802509472558213849267308016796479509671033971998232' + - '6640743177967474759322127446620879544817657822412463189953968625409814688990486802544852' + - '254612284845621149784604770996714678404380352987098024383778212981782*x^56 + 77172024931' + - '6487501315793753308542413178191934850303677896300194979153932088946756095579709069441269' + - '0383553620325980615363453753714998257603589364289068081989344439616890875432673156016666' + - '54995598616739353151801167940120441305635456765616769010583292909919688853748166*x^55 - ' + - '5333622148132692571383637474154386631336646003027379100089536309803633081806433335487865' + - '3788348099478071550518684140405592181062300213393211342562869431261195244746405559760305' + - '5279266341016276936298547770626014341819185195774706572228813839188337921892972222814214' + - '310*x^54 + 19809672028428641640899800622402763302466107426065596161229438948311823788722' + - '3011979572958763434751014838641676318160514731028557415209691566304186906674973002537070' + - '5253261451722595574825909044347432563886626360892946154114244758083283534430074310561861' + - '53291193660236*x^53 - 329823673072531211210799718899973202178363530876433641298814641150' + - '6139710410216087290819607707745597629829922199887264959789083529199815629147904411567529' + - '1590786809778563763283465741573088038560353019519669822491564147416413441042710366926553' + - '820042101416886262527990*x^52 - 10144936578269964376020733137047632523382421876974915371' + - '4188811589368419548041234673526743288454740143266748440471090083438713064849263517696332' + - '4904941881888449477311134251646513648478804690358781404087817936978444236056065321755488' + - '9599843143417811189310391299541374*x^51 + 9970100278538009038108356598311736963964654105' + - '7307557839053560097762294189359089690849017771612857726107340562452641761999832823629243' + - '1508228988020877820835825693877180101374081950230530623295046637055944037920792732156011' + - '4457596629472924327212630999737789491694628*x^50 - 4001363641205954524277253466159627211' + - '5054612117982291646110008353550779551054529401065043117114065854192422518937652264386811' + - '6810035116560629578512302780859932290192913573475644905186402717704749806127538925050731' + - '5119821334579686622431730574757902251581738927743514*x^49 + 9180213565693093847510479570' + - '0293884995655962139940688297118935762169143151779122206282849955988804045093690808202777' + - '1911618936765072016334219087961215540705432215522135777876375064000492729289146413824719' + - '753030999530625757538495495631483556564886408485696916274754*x^48 - 50130121021546064268' + - '8466550524464459820491039666763299722186435065388308099847672242626060528662920871699108' + - '4876566352805637002187528368901275570021164484050246770934160569641699481951137621284112' + - '2712589602930316113642419950349056502832731819476610421210838732740*x^47 - 5494429814115' + - '8889585149685718733677961698895320275836546276877269868766134856004799808707502218250732' + - '7394751918448793828197188700366856746060661221362264501276195836539087931402219133901464' + - '02903001771434654731924912308476740943900732699364805260630537589779248726*x^46 + 266862' + - '4265977458183206062913290863407974410158458734261779314753074840748195499034379091977887' + - '7740724609637795099627410990033459320928466992859334584393263971082935971550878766944260' + - '143576637848761516728162978413410567270026180297395204928647366053260719567023642*x^45 -' + - ' 705248610717213520619487207440519095205097725919948620492539163799230109615663569690813' + - '2500152762925969931467667410093356104679329968273315005923088838866278149907674998592394' + - '117000761761120597925240350755933951486120638079133147944601048042610283120648681977182*' + - 'x^44 + 120948879881384317178483912956867036752286364563929428682928139939229340261144090' + - '9195672117689474922617967296235493962840791334950340419054279131563933305486551030416968' + - '3930331479144950467084540935124999738902799381400311390509062702196038645169336929497583' + - '19412*x^43 - 132493488612052453833911384927269989662957662727807923412036942065407705141' + - '7691131722604562201840504522929158651370739513572711063413085138434059101868053588204820' + - '3501768317607444088231087593813985100365809682458092656030031376932623184206777051738480' + - '7361785676*x^42 + 1335101451287203762576138569495941477971504274602183925641749849903459' + - '8980956043459656243655749784623012085862698394648682752166666768074310793807865722870739' + - '3173302010891133955653957891206671708545214887972884388815228324972354653982612030632649' + - '34026405622216*x^41 - 499475928130866741228480771978236745236018779224819801296446463957' + - '9785518460647882301447200199431775600694246107897807321342908506154719721626263588381290' + - '0592176275157168942165975268637294595701807663934675024895640533113998474098334592248256' + - '04519148808410998*x^40 + 212305592210660964298716639074790088269009582658150801718185411' + - '3269385593704800964985188474919595016094399856587285937724667194571366226231057182214817' + - '2939735392854797133864874593493381873393755597220292894779357870630711404684601224949311' + - '42480075599166922066*x^39 - 573560580971059872815795328424511214551077897223506554014689' + - '0908943885059425561173984064965243669475190847160447678969581341853994736689748774337791' + - '1115234455374082211964879328708992075827410179353346849333974996486585045121702984508121' + - '1351675478818348250014*x^38 + 1013236454785227694127708629554514948387008662851023057079' + - '5882796137303973594057278239365802606433320824140045284471619032650746240307864113277781' + - '9311878768393722371629720946216383399574613765135960868446031017264818726765755631590746' + - '592742117108410287162304*x^37 - 11582691707749694320983466811601420819483438159197492729' + - '3674609747819194978460832310429882055944418973561703899132956324878554694827218593251972' + - '0327331589579073374625050919799091874768764116278381338067763168272226788014070435497357' + - '3342854568112725548119716*x^36 + 8305639013155526915236550603371532656184411848547972540' + - '3465416008780582431421160189594698593377625798613038172701584227420667828126971332395384' + - '3252700015484543752538426082787722637328521354532797854400197712614233087564302182567125' + - '978130820395479367756272*x^35 - 72553146629985724022417545002782748038779254133970249404' + - '4488085609115659954701904593406318203275740015798664755712471063807666964274588808311489' + - '1044280939887931108038092178564939092718846931418812112435659600111538323529845502841633' + - '0896607528890361908254*x^34 + 1986079839481209649142506411886933188247493467902250137556' + - '0034921908640372898346258892520513212080051499164813732790533138610827050260461000934976' + - '4731007072157557818507156925710202232809466166773259146148711101276744037011180493410453' + - '92289086401193314942*x^33 - 450407363095728689969776524976799469088161769214155804237591' + - '4732816568654964463404246666107335114613523093289692400764726576487136630100597891085199' + - '5924693237589981416278060753619064370840973302978473470436916347279281264299024937590799' + - '59944869550465866*x^32 + 690709206596584805516907577372217703747616849501451851210472484' + - '6187373009932814178642755564658576569084215689177193658156790231574112156057258090256560' + - '6973769715665769510361215003464899280535977068967178978920510669896579783517231275747610' + - '5925970954316*x^31 - 9505054990887008075387059944852731534709761992249213459182019380991' + - '5101076472648920213965588681446816110662751219780692605034863184825513108322135455467480' + - '1992907089853579938446000527875760177484903309468036228859114620828283853746322958391777' + - '66961104*x^30 + 146871001034451764467214379577713350818960453105454365246878113141243396' + - '2615951663537883759634270986980824512323040156750516514483187596408739659469959898436647' + - '3798855873087478723052705650039925818705324797901096311128210246360020474709693712139627' + - '212*x^29 - 21967157682673292571077015450821069674087154459058705287572769215450467291564' + - '3984006806321437086319058849365052767208218014837751960157990288873082851420245228518414' + - '5954435822512134773040530752315307032862652438081839581459737476241460047819927741316*x^' + - '28 + 25868119256527924216571854756548104041695189769000727814033930137261023208980580205' + - '8986075080802457160498187922336808723533440768983858410495172453056173937212211989511173' + - '231680395022164755838763689599538740293650223698101726021253254970956445408416*x^27 - 24' + - '2805926801032191824481196408612926215648793221911620505040706493277915082684668384082820' + - '7907023221961357049402852741057462854239014222073718993142543903159834420446983839453837' + - '5777438560493927453239255655633758840387565176697754574091764000708652*x^26 + 2280449645' + - '8469216013154676504723662304868433632800693751036388423829721062171682054772991955704322' + - '9772128344339134213287693234598135052834517696989191885698386377361100330805052014322924' + - '6149018773191614239310593408598408683107352357568527200654044*x^25 - 2406358660663137122' + - '0332701849550116809043249774080226142747657499480137764390464906763369553397919412224096' + - '9253863977221653979298143342306176415578087339110574280678118160005286224756835902809740' + - '658092872319513670690482675603106255535345368222072*x^24 + 17662623687632442866313848276' + - '7405333184735625305686026085380981148726634500393960831149553262597329458902932994016704' + - '9161961677061802977969263820447192793617562366039417910781021352992596284460784056551089' + - '2584667589514772071439777359014056460388*x^23 - 1017233748361584303945573233303267710280' + - '8866261456706104325822118295706056417248083910297875201722536975247236509556834662193413' + - '7039403008509886158851525905826470428214804919613199486474955638039045153356770343743289' + - '1192535285335888731490497100*x^22 + 6962445663264990114203834350887614260930901314811371' + - '9161965752973745996685396900624298139454605902203508688010033667430170800362592329749063' + - '2324135942177919647575492583795796411578832042275118279766662730162066196362581674880927' + - '08330371586416*x^21 - 593549929747673542545773038959558612336307724423903906725887570276' + - '8982664645057963477934568594005464836637975042526453172368489524272612968427884799674433' + - '076029695429573035860757527137847022330944670730098884004709831827016377193151480549079*' + - 'x^20 - 992423127688763205526494500283585593161536192980641848880826077125233276374558493' + - '7936951893574980734291809056221635152403694833627530723796946949691147173318001467365819' + - '2117622228419150498922256734920743781356158658426818610320388361445943*x^19 - 2230349100' + - '4197698558726259984446018235224052374222124803112769365262229072348723149347181462577999' + - '9561250973151861274182445148950841643787474774181593565516305051313051359659036389359517' + - '81824035858082445936492127698502477328282539866049529*x^18 - 236643075076678358536974434' + - '1802373468130302112205763984922610425051584684774245106684856714329733460194522211899691' + - '2040305393397970675325560652665649968995125799175143049170891303055998502994776437035748' + - '4298669582284123292715096914727786*x^17 + 2542147127057127485965235153724151047113766830' + - '5008530095934057432271073053439213859505464662101818485064985498169276132525055092922810' + - '7659183430955698520972071635491614118402866501132808889569521209673251362824767097566557' + - '55991836417802*x^16 + 183111149787713493280210397619912322103096524787117977315403019542' + - '0556994309371058325110985700072545919333159157805938622401403735299805200331586731105061' + - '411992395088925553685276827911215509136424174340648729576596630358137790527045198*x^15 -' + - ' 449821041069912943789836264563259981897173155962115964878055569440904947559369552659858' + - '6098851324811318251934194570791615792795171303725257398708791891768203748059945364079420' + - '9186225479459166338434922942612532823032751347335799704869*x^14 - 2298291115194604147122' + - '8739834005426233991017384039136505288378975565222015046012084713248553875254551212370894' + - '2718290034883742571745239756760650243258733906349333521899975599619910693111772391894198' + - '334123224235975702158966025975889*x^13 + 42511674491028604176056825575822690623286438919' + - '8610106379016444756850106638828170836716190513979996775166447324309502316343643464457303' + - '4071544836908769671820523719962939869299988336933823914482320626610429276999595557594057' + - '384713*x^12 - 26347694152548849355786851346292613968732460712333882998302582836844072876' + - '1857082490449796652126507449958756889592429322438384205178238605888784292448997291893491' + - '64095467733178297936868563207641713754730703022219988903837976940*x^11 - 178196131047104' + - '4774947338789490919866800568219510808350360943838004052330411696017910506157765585633940' + - '0958610006887535231411384839284904674511256960034750139170510478764583267207761340591670' + - '1813265375481337031112649106926204*x^10 + 1825000405670995013845885918902187142186986666' + - '4824409338396462521386957836588377301330171147216240982523247505481312286617417272521511' + - '8638399348219471080155689525455946137646839420547370091703312293991788729921149119118525' + - '2*x^9 - 65201626996640512322761674559318066561117950070675294766316982476276989902435290' + - '9587195016688965354038529484926750838814982572946010197963711048936034917631232991978331' + - '662266000737962928009570448129947743171045016069129*x^8 - 143789114908399966242014434226' + - '3678250208894256538560561654893395196139124843140165315079877689148089528582386817468475' + - '1112400557598552798591861020111859826843145889273424219630446788436681492325879038241989' + - '148825558929*x^7 - 142828093036375825138496910105257266211087946680559575870445105279110' + - '3393358290266219966226305109762705525440125914454905218998171494860832439673707497269515' + - '2598687627144493996961826371180326564404038224536379451171*x^6 - 11708263721974590551778' + - '2060088197971006669344668565149881317599098107457621720311505150869324678944193921202206' + - '0006143232927993687388965568222471917250721254423939579010787041982434713954951800253409' + - '69870794174*x^5 - 1182231686757768433506342993065526680618649578262071030174998386344333' + - '1870511938326895267957986310266067435757183222780653285285515787535758717626382176202414' + - '16850427234233281589721441720700844787815627946*x^4 - 9530484570070082961795451881320794' + - '1848171999183509690245763272489068126300419773341516701735233419849726478663631547211301' + - '749427543946011643243124123502481796513891248511161398944690550172434214114*x^3 - 254706' + - '7915242561774721813182510419129507794390935955929617768730635253624759862293118182940797' + - '9543359023138212076788480275435953482850814143976192954552922164477294336146282655143613' + - '63667915*x^2 + 7114590568532928191072122754665584122789751912529693393245247725975835948' + - '7615527828928204048113*x - 1') - - def test_quadray(self): - def Q(d, f): - return pari.lift(pari.quadray(d, f)); - - self.assertEquals(Q(-4, 31), - 'x^240 + (-15*y - 36)*x^239 + (499*y + 430)*x^238 + (-6344*y - 983)*x^237 + (35389*y - 20' + - '411)*x^236 + (-40904*y + 178707)*x^235 + (-424808*y - 438197)*x^234 + (1415485*y - 63520' + - '8)*x^233 + (1438139*y + 2974605)*x^232 + (-5864817*y + 6566480)*x^231 + (-25462020*y - 1' + - '2961894)*x^230 + (19238389*y - 79956654)*x^229 + (247313433*y - 30224897)*x^228 + (29492' + - '7621*y + 801098945)*x^227 + (-2353679384*y + 1069498319)*x^226 + (-3266832488*y - 579346' + - '9739)*x^225 + (12761071756*y - 10152009124)*x^224 + (28891772141*y + 27706877778)*x^223 ' + - '+ (-56780498004*y + 70327470888)*x^222 + (-156989267296*y - 100643285180)*x^221 + (16318' + - '2970660*y - 341901790078)*x^220 + (692925090103*y + 282970748175)*x^219 + (-520851483678' + - '*y + 1249500770581)*x^218 + (-2100987167651*y - 977806363155)*x^217 + (2144907137575*y -' + - ' 3501192827999)*x^216 + (5741131351957*y + 5368774573391)*x^215 + (-12949633488740*y + 9' + - '667592872104)*x^214 + (-18978818705192*y - 28988343801763)*x^213 + (61143701295650*y - 4' + - '2854297857883)*x^212 + (99522339968066*y + 118416217970085)*x^211 + (-203990291010201*y ' + - '+ 226088796680855)*x^210 + (-487486417978576*y - 306059642167156)*x^209 + (3714379876058' + - '61*y - 969565907346414)*x^208 + (1761877237395113*y + 250996844693464)*x^207 + (34758744' + - '8455796*y + 2909203449118066)*x^206 + (-4262623171412271*y + 1900082482875272)*x^205 + (' + - '-5112561845313059*y - 5258998337190094)*x^204 + (4703077156935772*y - 10817923562329066)' + - '*x^203 + (19596724151621886*y + 457971706716061)*x^202 + (10779811934500297*y + 31310302' + - '362591686)*x^201 + (-44471188376651271*y + 33091705261026148)*x^200 + (-7036772807394845' + - '3*y - 55368143890230595)*x^199 + (58047935399898944*y - 125056052810735004)*x^198 + (196' + - '220179915190037*y + 46078797156864550)*x^197 + (-15612945533449050*y + 27845280622065684' + - '6)*x^196 + (-364966710997667886*y + 30164046307811567)*x^195 + (-76920393658091100*y - 4' + - '55669527002677921)*x^194 + (569724473209147360*y - 104273935104641941)*x^193 + (10755448' + - '0539021407*y + 761016430421970356)*x^192 + (-1120756441763956820*y + 138805435659787599)' + - '*x^191 + (-367443684968762359*y - 1741313178847717412)*x^190 + (2626931562224608194*y - ' + - '1142827140366519672)*x^189 + (3001549496003468616*y + 3542726921147289593)*x^188 + (-381' + - '6304655625513057*y + 6563685064488706687)*x^187 + (-12280102244383760786*y - 21699560839' + - '18876046)*x^186 + (-3280308295039992672*y - 20013773166146345265)*x^185 + (2853496987167' + - '9714183*y - 14758677431499660732)*x^184 + (34205385277277312731*y + 35129207175233160758' + - ')*x^183 + (-35562575528916824663*y + 62321292808100809456)*x^182 + (-9752696811368934026' + - '6*y - 24577168539715006795)*x^181 + (-2924482708853224503*y - 135200656059538396115)*x^1' + - '80 + (167559880460473073606*y - 50231770182088582728)*x^179 + (117217186558944665294*y +' + - ' 184431316627662099968)*x^178 + (-175018700423712057769*y + 199325075624692888658)*x^177' + - ' + (-287672838056258651793*y - 130006789216819808906)*x^176 + (43313688758928043819*y - ' + - '370488386653834436323)*x^175 + (435685264104825475131*y - 87230951613648934063)*x^174 + ' + - '(260789110179489506909*y + 473346146286012258862)*x^173 + (-477453708065915165092*y + 47' + - '5828532275903297714)*x^172 + (-733125023480253537968*y - 445824632107486741239)*x^171 + ' + - '(377925441616168009977*y - 1037951764481934863694)*x^170 + (1401192440853964064557*y + 2' + - '71204181219921501426)*x^169 + (-116817470274758714683*y + 1837817520966021102844)*x^168 ' + - '+ (-2362860273074857968126*y + 103875680474127044027)*x^167 + (-421763202246558569481*y ' + - '- 2985437596461812106201)*x^166 + (3701454711020661872373*y - 878419497758685431399)*x^1' + - '65 + (1521006793930665203185*y + 4486769840934475059679)*x^164 + (-529241318603180042864' + - '8*y + 2393646591871321675898)*x^163 + (-3527560907713404811933*y - 604634284973707724102' + - '9)*x^162 + (6659475347960239461641*y - 4934471883467342725819)*x^161 + (6606218484397706' + - '362957*y + 7034633694928572084799)*x^160 + (-7071251229918632950519*y + 8522145413937837' + - '540988)*x^159 + (-10654172673396879304988*y - 6660938661086516468010)*x^158 + (567774155' + - '9220425296264*y - 12963319200223537566424)*x^157 + (15378684394800615926642*y + 39750426' + - '69473795569897)*x^156 + (-1409491575820818236069*y + 17768498236629148702410)*x^155 + (-' + - '19928654122136236656860*y + 2108177954625221499359)*x^154 + (-6549200784773657451762*y -' + - ' 21617243705895522615660)*x^153 + (22645379524677683996954*y - 11738628703873244299229)*' + - 'x^152 + (17408053637884918322314*y + 22982504260819896781381)*x^151 + (-2280963052257870' + - '1355929*y + 23340226072231874490562)*x^150 + (-29550558164952915082604*y - 2243923697761' + - '5542871417)*x^149 + (22094525765620020809639*y - 36386527353264595233550)*x^148 + (44442' + - '209345887020103552*y + 21630493829993114594971)*x^147 + (-20362621509381561401708*y + 54' + - '254830555411448139989)*x^146 + (-65913386979565369752671*y - 17161940478911028975987)*x^' + - '145 + (10842803083053018739937*y - 78798826823995559998884)*x^144 + (9167111465909433423' + - '0114*y + 699010605156960463896)*x^143 + (13121977610624125288643*y + 1031433173880272806' + - '63819)*x^142 + (-112336281183122778011108*y + 29666952173920616332098)*x^141 + (-4771339' + - '6391497944676658*y - 119352040791078382516354)*x^140 + (125222144899372880978343*y - 665' + - '35424263344578690303)*x^139 + (86443391588395703449231*y + 131288792905554584140170)*x^1' + - '38 + (-138308631379146285689943*y + 108711776444636401209940)*x^137 + (-1348368565280014' + - '66894586*y - 145826834678543169365085)*x^136 + (152261003156819774060466*y - 16552554507' + - '4570372890946)*x^135 + (200019883617103704090631*y + 155735524429003454571137)*x^134 + (' + - '-155214006426713875482591*y + 236255888142978579163439)*x^133 + (-2718432139372841283103' + - '12*y - 151199785544397594300869)*x^132 + (145501652264843306972923*y - 30532687550632110' + - '0258855)*x^131 + (336932852565943631529246*y + 140097781638111061499104)*x^130 + (-13577' + - '3050794564515416176*y + 368242715265481945864410)*x^129 + (-400908655930869378612741*y -' + - ' 131401561676926670933942)*x^128 + (124426493872813948801626*y - 43514571281432866679953' + - '9)*x^127 + (468998791431367083907400*y + 112351662733835870233203)*x^126 + (-94381628626' + - '117531492779*y + 498937937395927788353831)*x^125 + (-521540559152841029573809*y - 721883' + - '67562634255595303)*x^124 + (49231480359271694594387*y - 535280543629519838165745)*x^123 ' + - '+ (541321200409785903521904*y + 28961946371400127296768)*x^122 + (-129362297730888224368' + - '24*y + 542775176498979507958864)*x^121 - 542817871620722856854615*y*x^120 + (-1293622977' + - '3088822436824*y - 542775176498979507958864)*x^119 + (541321200409785903521904*y - 289619' + - '46371400127296768)*x^118 + (49231480359271694594387*y + 535280543629519838165745)*x^117 ' + - '+ (-521540559152841029573809*y + 72188367562634255595303)*x^116 + (-94381628626117531492' + - '779*y - 498937937395927788353831)*x^115 + (468998791431367083907400*y - 1123516627338358' + - '70233203)*x^114 + (124426493872813948801626*y + 435145712814328666799539)*x^113 + (-4009' + - '08655930869378612741*y + 131401561676926670933942)*x^112 + (-135773050794564515416176*y ' + - '- 368242715265481945864410)*x^111 + (336932852565943631529246*y - 1400977816381110614991' + - '04)*x^110 + (145501652264843306972923*y + 305326875506321100258855)*x^109 + (-2718432139' + - '37284128310312*y + 151199785544397594300869)*x^108 + (-155214006426713875482591*y - 2362' + - '55888142978579163439)*x^107 + (200019883617103704090631*y - 155735524429003454571137)*x^' + - '106 + (152261003156819774060466*y + 165525545074570372890946)*x^105 + (-1348368565280014' + - '66894586*y + 145826834678543169365085)*x^104 + (-138308631379146285689943*y - 1087117764' + - '44636401209940)*x^103 + (86443391588395703449231*y - 131288792905554584140170)*x^102 + (' + - '125222144899372880978343*y + 66535424263344578690303)*x^101 + (-47713396391497944676658*' + - 'y + 119352040791078382516354)*x^100 + (-112336281183122778011108*y - 2966695217392061633' + - '2098)*x^99 + (13121977610624125288643*y - 103143317388027280663819)*x^98 + (916711146590' + - '94334230114*y - 699010605156960463896)*x^97 + (10842803083053018739937*y + 7879882682399' + - '5559998884)*x^96 + (-65913386979565369752671*y + 17161940478911028975987)*x^95 + (-20362' + - '621509381561401708*y - 54254830555411448139989)*x^94 + (44442209345887020103552*y - 2163' + - '0493829993114594971)*x^93 + (22094525765620020809639*y + 36386527353264595233550)*x^92 +' + - ' (-29550558164952915082604*y + 22439236977615542871417)*x^91 + (-22809630522578701355929' + - '*y - 23340226072231874490562)*x^90 + (17408053637884918322314*y - 2298250426081989678138' + - '1)*x^89 + (22645379524677683996954*y + 11738628703873244299229)*x^88 + (-654920078477365' + - '7451762*y + 21617243705895522615660)*x^87 + (-19928654122136236656860*y - 21081779546252' + - '21499359)*x^86 + (-1409491575820818236069*y - 17768498236629148702410)*x^85 + (153786843' + - '94800615926642*y - 3975042669473795569897)*x^84 + (5677741559220425296264*y + 1296331920' + - '0223537566424)*x^83 + (-10654172673396879304988*y + 6660938661086516468010)*x^82 + (-707' + - '1251229918632950519*y - 8522145413937837540988)*x^81 + (6606218484397706362957*y - 70346' + - '33694928572084799)*x^80 + (6659475347960239461641*y + 4934471883467342725819)*x^79 + (-3' + - '527560907713404811933*y + 6046342849737077241029)*x^78 + (-5292413186031800428648*y - 23' + - '93646591871321675898)*x^77 + (1521006793930665203185*y - 4486769840934475059679)*x^76 + ' + - '(3701454711020661872373*y + 878419497758685431399)*x^75 + (-421763202246558569481*y + 29' + - '85437596461812106201)*x^74 + (-2362860273074857968126*y - 103875680474127044027)*x^73 + ' + - '(-116817470274758714683*y - 1837817520966021102844)*x^72 + (1401192440853964064557*y - 2' + - '71204181219921501426)*x^71 + (377925441616168009977*y + 1037951764481934863694)*x^70 + (' + - '-733125023480253537968*y + 445824632107486741239)*x^69 + (-477453708065915165092*y - 475' + - '828532275903297714)*x^68 + (260789110179489506909*y - 473346146286012258862)*x^67 + (435' + - '685264104825475131*y + 87230951613648934063)*x^66 + (43313688758928043819*y + 3704883866' + - '53834436323)*x^65 + (-287672838056258651793*y + 130006789216819808906)*x^64 + (-17501870' + - '0423712057769*y - 199325075624692888658)*x^63 + (117217186558944665294*y - 1844313166276' + - '62099968)*x^62 + (167559880460473073606*y + 50231770182088582728)*x^61 + (-2924482708853' + - '224503*y + 135200656059538396115)*x^60 + (-97526968113689340266*y + 24577168539715006795' + - ')*x^59 + (-35562575528916824663*y - 62321292808100809456)*x^58 + (34205385277277312731*y' + - ' - 35129207175233160758)*x^57 + (28534969871679714183*y + 14758677431499660732)*x^56 + (' + - '-3280308295039992672*y + 20013773166146345265)*x^55 + (-12280102244383760786*y + 2169956' + - '083918876046)*x^54 + (-3816304655625513057*y - 6563685064488706687)*x^53 + (300154949600' + - '3468616*y - 3542726921147289593)*x^52 + (2626931562224608194*y + 1142827140366519672)*x^' + - '51 + (-367443684968762359*y + 1741313178847717412)*x^50 + (-1120756441763956820*y - 1388' + - '05435659787599)*x^49 + (107554480539021407*y - 761016430421970356)*x^48 + (5697244732091' + - '47360*y + 104273935104641941)*x^47 + (-76920393658091100*y + 455669527002677921)*x^46 + ' + - '(-364966710997667886*y - 30164046307811567)*x^45 + (-15612945533449050*y - 2784528062206' + - '56846)*x^44 + (196220179915190037*y - 46078797156864550)*x^43 + (58047935399898944*y + 1' + - '25056052810735004)*x^42 + (-70367728073948453*y + 55368143890230595)*x^41 + (-4447118837' + - '6651271*y - 33091705261026148)*x^40 + (10779811934500297*y - 31310302362591686)*x^39 + (' + - '19596724151621886*y - 457971706716061)*x^38 + (4703077156935772*y + 10817923562329066)*x' + - '^37 + (-5112561845313059*y + 5258998337190094)*x^36 + (-4262623171412271*y - 19000824828' + - '75272)*x^35 + (347587448455796*y - 2909203449118066)*x^34 + (1761877237395113*y - 250996' + - '844693464)*x^33 + (371437987605861*y + 969565907346414)*x^32 + (-487486417978576*y + 306' + - '059642167156)*x^31 + (-203990291010201*y - 226088796680855)*x^30 + (99522339968066*y - 1' + - '18416217970085)*x^29 + (61143701295650*y + 42854297857883)*x^28 + (-18978818705192*y + 2' + - '8988343801763)*x^27 + (-12949633488740*y - 9667592872104)*x^26 + (5741131351957*y - 5368' + - '774573391)*x^25 + (2144907137575*y + 3501192827999)*x^24 + (-2100987167651*y + 977806363' + - '155)*x^23 + (-520851483678*y - 1249500770581)*x^22 + (692925090103*y - 282970748175)*x^2' + - '1 + (163182970660*y + 341901790078)*x^20 + (-156989267296*y + 100643285180)*x^19 + (-567' + - '80498004*y - 70327470888)*x^18 + (28891772141*y - 27706877778)*x^17 + (12761071756*y + 1' + - '0152009124)*x^16 + (-3266832488*y + 5793469739)*x^15 + (-2353679384*y - 1069498319)*x^14' + - ' + (294927621*y - 801098945)*x^13 + (247313433*y + 30224897)*x^12 + (19238389*y + 799566' + - '54)*x^11 + (-25462020*y + 12961894)*x^10 + (-5864817*y - 6566480)*x^9 + (1438139*y - 297' + - '4605)*x^8 + (1415485*y + 635208)*x^7 + (-424808*y + 438197)*x^6 + (-40904*y - 178707)*x^' + - '5 + (35389*y + 20411)*x^4 + (-6344*y + 983)*x^3 + (499*y - 430)*x^2 + (-15*y + 36)*x - 1') - self.assertEquals(Q(-11, 2), 'x^3 + (-y - 1)*x^2 + (y - 2)*x + 1') - self.assertEquals(Q(-15, 3), 'x^6 + (-y - 1)*x^5 + (y - 2)*x^4 + 5*x^3 + (-y - 1)*x^2 + (y - 2)*x + 1') - self.assertEquals(Q(-179, 2), - 'x^15 + (-13*y - 28)*x^14 + (-35*y + 71)*x^13 + (-96*y + 193)*x^12 + (-5*y - 196)*x^11 + (' - '-239*y - 365)*x^10 + (120*y + 1489)*x^9 + (-261*y - 2084)*x^8 + (-261*y + 2345)*x^7 + (' - '120*y - 1609)*x^6 + (-239*y + 604)*x^5 + (-5*y + 201)*x^4 + (-96*y - 97)*x^3 + (-35*y - ' - '36)*x^2 + (-13*y + 41)*x - 1') - self.assertEquals(Q(-2276, 2), - 'x^64 - 2869316*y*x^63 - 14321320456*x^62 + 157634598028*y*x^61 - 202841207529344*x^60 - ' + - '187341502817748*y*x^59 + 42513677421330536*x^58 + 8965927758542748*y*x^57 - 581758105735' + - '037800*x^56 - 22856296353162116*y*x^55 - 1745294559156518504*x^54 - 264489521649865972*y' + - '*x^53 + 3806496834205999360*x^52 - 748148105793479444*y*x^51 + 34464709754552397448*x^50' + - ' - 807085220707689700*y*x^49 + 112558678351798157916*x^48 + 885683152130937644*y*x^47 + ' + - '306385339881668417048*x^46 + 13203419547826420924*y*x^45 + 419863456051485069824*x^44 + ' + - '34343465258453402972*y*x^43 + 465608689069031605064*x^42 + 80309592889200941068*y*x^41 -' + - ' 360175722030581287640*x^40 + 110486596140091600940*y*x^39 - 1490512424563931678536*x^38' + - ' + 143957811491089032572*y*x^37 - 3739364774219046032256*x^36 + 100323919847689168220*y*' + - 'x^35 - 4985975135633301110936*x^34 + 54816113881156185292*y*x^33 - 613500838305160199583' + - '4*x^32 - 54816113881156185292*y*x^31 - 4985975135633301110936*x^30 - 1003239198476891682' + - '20*y*x^29 - 3739364774219046032256*x^28 - 143957811491089032572*y*x^27 - 149051242456393' + - '1678536*x^26 - 110486596140091600940*y*x^25 - 360175722030581287640*x^24 - 8030959288920' + - '0941068*y*x^23 + 465608689069031605064*x^22 - 34343465258453402972*y*x^21 + 419863456051' + - '485069824*x^20 - 13203419547826420924*y*x^19 + 306385339881668417048*x^18 - 885683152130' + - '937644*y*x^17 + 112558678351798157916*x^16 + 807085220707689700*y*x^15 + 344647097545523' + - '97448*x^14 + 748148105793479444*y*x^13 + 3806496834205999360*x^12 + 264489521649865972*y' + - '*x^11 - 1745294559156518504*x^10 + 22856296353162116*y*x^9 - 581758105735037800*x^8 - 89' + - '65927758542748*y*x^7 + 42513677421330536*x^6 + 187341502817748*y*x^5 - 202841207529344*x' + - '^4 - 157634598028*y*x^3 - 14321320456*x^2 + 2869316*y*x + 1') - self.assertEquals(Q(-251, 2), - 'x^21 + (-13*y - 229)*x^20 + (234*y - 100)*x^19 + (-480*y + 8370)*x^18 + (-1735*y - 16719' + - ')*x^17 + (4913*y - 7834)*x^16 + (-2688*y + 51064)*x^15 + (-3960*y - 34104)*x^14 + (1782*' + - 'y - 32956)*x^13 + (8448*y + 5262)*x^12 + (-6380*y + 97204)*x^11 + (-6380*y - 90824)*x^10' + - ' + (8448*y - 13710)*x^9 + (1782*y + 31174)*x^8 + (-3960*y + 38064)*x^7 + (-2688*y - 4837' + - '6)*x^6 + (4913*y + 2921)*x^5 + (-1735*y + 18454)*x^4 + (-480*y - 7890)*x^3 + (234*y - 13' + - '4)*x^2 + (-13*y + 242)*x - 1') - self.assertEquals(Q(-35, 2), 'x^6 - 2*y*x^5 + (-y - 7)*x^4 - 4*x^3 + (y - 8)*x^2 + (2*y - 2)*x + 1') - self.assertEquals(Q(-4, 31), - 'x^240 + (-15*y - 36)*x^239 + (499*y + 430)*x^238 + (-6344*y - 983)*x^237 + (35389*y - 20' + - '411)*x^236 + (-40904*y + 178707)*x^235 + (-424808*y - 438197)*x^234 + (1415485*y - 63520' + - '8)*x^233 + (1438139*y + 2974605)*x^232 + (-5864817*y + 6566480)*x^231 + (-25462020*y - 1' + - '2961894)*x^230 + (19238389*y - 79956654)*x^229 + (247313433*y - 30224897)*x^228 + (29492' + - '7621*y + 801098945)*x^227 + (-2353679384*y + 1069498319)*x^226 + (-3266832488*y - 579346' + - '9739)*x^225 + (12761071756*y - 10152009124)*x^224 + (28891772141*y + 27706877778)*x^223 ' + - '+ (-56780498004*y + 70327470888)*x^222 + (-156989267296*y - 100643285180)*x^221 + (16318' + - '2970660*y - 341901790078)*x^220 + (692925090103*y + 282970748175)*x^219 + (-520851483678' + - '*y + 1249500770581)*x^218 + (-2100987167651*y - 977806363155)*x^217 + (2144907137575*y -' + - ' 3501192827999)*x^216 + (5741131351957*y + 5368774573391)*x^215 + (-12949633488740*y + 9' + - '667592872104)*x^214 + (-18978818705192*y - 28988343801763)*x^213 + (61143701295650*y - 4' + - '2854297857883)*x^212 + (99522339968066*y + 118416217970085)*x^211 + (-203990291010201*y ' + - '+ 226088796680855)*x^210 + (-487486417978576*y - 306059642167156)*x^209 + (3714379876058' + - '61*y - 969565907346414)*x^208 + (1761877237395113*y + 250996844693464)*x^207 + (34758744' + - '8455796*y + 2909203449118066)*x^206 + (-4262623171412271*y + 1900082482875272)*x^205 + (' + - '-5112561845313059*y - 5258998337190094)*x^204 + (4703077156935772*y - 10817923562329066)' + - '*x^203 + (19596724151621886*y + 457971706716061)*x^202 + (10779811934500297*y + 31310302' + - '362591686)*x^201 + (-44471188376651271*y + 33091705261026148)*x^200 + (-7036772807394845' + - '3*y - 55368143890230595)*x^199 + (58047935399898944*y - 125056052810735004)*x^198 + (196' + - '220179915190037*y + 46078797156864550)*x^197 + (-15612945533449050*y + 27845280622065684' + - '6)*x^196 + (-364966710997667886*y + 30164046307811567)*x^195 + (-76920393658091100*y - 4' + - '55669527002677921)*x^194 + (569724473209147360*y - 104273935104641941)*x^193 + (10755448' + - '0539021407*y + 761016430421970356)*x^192 + (-1120756441763956820*y + 138805435659787599)' + - '*x^191 + (-367443684968762359*y - 1741313178847717412)*x^190 + (2626931562224608194*y - ' + - '1142827140366519672)*x^189 + (3001549496003468616*y + 3542726921147289593)*x^188 + (-381' + - '6304655625513057*y + 6563685064488706687)*x^187 + (-12280102244383760786*y - 21699560839' + - '18876046)*x^186 + (-3280308295039992672*y - 20013773166146345265)*x^185 + (2853496987167' + - '9714183*y - 14758677431499660732)*x^184 + (34205385277277312731*y + 35129207175233160758' + - ')*x^183 + (-35562575528916824663*y + 62321292808100809456)*x^182 + (-9752696811368934026' + - '6*y - 24577168539715006795)*x^181 + (-2924482708853224503*y - 135200656059538396115)*x^1' + - '80 + (167559880460473073606*y - 50231770182088582728)*x^179 + (117217186558944665294*y +' + - ' 184431316627662099968)*x^178 + (-175018700423712057769*y + 199325075624692888658)*x^177' + - ' + (-287672838056258651793*y - 130006789216819808906)*x^176 + (43313688758928043819*y - ' + - '370488386653834436323)*x^175 + (435685264104825475131*y - 87230951613648934063)*x^174 + ' + - '(260789110179489506909*y + 473346146286012258862)*x^173 + (-477453708065915165092*y + 47' + - '5828532275903297714)*x^172 + (-733125023480253537968*y - 445824632107486741239)*x^171 + ' + - '(377925441616168009977*y - 1037951764481934863694)*x^170 + (1401192440853964064557*y + 2' + - '71204181219921501426)*x^169 + (-116817470274758714683*y + 1837817520966021102844)*x^168 ' + - '+ (-2362860273074857968126*y + 103875680474127044027)*x^167 + (-421763202246558569481*y ' + - '- 2985437596461812106201)*x^166 + (3701454711020661872373*y - 878419497758685431399)*x^1' + - '65 + (1521006793930665203185*y + 4486769840934475059679)*x^164 + (-529241318603180042864' + - '8*y + 2393646591871321675898)*x^163 + (-3527560907713404811933*y - 604634284973707724102' + - '9)*x^162 + (6659475347960239461641*y - 4934471883467342725819)*x^161 + (6606218484397706' + - '362957*y + 7034633694928572084799)*x^160 + (-7071251229918632950519*y + 8522145413937837' + - '540988)*x^159 + (-10654172673396879304988*y - 6660938661086516468010)*x^158 + (567774155' + - '9220425296264*y - 12963319200223537566424)*x^157 + (15378684394800615926642*y + 39750426' + - '69473795569897)*x^156 + (-1409491575820818236069*y + 17768498236629148702410)*x^155 + (-' + - '19928654122136236656860*y + 2108177954625221499359)*x^154 + (-6549200784773657451762*y -' + - ' 21617243705895522615660)*x^153 + (22645379524677683996954*y - 11738628703873244299229)*' + - 'x^152 + (17408053637884918322314*y + 22982504260819896781381)*x^151 + (-2280963052257870' + - '1355929*y + 23340226072231874490562)*x^150 + (-29550558164952915082604*y - 2243923697761' + - '5542871417)*x^149 + (22094525765620020809639*y - 36386527353264595233550)*x^148 + (44442' + - '209345887020103552*y + 21630493829993114594971)*x^147 + (-20362621509381561401708*y + 54' + - '254830555411448139989)*x^146 + (-65913386979565369752671*y - 17161940478911028975987)*x^' + - '145 + (10842803083053018739937*y - 78798826823995559998884)*x^144 + (9167111465909433423' + - '0114*y + 699010605156960463896)*x^143 + (13121977610624125288643*y + 1031433173880272806' + - '63819)*x^142 + (-112336281183122778011108*y + 29666952173920616332098)*x^141 + (-4771339' + - '6391497944676658*y - 119352040791078382516354)*x^140 + (125222144899372880978343*y - 665' + - '35424263344578690303)*x^139 + (86443391588395703449231*y + 131288792905554584140170)*x^1' + - '38 + (-138308631379146285689943*y + 108711776444636401209940)*x^137 + (-1348368565280014' + - '66894586*y - 145826834678543169365085)*x^136 + (152261003156819774060466*y - 16552554507' + - '4570372890946)*x^135 + (200019883617103704090631*y + 155735524429003454571137)*x^134 + (' + - '-155214006426713875482591*y + 236255888142978579163439)*x^133 + (-2718432139372841283103' + - '12*y - 151199785544397594300869)*x^132 + (145501652264843306972923*y - 30532687550632110' + - '0258855)*x^131 + (336932852565943631529246*y + 140097781638111061499104)*x^130 + (-13577' + - '3050794564515416176*y + 368242715265481945864410)*x^129 + (-400908655930869378612741*y -' + - ' 131401561676926670933942)*x^128 + (124426493872813948801626*y - 43514571281432866679953' + - '9)*x^127 + (468998791431367083907400*y + 112351662733835870233203)*x^126 + (-94381628626' + - '117531492779*y + 498937937395927788353831)*x^125 + (-521540559152841029573809*y - 721883' + - '67562634255595303)*x^124 + (49231480359271694594387*y - 535280543629519838165745)*x^123 ' + - '+ (541321200409785903521904*y + 28961946371400127296768)*x^122 + (-129362297730888224368' + - '24*y + 542775176498979507958864)*x^121 - 542817871620722856854615*y*x^120 + (-1293622977' + - '3088822436824*y - 542775176498979507958864)*x^119 + (541321200409785903521904*y - 289619' + - '46371400127296768)*x^118 + (49231480359271694594387*y + 535280543629519838165745)*x^117 ' + - '+ (-521540559152841029573809*y + 72188367562634255595303)*x^116 + (-94381628626117531492' + - '779*y - 498937937395927788353831)*x^115 + (468998791431367083907400*y - 1123516627338358' + - '70233203)*x^114 + (124426493872813948801626*y + 435145712814328666799539)*x^113 + (-4009' + - '08655930869378612741*y + 131401561676926670933942)*x^112 + (-135773050794564515416176*y ' + - '- 368242715265481945864410)*x^111 + (336932852565943631529246*y - 1400977816381110614991' + - '04)*x^110 + (145501652264843306972923*y + 305326875506321100258855)*x^109 + (-2718432139' + - '37284128310312*y + 151199785544397594300869)*x^108 + (-155214006426713875482591*y - 2362' + - '55888142978579163439)*x^107 + (200019883617103704090631*y - 155735524429003454571137)*x^' + - '106 + (152261003156819774060466*y + 165525545074570372890946)*x^105 + (-1348368565280014' + - '66894586*y + 145826834678543169365085)*x^104 + (-138308631379146285689943*y - 1087117764' + - '44636401209940)*x^103 + (86443391588395703449231*y - 131288792905554584140170)*x^102 + (' + - '125222144899372880978343*y + 66535424263344578690303)*x^101 + (-47713396391497944676658*' + - 'y + 119352040791078382516354)*x^100 + (-112336281183122778011108*y - 2966695217392061633' + - '2098)*x^99 + (13121977610624125288643*y - 103143317388027280663819)*x^98 + (916711146590' + - '94334230114*y - 699010605156960463896)*x^97 + (10842803083053018739937*y + 7879882682399' + - '5559998884)*x^96 + (-65913386979565369752671*y + 17161940478911028975987)*x^95 + (-20362' + - '621509381561401708*y - 54254830555411448139989)*x^94 + (44442209345887020103552*y - 2163' + - '0493829993114594971)*x^93 + (22094525765620020809639*y + 36386527353264595233550)*x^92 +' + - ' (-29550558164952915082604*y + 22439236977615542871417)*x^91 + (-22809630522578701355929' + - '*y - 23340226072231874490562)*x^90 + (17408053637884918322314*y - 2298250426081989678138' + - '1)*x^89 + (22645379524677683996954*y + 11738628703873244299229)*x^88 + (-654920078477365' + - '7451762*y + 21617243705895522615660)*x^87 + (-19928654122136236656860*y - 21081779546252' + - '21499359)*x^86 + (-1409491575820818236069*y - 17768498236629148702410)*x^85 + (153786843' + - '94800615926642*y - 3975042669473795569897)*x^84 + (5677741559220425296264*y + 1296331920' + - '0223537566424)*x^83 + (-10654172673396879304988*y + 6660938661086516468010)*x^82 + (-707' + - '1251229918632950519*y - 8522145413937837540988)*x^81 + (6606218484397706362957*y - 70346' + - '33694928572084799)*x^80 + (6659475347960239461641*y + 4934471883467342725819)*x^79 + (-3' + - '527560907713404811933*y + 6046342849737077241029)*x^78 + (-5292413186031800428648*y - 23' + - '93646591871321675898)*x^77 + (1521006793930665203185*y - 4486769840934475059679)*x^76 + ' + - '(3701454711020661872373*y + 878419497758685431399)*x^75 + (-421763202246558569481*y + 29' + - '85437596461812106201)*x^74 + (-2362860273074857968126*y - 103875680474127044027)*x^73 + ' + - '(-116817470274758714683*y - 1837817520966021102844)*x^72 + (1401192440853964064557*y - 2' + - '71204181219921501426)*x^71 + (377925441616168009977*y + 1037951764481934863694)*x^70 + (' + - '-733125023480253537968*y + 445824632107486741239)*x^69 + (-477453708065915165092*y - 475' + - '828532275903297714)*x^68 + (260789110179489506909*y - 473346146286012258862)*x^67 + (435' + - '685264104825475131*y + 87230951613648934063)*x^66 + (43313688758928043819*y + 3704883866' + - '53834436323)*x^65 + (-287672838056258651793*y + 130006789216819808906)*x^64 + (-17501870' + - '0423712057769*y - 199325075624692888658)*x^63 + (117217186558944665294*y - 1844313166276' + - '62099968)*x^62 + (167559880460473073606*y + 50231770182088582728)*x^61 + (-2924482708853' + - '224503*y + 135200656059538396115)*x^60 + (-97526968113689340266*y + 24577168539715006795' + - ')*x^59 + (-35562575528916824663*y - 62321292808100809456)*x^58 + (34205385277277312731*y' + - ' - 35129207175233160758)*x^57 + (28534969871679714183*y + 14758677431499660732)*x^56 + (' + - '-3280308295039992672*y + 20013773166146345265)*x^55 + (-12280102244383760786*y + 2169956' + - '083918876046)*x^54 + (-3816304655625513057*y - 6563685064488706687)*x^53 + (300154949600' + - '3468616*y - 3542726921147289593)*x^52 + (2626931562224608194*y + 1142827140366519672)*x^' + - '51 + (-367443684968762359*y + 1741313178847717412)*x^50 + (-1120756441763956820*y - 1388' + - '05435659787599)*x^49 + (107554480539021407*y - 761016430421970356)*x^48 + (5697244732091' + - '47360*y + 104273935104641941)*x^47 + (-76920393658091100*y + 455669527002677921)*x^46 + ' + - '(-364966710997667886*y - 30164046307811567)*x^45 + (-15612945533449050*y - 2784528062206' + - '56846)*x^44 + (196220179915190037*y - 46078797156864550)*x^43 + (58047935399898944*y + 1' + - '25056052810735004)*x^42 + (-70367728073948453*y + 55368143890230595)*x^41 + (-4447118837' + - '6651271*y - 33091705261026148)*x^40 + (10779811934500297*y - 31310302362591686)*x^39 + (' + - '19596724151621886*y - 457971706716061)*x^38 + (4703077156935772*y + 10817923562329066)*x' + - '^37 + (-5112561845313059*y + 5258998337190094)*x^36 + (-4262623171412271*y - 19000824828' + - '75272)*x^35 + (347587448455796*y - 2909203449118066)*x^34 + (1761877237395113*y - 250996' + - '844693464)*x^33 + (371437987605861*y + 969565907346414)*x^32 + (-487486417978576*y + 306' + - '059642167156)*x^31 + (-203990291010201*y - 226088796680855)*x^30 + (99522339968066*y - 1' + - '18416217970085)*x^29 + (61143701295650*y + 42854297857883)*x^28 + (-18978818705192*y + 2' + - '8988343801763)*x^27 + (-12949633488740*y - 9667592872104)*x^26 + (5741131351957*y - 5368' + - '774573391)*x^25 + (2144907137575*y + 3501192827999)*x^24 + (-2100987167651*y + 977806363' + - '155)*x^23 + (-520851483678*y - 1249500770581)*x^22 + (692925090103*y - 282970748175)*x^2' + - '1 + (163182970660*y + 341901790078)*x^20 + (-156989267296*y + 100643285180)*x^19 + (-567' + - '80498004*y - 70327470888)*x^18 + (28891772141*y - 27706877778)*x^17 + (12761071756*y + 1' + - '0152009124)*x^16 + (-3266832488*y + 5793469739)*x^15 + (-2353679384*y - 1069498319)*x^14' + - ' + (294927621*y - 801098945)*x^13 + (247313433*y + 30224897)*x^12 + (19238389*y + 799566' + - '54)*x^11 + (-25462020*y + 12961894)*x^10 + (-5864817*y - 6566480)*x^9 + (1438139*y - 297' + - '4605)*x^8 + (1415485*y + 635208)*x^7 + (-424808*y + 438197)*x^6 + (-40904*y - 178707)*x^' + - '5 + (35389*y + 20411)*x^4 + (-6344*y + 983)*x^3 + (499*y - 430)*x^2 + (-15*y + 36)*x - 1') - - self.assertEquals(Q(-51, 3), - 'x^6 + (-2*y - 2)*x^5 + (2*y - 4)*x^4 + 14*x^3 + (-2*y - 2)*x^2 + (2*y - 4)*x + 1') - - self.assertEquals(Q(8 - 48 * 3, 2), 'x^8 + 9*x^6 - 16*x^4 + 9*x^2 + 1') - self.assertEquals(Q(1 - 48 * 3, 3), - 'x^20 + 6*x^19 + 24*x^18 + 46*x^17 + 57*x^16 + 51*x^15 + 37*x^14 + 21*x^13 + 12*x^12 + 3*' + - 'x^11 - 11*x^10 - 3*x^9 + 15*x^8 + 14*x^7 + 9*x^6 + 15*x^5 + 15*x^4 + 6*x^3 + 3*x^2 + 3*x' + - ' + 1') - self.assertEquals(Q(1 - 48 * 3, 4), - 'x^20 + 12*x^18 + 6*x^16 - 5*x^14 - 9*x^12 + 17*x^10 - 9*x^8 + 6*x^4 - 3*x^2 + 1') - self.assertEquals(Q(40 - 48 * 3, 6), - 'x^24 + 4*x^22 + 8*x^20 + 20*x^18 + 32*x^16 - 12*x^14 - 42*x^12 - 12*x^10 + 32*x^8 + 20*x' + - '^6 + 8*x^4 + 4*x^2 + 1') - self.assertEquals(Q(-7, 7), - 'x^21 - 7*x^20 + (3*y + 16)*x^19 + (-22*y - 3)*x^18 + (64*y - 46)*x^17 + (-80*y + 89)*x^1' + - '6 + (14*y - 133)*x^15 + (57*y + 244)*x^14 + (-56*y - 259)*x^13 + (132*y - 3)*x^12 + (-31' + - '7*y + 204)*x^11 + (317*y - 113)*x^10 + (-132*y + 129)*x^9 + (56*y - 315)*x^8 + (-57*y + ' + - '301)*x^7 + (-14*y - 119)*x^6 + (80*y + 9)*x^5 + (-64*y + 18)*x^4 + (22*y - 25)*x^3 + (-3' + - '*y + 19)*x^2 - 7*x + 1') - - K = pari.bnfinit('y^2+5'); - P5 = pari.idealprimedec(K, 5)[0]; - self.assertEquals(Q(K, P5), 'x^4 - y*x^3 - 3*x^2 + y*x + 1') - - K = pari.bnfinit('y^2+5*12'); - P2 = pari.idealprimedec(K, 2)[0]; - P5 = pari.idealprimedec(K, 5)[0]; - self.assertEquals(Q(K, pari.idealmul(K, P2, P5)), 'x^4 + (-1/4*y + 1/2)*x^3 - 2*x^2 + (1/4*y + 1/2)*x + 1') - - # #1633 - self.assertEquals(pari.quadray(-11, 3), 'x^2 - x + 1') - - -"""**** Original expected results **** - --15: x^2 - x + 1 --35: x^2 - x - 1 --51: x^2 - x + 1 --91: x^2 - x + 2 --115: x^2 - x - 1 --123: x^2 - x + 1 --187: x^2 - x + 3 --195: x^4 - x^3 + 2*x^2 + x + 1 --235: x^2 - x - 1 --267: x^2 - x + 1 --403: x^2 - x - 3 --427: x^2 - x + 2 --435: x^4 - x^3 + 2*x^2 + x + 1 --483: x^4 - x^3 - x^2 - 2*x + 4 --555: x^4 - x^3 + 2*x^2 + x + 1 --595: x^4 - x^3 + 5*x^2 + 2*x + 4 --627: x^4 - x^3 - 2*x^2 - 3*x + 9 --715: x^4 - x^3 + 8*x^2 + 3*x + 9 --795: x^4 - x^3 + 2*x^2 + x + 1 --1155: x^8 + 15*x^6 + 32*x^4 + 15*x^2 + 1 --1435: x^4 - x^3 + 5*x^2 + 2*x + 4 --1995: x^8 + 15*x^6 + 32*x^4 + 15*x^2 + 1 --3003: x^8 - 9*x^6 + 80*x^4 - 9*x^2 + 1 --3315: x^8 + 9*x^6 + 77*x^4 + 36*x^2 + 16 --20: x^2 + 1 --24: x^2 - 2 --40: x^2 + 2 --52: x^2 + 1 --84: x^4 - x^2 + 1 --88: x^2 - 2 --120: x^4 + 2*x^2 + 4 --132: x^4 - x^2 + 1 --148: x^2 + 1 --168: x^4 - 2*x^3 + x^2 + 6*x + 3 --228: x^4 - x^2 + 1 --232: x^2 + 2 --280: x^4 - 2*x^3 - 5*x^2 + 6*x - 1 --312: x^4 + 2*x^2 + 4 --340: x^4 + 3*x^2 + 1 --372: x^4 - x^2 + 1 --408: x^4 + 2*x^2 + 4 --420: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1 --520: x^4 + 6*x^2 + 4 --532: x^4 - 3*x^2 + 4 --660: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1 --708: x^4 - x^2 + 1 --760: x^4 - 2*x^3 - 5*x^2 + 6*x - 1 --840: x^8 - 4*x^7 - 2*x^6 + 20*x^5 - 3*x^4 - 32*x^3 + 64*x^2 - 44*x + 19 --1012: x^4 - 5*x^2 + 9 --1092: x^8 + 3*x^6 + 5*x^4 + 12*x^2 + 16 --1320: x^8 - 4*x^7 - 2*x^6 + 20*x^5 - 3*x^4 - 32*x^3 + 64*x^2 - 44*x + 19 --1380: x^8 - 3*x^6 + 8*x^4 - 3*x^2 + 1 --1428: x^8 + 3*x^6 + 5*x^4 + 12*x^2 + 16 --1540: x^8 - 4*x^7 + 20*x^6 - 46*x^5 + 93*x^4 - 114*x^3 + 92*x^2 - 42*x + 9 --1848: x^8 - 2*x^7 + 3*x^6 - 14*x^5 + 65*x^4 - 64*x^3 + 46*x^2 + 24*x + 4 --5460: x^16 + 9*x^14 + 44*x^12 + 261*x^10 + 1029*x^8 + 1044*x^6 + 704*x^4 + 576*x^2 + 256 -x^20 + 27*x^19 + 601*x^18 - 4014*x^17 + 9878*x^16 - 12222*x^15 + 8299*x^14 + - 513*x^13 - 12221*x^12 + 18036*x^11 - 17652*x^10 + 18036*x^9 - 12221*x^8 + 5 -13*x^7 + 8299*x^6 - 12222*x^5 + 9878*x^4 - 4014*x^3 + 601*x^2 + 27*x + 1 -x^88 - 40020669926358941160*x^87 + 24818793423306608856949584839454391158484 -*x^86 - 451973748435231895940407803697160552367624*x^85 + 121004331374769746 -054948634032289469332999202*x^84 + 10059034519705811655247252004833057160111 -397504*x^83 + 351284965440856373689297063590147136894509846260*x^82 + 707678 -7287183022340559185242964779073439110772112*x^81 + 7424864222152380159098443 -6783829317747047323123243*x^80 + 3016669049298212175376092685252207677089225 -7842640*x^79 - 8503049963424563714394067134889147531482230019127096*x^78 - 6 -465786499366041070602916523486769538280412443510592*x^77 + 42150640446078238 -28889410160434091263108115351306399268*x^76 + 119525498598846149476451596656 -291689313170011135603889064*x^75 + 20718604339256925426029633374659465824208 -08944831769026648*x^74 + 270442350108592451558861828173327053458397647311211 -61439752*x^73 + 285289444253762620585561596576563633155859094294552566693317 -*x^72 + 2511360320483460798105377398519192324398612242438706127652544*x^71 + - 18767162620094934148004508464072766541604227783326918296860524*x^70 + 12042 -3236654140529086575067911655764408706511359484732574173280*x^69 + 6698817371 -51097381424117880193907743151768744395737304965311638*x^68 + 326030488372458 -1257592451461949148632593587481718123636435123040*x^67 + 1401218174432359703 -4445628272252822116949974099153581386829916444*x^66 + 5367567444185487660948 -9208131197694348596313231643993076280314304*x^65 + 1849586073448214933624859 -71605260396892443743494472396759635803315*x^64 + 578456213592452525292885126 -678569328965911834184953238551507495512*x^63 + 16556817033476544452278210145 -76515450466671643615335188802513429760*x^62 + 436878840618787239769625306249 -7812500894047454768846457782824580152*x^61 + 1068901472860957747029160191079 -1767817886254017900185293235705392064*x^60 + 2434351573155431230076300160060 -7496079487124511808873652848483412160*x^59 + 5169291351655811457272426459136 -7158576380942435990299052219843612304*x^58 + 1022998330750281135258911239455 -74251052215437006684583051817380710576*x^57 + 188216797464058241448403558395 -102741401235865324690992824034126437157*x^56 + 32060490325705765556225025226 -1154391117300969466803557524988405580272*x^55 + 5026257120330186308702396982 -13303008551061011852403188260952091908532*x^54 + 719344126023656757735145641 -575616692987264009491520118662670217955328*x^53 + 92863816021928333070040902 -0325566534550048821651703177989079236808666*x^52 + 1060255920795694954480037 -612092276836813066528658822564102146651872808*x^51 + 10301589215685511855337 -00012926850740762293883499745887488519869745108*x^50 + 771562428494427189300 -153767022260995609490878443644218508155682351496*x^49 + 27346597807333111348 -9250648988966144580871198921998690911757680224167*x^48 - 3923005119785941970 -23702549831167038133623220261146198494006317061248*x^47 - 107531566077276356 -7397744183394797701786847214693166357365831146616968*x^46 - 1589451619928021 -606930471659130946568147974811578111348229080651241920*x^45 - 17807285584553 -57793403089789263493950243261264268279117584476244784076*x^44 - 158945161992 -8021606930471659130946568147974811578111348229080651241920*x^43 - 1075315660 -772763567397744183394797701786847214693166357365831146616968*x^42 - 39230051 -1978594197023702549831167038133623220261146198494006317061248*x^41 + 2734659 -78073331113489250648988966144580871198921998690911757680224167*x^40 + 771562 -428494427189300153767022260995609490878443644218508155682351496*x^39 + 10301 -58921568551185533700012926850740762293883499745887488519869745108*x^38 + 106 -0255920795694954480037612092276836813066528658822564102146651872808*x^37 + 9 -28638160219283330700409020325566534550048821651703177989079236808666*x^36 + -719344126023656757735145641575616692987264009491520118662670217955328*x^35 + - 502625712033018630870239698213303008551061011852403188260952091908532*x^34 -+ 320604903257057655562250252261154391117300969466803557524988405580272*x^33 - + 188216797464058241448403558395102741401235865324690992824034126437157*x^3 -2 + 102299833075028113525891123945574251052215437006684583051817380710576*x^ -31 + 51692913516558114572724264591367158576380942435990299052219843612304*x^ -30 + 24343515731554312300763001600607496079487124511808873652848483412160*x^ -29 + 10689014728609577470291601910791767817886254017900185293235705392064*x^ -28 + 4368788406187872397696253062497812500894047454768846457782824580152*x^2 -7 + 1655681703347654445227821014576515450466671643615335188802513429760*x^26 - + 578456213592452525292885126678569328965911834184953238551507495512*x^25 + - 184958607344821493362485971605260396892443743494472396759635803315*x^24 + 5 -3675674441854876609489208131197694348596313231643993076280314304*x^23 + 1401 -2181744323597034445628272252822116949974099153581386829916444*x^22 + 3260304 -883724581257592451461949148632593587481718123636435123040*x^21 + 66988173715 -1097381424117880193907743151768744395737304965311638*x^20 + 1204232366541405 -29086575067911655764408706511359484732574173280*x^19 + 187671626200949341480 -04508464072766541604227783326918296860524*x^18 + 251136032048346079810537739 -8519192324398612242438706127652544*x^17 + 2852894442537626205855615965765636 -33155859094294552566693317*x^16 + 270442350108592451558861828173327053458397 -64731121161439752*x^15 + 207186043392569254260296333746594658242080894483176 -9026648*x^14 + 119525498598846149476451596656291689313170011135603889064*x^1 -3 + 4215064044607823828889410160434091263108115351306399268*x^12 - 646578649 -9366041070602916523486769538280412443510592*x^11 - 8503049963424563714394067 -134889147531482230019127096*x^10 + 30166690492982121753760926852522076770892 -257842640*x^9 + 74248642221523801590984436783829317747047323123243*x^8 + 707 -6787287183022340559185242964779073439110772112*x^7 + 35128496544085637368929 -7063590147136894509846260*x^6 + 10059034519705811655247252004833057160111397 -504*x^5 + 121004331374769746054948634032289469332999202*x^4 - 45197374843523 -1895940407803697160552367624*x^3 + 24818793423306608856949584839454391158484 -*x^2 - 40020669926358941160*x + 1 -x^180 - 51943580593235209115083942712389400740668999369044471856895869572767 -632154790719027854950985687*x^179 + 2547067915519807589841747083394507454979 -0011527047653789753822310509943417124290253283094780925633779566003695241876 -25607464220675698078104131248853904115685519116107718359916443145223952387*x -^178 + 856553204115408701571995615320558014258368114267533599476048702248757 -8902931990647387774030794984717551258507939754932426394582122894184128382067 -3569718022270291080598668993546776793532380154605306*x^177 + 762080502049470 -4596056107304576599883142953678664313128034639146864833136453854583485947432 -8177873097803164055573630934557797549232895603414584717394309407907786380469 -1683834066404398393999145427753183790*x^176 + 308956387636466960153212938167 -7324702311668880384172270669030644914696644648416192123216702361395347555520 -1495693461977412751821857739072346944409047470651675235147675440424833117756 -620892810879743135932320774*x^175 + 4884082662966665508762665969667649569784 -5383873744492103182446854649967702283785050616521253612447115822047297077954 -9614257317623478309277167745811150568304415956966429217813229788441116863100 -4611840186992685967179*x^174 + 124005751296377747143710892598982088036932674 -2142684503704154223658839486788375142268292156393058732202380086677633411654 -8906703591687073852643697697716348962297583421466683339923965234468615997649 -73368284228647193399*x^173 + 77807342164244792507055296791047457009683139076 -6947550930281827860194252415153283906741350015821421760488076097868784697023 -0684361377176470035198102530788844464458277074023468487612291349831916437723 -0037354352780222249*x^172 - 266780829858115272388789250462200876445272313022 -9458822467054384295379499065005972497338635889603051515741573734931874924695 -7762408306245748926170958653384087543385833522528441856486249210097660034861 -41241557823792412532*x^171 + 14828387316468627026106844845255173547861518903 -8589804985538974108300682790820861191991101023068971076505863346789787263249 -0126030705881134291752595991307720023292738164624564498269365143236280388326 -494814603159167594322356*x^170 + 2072714630254694525113015470563866763470442 -2896220054319081495621750749375349838158314700070013284414958575563065629489 -9298590460673967042987581924280852650108640761845803254699501956119005286958 -261737898381117495750422003980*x^169 + 4082791913658668250669500487553396688 -5085691856416081922391794020222319071345465620337482939902695391053957179581 -6611178564058054521757672875527012214760684410920857152888054853976552319787 -6482624865506579220641586389147210551*x^168 + 259189082653047933938409996483 -4388754704904320561628999269016762833054641395201768798413743705844841716523 -7122469823713043234758088183799986341785098434142194216335145773402440120312 -8996614247360365624068492442391061043753826375*x^167 + 187953325502846394560 -1845576629993961992277419183089685715578164443785846738744772926323542142109 -3239442057010359289122214569790614009609800219235849343052099855997036406115 -0923659276590113217049579865275822653265241753456459305677*x^166 - 991521344 -5331010597888861249891641758957210552260378821158082129353375249195112911754 -5101896722210096101308894624313777264446536224444928929934283573873319884763 -96421078624456037269503565600020449431475165029149896378441501395456086*x^16 -5 + 870693463207410936114722926699616258456056310070174066271951439226764821 -3754498248686363880077592953938815295745097173153881494887680426204688519814 -5897926708879854493196612672343274340176910775178567635481360192954408109761 -462192666*x^164 + 3291269524452623301119531480681600174871375032940729132937 -0111633092058003369070348946123426594086592059620504463833497832222752798945 -6786539655327366403796168376108709100410788811433213881703418728731545343808 -0442501304279059153710266*x^163 - 484246978651008470853848049302633937841710 -0550099032573348884254048698254002568503682165709558099310997622779159632947 -3025430835921039731844769840401840637061784295187888579980063280775750740026 -326213445261209232925320378956182578938287*x^162 + 2366596557978274147475255 -9694980204169227021539516608112189319106501133980328077568567038119905399100 -7262473707379165967733688444634721899783534252243520926838729652205328556398 -93844358125373580233579396300331967493836532017339326648417*x^161 - 17861170 -0215272735065228998593221635895564621730723507909826896490382687997403628306 -4372396936244334959016553113715105764010891971421665085465778102274753181053 -1359367179288752406620535700142801097476915172283884503644920276078920893715 -961*x^160 + 5442886569416213072883949195207003561672975168183342200753916623 -1352236561897735153650345477157913505173224695785900066453147636135746522196 -8827923591138659172463973059604218652821751160134239388400400287612441644522 -959559654240096950196384*x^159 - 1878459194456192332344340381238953837099207 -3242518317157665963817987346890603378811086853859511458448823118145390556032 -4154260960085054869261002833248663395080605671172589053299559751809388877985 -0319337022684143396368259434426190698508218580*x^158 - 184127686942437509991 -1682977301117955663562464265148547217904344728959181240974449884065092029207 -1219636898969097801966235466592457246648086083637230209961453625153292993135 -3654541155851737335657948991190630601809654864812836013412428233332508*x^157 - + 6272745337714289642780597731451440214649776184728899306566105704002623998 -3846347725688034820317498349655377903497224390190783460776334008364647848917 -2185092927745795075828017034702156144511828098427591206009505705409852728295 -6922223630676347544*x^156 - 130604497267883349741727434418972048161536102040 -0079797720405754446746742329603550983122106752795162131799337624121456619065 -4040984420476843424034832196407821304821044910660899700295392042290695059542 -0192036616889048813209519926849958791965413764*x^155 + 193926478941415365968 -2053039191650223015193274556301436638340272814361000782491228757908126714135 -5744831221609082890601733276886531625139761625422579999591146356457708488690 -66496229883200724281039999541182828857613242844117034223500903997780849964*x -^154 - 208974081851580435134258388853435474877812078509775426825496895616316 -4247844796032344219123951883470813854035626246176679417061266672681500232259 -0819881630082047200072248185982748889171705144305698252911851141436968395735 -658717414968653352018931248*x^153 + 1672646641882017449123000870294181985430 -0761766363953593948968045530794890931499833945021531203099422476121576329491 -5115325960697513628674724029981734640823975379662772003784140453861998461512 -834247290509716832865395591217427305274661390000337103156*x^152 - 1133671449 -3365295420476716878286616778916616227898741966819659317216135015136322466563 -9827520548877905001507920274192410200096811676503284991805981968482979122155 -1667739765953276248859306767909175625527281202034750975189910458947747942582 -531447345892*x^151 + 9686019535728726397130721344019529061590234306774474243 -9775684839133142925738217830167297947427381690011105467748624943273307935251 -9499655312785116384255798310740712404573339361423884780107379495371631287103 -7645627569348897599991117672316256550430096*x^150 - 119041422102704367724958 -8670984575013578769595187713509039012506017888268506357273229685836102923546 -0042880742312037127040383670254597841508519424535302963725051506007472454825 -8974287875801351389617602402488639578930420752407411968308213028222350043652 -*x^149 + 1390123122192263005517637294725114792837919558648428420458046731138 -9247265920089325134952307005121333495864776226593824308305802270042865765522 -1706646232757561716861576911604612712092794424651617086755060497490406116694 -4942837594012909743669233042838778*x^148 - 123556176727604048392495454055977 -6399401450331126081896858806346942631913417189093648332266104142047071085393 -9823740200206373338590719973268754644225041558662153246796876936041537325415 -712055287848699094590808089508684909536725801531454334504662219155298*x^147 -+ 78338857321405672298333791473025282082268588399811517655878927064487660842 -9607987213338588537735184368455093544029691810855962878302724567812912958403 -0825298526758499964573195767901492416707505928731723979119497738428625056534 -2370732550549861221973628014*x^146 - 337429582052616696434247676773381390391 -7055420548509812685321889562165936397719575630122778103303140528950818170117 -1026255806634894861047352747650017243235019037703269391120793396636598558834 -3500355068020592838333693543614719695933939552850201760137124456*x^145 + 126 -7022512449095517765635963857489440320956185849532448394191453064873093377283 -3265337003928417799194535821386624283453961529673399508105934582815314275613 -7678638219426069444953840237686338226443443810754745407998159540925231095791 -4375045407870857103723132*x^144 - 153719609646143637199240438779331521362833 -0310998022856189520090149655383700607165028197046414621578662674582267335714 -8666559983310416796564643262431404031085708670498514131879172395315308884725 -086995597751964859239544450069420287019254955379338574827976392*x^143 + 2752 -6304730305492309519611803297873567100995379403820014027217572772469997269963 -1748009334990330332456740707557146239264293783419594063347012801512753255648 -8881765170905842263824483323437412768565907107652500759762684840263032684703 -37380600828996170962184046*x^142 - 35523095157828313337139462591351702816577 -1657314332343178845563474958542277571903631744992145135630234735095041102708 -2345107273636547410151070834277389339249300538652341339871040322822838485719 -858336476359261521139254885461283464480406069617193177086233150446*x^141 + 3 -4465803554989246489275769454764022910035142135182748059069252044933640478411 -7307420416885830806110765171489332421312130211574457885515807957701177125587 -6661225789242989640797022695297712572706533434600560766081391785453226598427 -1205078552129981020849945722662*x^140 - 268373722516115839581073071008494919 -0456447093682830001175926782807962713700083271168738651540876330140533486735 -6212670696857859739463338404796759488859624213038265846572508064515479105995 -6333436847011768914542767112707721040710586854450242752202162514502517912*x^ -139 + 1742444297891369493991077844263622734267621349666334184372478600323885 -9274274057411635646353155281298451648136704209002938845039923935043096379256 -4945721786177563429720654144039386133241554831725367065310144005542392522004 -1645737733894132094639323829473024157820*x^138 - 963039078892037951990470202 -7468142690696595830419680618831266273162745223389393610063433083213953579433 -1498149151107810908751113241849208570338521838179678717281819508263987198750 -1951924824700995996767534695158748257780864272656666861530432230128739030598 -8300028*x^137 + 457447376242160839222865523212081512251204172769554541536513 -6010675335568757571514112103791600745366139173664147588418919365588570555754 -7201003803879915712080042312095406320055413204732204964260573379515119902554 -321889204610298573371864198642424001195728006133182*x^136 - 1868860578136529 -9491100566653843653174297026478659238845320831747624530880395790502643308730 -5462268585078679776019946603866991516563272428283420299615035631054324035580 -7669631492489263529234747091359176119230324423792605912297491073916656362078 -32174634098946284598*x^135 + 65093076668803329116252899967129264121954195081 -3165825173825622033622982444205859242607493663511833086292972086895883603422 -4352287091011138657074487961579204189764700353920301472872505685227133477493 -45517047708745645767806883427498415677547239236298519819304443846*x^134 - 18 -8737857214948682414768736751123125995536055732425264657481481197221465136381 -8263080004881765201151009039934832304971738613022285488660591980899059758561 -7366670880266091842937662126151457793355558304191543211766144762254313419741 -75714575265820939899419742919508060*x^133 + 42953889394645520155740965583894 -8254975167613584775116826651538942451816286881091436166450578237021021126058 -7376408754507104013237607018922017023401049094197048725524392809860540776061 -0681787413121689140926769612819886834513469809393226136437731088172895759675 -25206*x^132 - 63261727328918865906350940397161109868277289808692349026207015 -7309911965921420948111081525007085507792610014228611379115265836635218591862 -4482685303352489099685390524441351132050179570452776530090912230189731431879 -125807895290459527651483474680605068851138729175634*x^131 - 1119917054839792 -2751688900486058857057243360132605635779686384574213339264438353376214516815 -2207498910643644483743753772520064969246600402986900436948848152659373181329 -5043050789946887406470007794027558566892567839570362080341591028664006259784 -979214096682612622692*x^130 + 4271314220049466852560738338393246245128105321 -7108326600567680720579375803199815405014779522998261575404021302604267102318 -9973496984002749534274370752056057799997646445393423249459072172570153388076 -90270224780252688493775073451490812831750493851260007482523315136586*x^129 - - 148023590100710673141860886464816208028643509093283015533625006596766946972 -6741578398020050334876578221252235677233082465182051389340632694789790351225 -9115953643872578590861494318898368229141353955324644187699428307147375218229 -1248178529493117079561875143739124185634*x^128 + 246175641614565897679653848 -5278045743286736401969417596627545851445013857575343959525966011452777041860 -1869322995580927692188758796260764328940765798775338277071600497396412898284 -6342663264119335560750008714258096212502569271025201095741906534219351860811 -124404494196*x^127 + 1990565893680671595442880060323376805411690898242032023 -4239133079106312028397798694740007864603898415855926572783576585034622967997 -5575446479539827712484639591071048813727255731760017261708300771575388890158 -591817638333201062459001177511936169630253047386566741135222*x^126 - 3016573 -2341675486865253308430441797191448447887193219597832133129727214089635223501 -3420645212244383261917032590855201496548201420356430642227248391186457171733 -8876314939133108407277975244227776960656325124355051502725255975073566061339 -620994099300340563608380613367050*x^125 + 1257948144362960333134666662231940 -3520935251787268873160231319726921665830921964289640164226960267401382195941 -0507546787902030963701849030258171787071185516798073095493413189997247441301 -2363645824641255038770075189157898962912949013449974648054148641764400320533 -8871882*x^124 - 366475271260105058017315536083033948306360270631496526170966 -8533370069635382315040133597595175856841519762702237383805014287542574172530 -6210807276260801506088986006283626986882464595447299254658758485568943925875 -853699462405048328247959368186852953798221740253247284792*x^123 + 8471667404 -0018254168541029547267006611224730675524513635334023354380604251758054675593 -5413776225446989659313910683079873583112382327573250917778108062870743163021 -6965584066720515779759514188951805094972301673794254962048375194153324360075 -8727975735045108792516939770864*x^122 - 161146935717428461799784793801173853 -4799737191324944707968337975196134044400893575466678041623869973266066574271 -1435647219232676062975775017270732119064549881937724549671623652481177104960 -6102487507016989267838733791065664530366349655384775511706599600386112512946 -557632*x^121 + 2522694849864480951479825412582961761101029175375006299005032 -3620295897587695065324670940000207944207812042399077482469097012869133985212 -6354595110186421998141347799854111539239085705015451817020704883026517132793 -698058647769011690212936405831828960609809154392310067086*x^120 - 3123954350 -9500414655822246820581466016766786100370771446195101114970617420873338985187 -2315673998753642061765284674623730429562551231647203516276142369010876697525 -2061798837483708658347309888670578337964579148520979957165473678360131302986 -17785547855899873691057926811306*x^119 + 26093073450128435322247521043157618 -8712392067239030279298185926981851613832003883595362112194063431825921469777 -7131659026396971729721032938463093179955600695600080670675651357367571081793 -3768796854158042814794986008423382503555686761603718155957955520619915926285 -1046258*x^118 - 546620888417310306456913297002373587712583541328636451073449 -6886209350963457906027266059482196156973048570086277940148682564568467798438 -0285254978737341206009503937974698380503149962544290779617099637261387918629 -06553536781663415296571417609896418531671323802662549340*x^117 - 50182021729 -3272384861232464186597002893681068429473599603378492391207630929901153313074 -7556376877685127771266174954090809732508146930392545806488414232849981602588 -1335383921214771830072947665323419883309028215410288472590477875403748309525 -8171403839074803113722901930619*x^116 + 118406103336876158577917454186709740 -5449294198484094378541103762383848536861007244183348157579457933081098099434 -7987985778741196393539613217121527222032672240767536916435194526743758819619 -0063225181878442213678933572194923238652257406338724947439730929871504295850 -1899245*x^115 - 176734272677759520180709847378647130652166835479092271077232 -7067981192822476939413912953115815829947318808933249885514336602487836197536 -9611127131928890515684844943744748937382837125994011164383657897820620204611 -77419977223148716322298719262705865767989172293892727336803*x^114 + 17753024 -8530519942716171951800965388948822797211110233322549229100349316200278964800 -3343785390491378071036048329384421918922891522117638503012421231548652255160 -9599399433846703918342084346728100760000876417162144138571778762943474072695 -63098844605653811371200441716482612*x^113 - 68055808039422415389652936779491 -5026270001374161671086886435342385993661681436002138177107204224273906832078 -4550021770688659201646483026969760576245696112286845508450285259619203332272 -0607576466516522822599227539775561873960850804338603845784871088630793662781 -4494090172*x^112 - 171345855168993153971261857965957509597335839923271917993 -0591415159154748543112880240425751510004701705465610982555391151034624958936 -9879115829869566643976034053215829935761929815383663545384160654490729816046 -26649741228358475390951398611771434975819632467920927623648602*x^111 + 47552 -8035498943149856772358089912005247194452214038396267610512853006205877224336 -1926512880782786766025384282981294577511242497413537295024045772317451006411 -5818078293866049727834002439604775548744427611299658913382859972919684056285 -23953865800092933414124830547621130787*x^110 - 67242845398127603346764378735 -8630417913935967603492325560313387832908161625682986070993808856191981689362 -7337618874976711707752413017492294772666895660870194024839210050819796389750 -1107885069331081963929674153546422780993129544541729439872603263786386221427 -59365186532673*x^109 + 55277967193070494108505087891929956655236889687657826 -8175977451438771610569912425740087266827286735858716699401268464277514456005 -1393232906738794805715412356740750890873873435323228244674952180988795091974 -844777831874994317609349719963129292674653332785827444869904448205*x^108 - 4 -1613159149582603037007821378021268206873842361757130321500129691291418451571 -4472352328413744363607247454062853765212695133675510221970937823367502714872 -5264869179155436190999803707918965482858909915679294544758294286168029187155 -42674704594105656661109974298786084926216*x^107 - 64968550520798695907403393 -0416095844971770756779773877908365468264830766792721054670459397639118998550 -4854765543268865886038920660387928909044011453689430024047009170672072811027 -5782636138143658008315348604258233043465414839888086317182504579245353574551 -48087384017967480*x^106 + 10988704303885892826315283975311210242722783884449 -6602821133827001873720461030281740372523131562861261636562127194114761297380 -7567084209038324237434507186912029498523360122835533024309739840677831689412 -3866277910335992520712968840312446267340837533424627065123680989778324*x^105 - - 1037769081322395498728280928797930421673181636784651943232652987200370379 -9887100753154281880152957110034253066824316513009332837888828809575782813589 -8395431699875068691882278140209738486991188655032931569583339555950811469751 -14819216369493334147767991300084429910831005417*x^104 + 69810186616581919293 -4087787107108500858284600224749854536503416055380938630777674032345768445107 -9032740625501338477163577149719360331436837611189692791831261366092124431433 -6123841173727343108316374825964917374812406255193704152752318584125714566685 -03155908009579048097943*x^103 - 62618742936856051264116083169826991776205278 -5386210430790988069604384137878194361389699073225403863192706786752381073990 -4629809810678656127043145873535279223707645117591581849318483810783264428888 -878968101286898381392510682070079334990623735577742545874102235967038827767* -x^102 + 88547713577136747022744956480711506392268841458610902634308115200722 -8001393811863713127092848888453031249274119846056297769374759830206187529701 -1903856417069237945552069729259203293736154678785007420066778201855082685563 -641521979888163226986534911148352808279115809917358*x^101 - 4630158507380629 -2388093315791533391137484806668109034703107450628858742143410102799736933423 -6907074978067722826731138207487756769203481925052544349731537665931451375605 -6491082785764360244007240454153410730447743408991269401214809728107755411693 -172395012634341107448006498*x^100 - 1987106430336286502255096633621975778269 -2749388116010785359867801694785712027822174277716791024889732874123796999017 -1165326722657523135611227287116367063127157679861619224054599116072941563451 -0018552431779605085569288059085092991937490866241369045567079522410549051673 -8430*x^99 + 6116111486479868423461963851524196927490094772654137109281820240 -9655601335862868609893744275312622546677599324483201519748792880440223783865 -4698142956751915407410209991596924924552268184253687896341372281276522326101 -46924043615114529192462392320461821295874662972625510705*x^98 - 858543407202 -8582480876325305001979394403680268817452625497746550339718414937826890236809 -6758090513332370728027354524452052318746523877507900393006790670253886201007 -7151654142173689494119764321155798594114038476768325934248961469594904974057 -82950778627016658691250674749383*x^97 + 490657445429729269017920968754688301 -6620517611911217595219014813015157155188541123765870476789021829481317185682 -2346556428383215072814614042291152340886085128841976463982340477579191182175 -5499560251631802981685749888173758813318700520169103214089237413133223676806 -81136483*x^96 + 588480356039113348615320015128938548650997950279831325677040 -1070851758771375890193257175605171144175873327958813862484089151772708967824 -5090710382325088735952719657758536202632425695397040762304230638936597396706 -141037241892685559313526162149365318736429347633086308123732*x^95 - 17860801 -0792691455581088588394658008616948993017279794644452692311940825238452683644 -2319855428360563553746309477403369295008059059368147822762461583481089204503 -0764049052795948146830428753094428042821800841448746792034840653376273350188 -2132907610936220993092559868115464848*x^94 + 2080698898949934438755286742414 -6744709766506973468237223938818775848985645787102709849630670421667929387077 -1839075966340916755041077369098858794090822988106295163721588178394959186872 -9508222800790599280424915420728365948473247641413622178547384599468880111768 -92625701864148*x^93 - 855864218009308575944636024731111359775112255204531345 -0227262959123310950664276060293965525931786616911167403341188615339530286675 -6775269831884121745448799689118137607558616438099756213430487533482486835346 -075682903923880766231253716972279618549611306311532332784130069552*x^92 - 13 -6808840532983525733371616856915983783270410509211401019532102689258560876086 -9527424128221769318567475482882108641281228508725452571176264919548871309015 -8567261995935441375507973903437038954795573527871968541716126334097932463611 -5855437833626026464694567238228672113384692*x^91 + 3083618181674886298656898 -1166117178805224503007958449196073139881830099761716540415100166992970870487 -3373126707079788137630463247890473378063608477167239399012803238136948080412 -0312330266139820196748423629961267609185986608819581540758534872341667324689 -62725982670350394704*x^90 - 289813403115309877208771459417444034084104076525 -9424539591515173961928303088393009380304940043691096832523560373895822112785 -5808066054703063840814273369617911574459101343616657558236169574623914019563 -0152780337575962071156042744164046198739767637262303611768624103749962308*x^ -89 + 72613516630962625965473064217525199676649443527570426575481770740043888 -6779646591936295747831851104939101651758342323554432645301127945581635380942 -7667424563537772502070799105048465507245059623491244896462413185145901940314 -5696053808385861551596378474452839548918080875392*x^88 + 2007137579167957439 -0719911721927558340943820520648172319420534796396724837614574044411853430783 -6722420021463109835306685189533078441109841798470591234934768692554906817588 -1207883501035322616933512472492706367178783380343756988188031103657790713917 -44233368892636267232901060*x^87 - 341583527690850438763926482860330447741875 -4305316360798807536901393938873869395520682617524619723932218997197449552997 -7902796418727196784273654618816384850023400797434252298928612530838816162641 -9574193744111685493591811397803624718762999077541037470623557200013418602943 -344*x^86 + 26018106816532769824515089189721783374074645569591071162155828403 -0232272450337410678138897855399057733160129008028400975157648521806369052132 -6598794386401757044711814737218799723053160173284842744313272283592926991658 -43454191912138368855662104946473338105764358284022377572*x^85 - 285687497537 -0233084322274278589877961032877493803575239781590446839383349838850110790540 -3648812210524131836405185194224569727115488819662642038492004860753207681555 -8064901322408777764393214575140844637199884061193474482510361153824419358509 -00211274244171508240172003554579*x^84 - 185573110599032244389576804101570527 -0843481327670529736455724859117579642729259313496498283495085435901054470028 -2535196961772216663035884293412871166129440632779930980074617184610893507366 -8787347778013694399060652311121162557391893749324368007933315027120013043270 -445299679*x^83 + 25050117171467230890654410834087578617559538489554781281579 -3157881185513898265592143907721703598168076058572348175071967137401886379765 -0888321554412070999395502650926168357968511833244292802087783872357923454661 -96695362647033860816591741894381954763538781291764410558313991*x^82 - 156624 -0805166486574430551541640026858587070051407347684313586931160679067646271535 -7829110559493831623647655992465253608722147473274284815377360979913488645232 -4593004096825642014547164807256580851492214151707379016954878586353260655456 -252800749153240368998676635038282783458*x^81 - 11012223211385811697215073324 -1921762613953353874156837170764058477228457541142548719349032469796569578235 -3672680465156231420291792630380279912309212851197963260878119761617542365940 -8318430631980819407521411635240395800739279192347581702754335107271855384807 -48046492479002*x^80 + 111235651556599161905998900669481587907856029607842384 -7058721145611490097096177499329308286485980098377201553695581299300616429252 -2896328548114223502627261314995818846022537138353738293647104367494387573394 -8393580977308270455034395646105894483336815886915572733813700662098*x^79 - 1 -2379020348161516025309044646747619580648761934003227421750700116671436042176 -9234916272072233533611217288217765756191391217561297135624913793687875324800 -7048123566476086580476470670309837456621193106958657582668447487991539286833 -57031134988178799550492266664939630915472321*x^78 + 644986875872857655262996 -2870357260072805613051355925273289691398310869281737114462536081840128975833 -0126180055099077158183624456453836279081213829170321954905360807167962624432 -0834840220201004905145194463702511094693925819892194681047038159942946067231 -75356042055357536463*x^77 + 632358398592670498095591997355631111077729590643 -2790651615164768723582162467454648690012209970035792209695666782959269273807 -2446931808206460612526556054521554052793022216016750971388084812894581490191 -87488153428597505906544272968607176655503312813518126744417345713254937*x^76 - - 4407859464775144416487947396167367671725803977033500362272840558411894622 -4142347820758760948628866949429655387790156661766965605123758771588193309114 -1713374027265271324050920162934924792826148476476160753572716996003978356956 -83804000368513801138734053137773265487620770740*x^75 + 416372459606780296337 -1450264046151575655550849081038974416037216542290125884466463363808042083850 -9725418382508403123824265992064946980309513636360132567064198384175231861989 -9012223863450049443691606628550828159458118620199310401445249248178059313891 -70550354597821348040080*x^74 - 184161864081127040151143217561783123125395859 -3984003709177376821791781406937773897678496561663900933927169138471529228790 -5120635576312602740572720848588646957621039854850944227105781066695720878550 -615756344477554232044466772542846688611602947158650463473157163999798684880* -x^73 - 294578669269207164351858864041819495442047310529305439637416055593898 -7162766090787137613214756965908109965354836546249973970248312691190106013609 -0096047571535265598414402965513205463264379299412109566296535132357163168956 -32417972107859793797811490919775354115913639814509*x^72 + 116883470301786694 -7940105919928790584076295711500240939987022716541425069544597244574520104343 -0843831048650119597248348399831622778255382707463446772861932339155184508820 -8691492120804327123688321050527154392082194558601074437356409645501206599517 -48548591269958013706855735*x^71 - 962337617562843751668517056379887654984035 -3607775335999245012386540197534720757701144759975007037123456361469330484819 -1315697282222826434358396253666199318705803758613569124925030815057449171128 -4560115497697369485081240160416963318875432658639303154335108578568393415001 -1*x^70 + 3726752627853214173014791913150187098796942009506244634835348186874 -6218248319652489347706949219918369593434279794434225414007742000717921598981 -1967637764507611718683775885631603729498673872931482040372125187697058620137 -8729901384977948736920393075869570682078658147246402*x^69 + 6664265109721472 -5027167403028506905386766457143598965411785702251914095207487701546804662501 -9973661173639310250173508615816977744154467727637322113813424769329746934178 -2443037607433520297691194068563933234561377974297855282622664908800977935892 -66781529161410379918516384*x^68 - 207155588658254864820236483929333843353850 -2314782709935428769719703150188593756759875477634107095955930003335004909963 -7806096997987389425073233030518177133541278388985086967790086225554199073757 -9183726492903476789901947898423219398782945711055270770359481994540571424130 -4*x^67 + 1533378023324702195795907021652744267401738630185227412509325644190 -9317029060634416164456507736338956677716876820335111092883359676091733924360 -7562229802747370137957394804745995747839571913841959663322372004062970960303 -2739266325572053308062722007360886556152476819257995*x^66 - 5448017961352466 -8954308761386777114515861425568699050923629567132295720176133619693154821070 -6679446412666455188970580511515741859257380970964727783399666659463150181605 -5832418778533170218818696428046565610812780388008951253152709903494726503303 -47825776795872045310257331*x^65 - 782824212320460720852470872605130544762708 -5270844370030560427574258798403117425649643063954946491985881365052474110155 -1061361746263419716606571746236356433610334478429319747526941053865615635278 -723792660268903548758991779230812111021711115289261014249648789576891768349* -x^64 + 241834633150739573689757316859489557852802058328995612290604847372968 -8962517428202844726500527178649942306770989823832330134459212595922531552449 -0113231117621334324551438466322046602200466264537273693298034252254721421676 -4952766269941267448422272698762518675998018630028*x^63 - 1666339352730570520 -3639407453322817405171376787484109204948738088424073980877086807482951938601 -8865103399869046069476520137316208493195695957902129110473449041403464176591 -9862359175005557769808809061623387720644388156956972127266850675533756707525 -90808120744985654078946*x^62 + 570449220804489887130193887685456156518623172 -5938262332193484731157547462002602737462832660959996983966122744124822282431 -6513410409807491982186685917971756931992668327222699312497837591559016609364 -497532211515388699725043424503916154248093353508075820460159560673674726*x^6 -1 + 379845061301619031112865499569621029871812941926085546779444789597593099 -2185392685054292994780700584857914762885227739218300244363323904098764703684 -3361325604313463057739669057343485520202139735014463468397975802705055082320 -02067235766810391945048746973605012517899250*x^60 - 179994905002158006799826 -1581248012266767598208187591516407746996243019260988129520947344375845837479 -4375473622136858584586366278763492407789131148115802682216654123834671962143 -5349323536462397163996997039950567353507544138641982512459740031444726096910 -94329488186488560*x^59 + 119982265165997044452636805135365752758447406488957 -0849779495733478576958767846719905517427473004995721810584114866176087023280 -6873265056291159390228424704274613300367658551594974395489222878733856100659 -323368722107547660243619913236809974787583082322603729616639857984*x^58 - 41 -4498343303395026162273181308147077705273369693379285169454980456825999696414 -1108191789225342382926105642661506635099783996258510012027273821755928691169 -8167108483458843302305307979514403727827680023751217095370719902334212472094 -52432417836264144119102122277397817768*x^57 + 151296257711150774319086699562 -0621904293538949888063494638380250947255821384926730801679647950967103397199 -8232664074317796747475932212744662087954481765782241246318995396862540981468 -8990486802544852254612284845621149784604770996714678404380352987098024383778 -212981782*x^56 + 77172024931648750131579375330854241317819193485030367789630 -0194979153932088946756095579709069441269038355362032598061536345375371499825 -7603589364289068081989344439616890875432673156016666549955986167393531518011 -67940120441305635456765616769010583292909919688853748166*x^55 - 533362214813 -2692571383637474154386631336646003027379100089536309803633081806433335487865 -3788348099478071550518684140405592181062300213393211342562869431261195244746 -4055597603055279266341016276936298547770626014341819185195774706572228813839 -188337921892972222814214310*x^54 + 19809672028428641640899800622402763302466 -1074260655961612294389483118237887223011979572958763434751014838641676318160 -5147310285574152096915663041869066749730025370705253261451722595574825909044 -34743256388662636089294615411424475808328353443007431056186153291193660236*x -^53 - 3298236730725312112107997188999732021783635308764336412988146411506139 -7104102160872908196077077455976298299221998872649597890835291998156291479044 -1156752915907868097785637632834657415730880385603530195196698224915641474164 -13441042710366926553820042101416886262527990*x^52 - 101449365782699643760207 -3313704763252338242187697491537141888115893684195480412346735267432884547401 -4326674844047109008343871306484926351769633249049418818884494773111342516465 -1364847880469035878140408781793697844423605606532175548895998431434178111893 -10391299541374*x^51 + 997010027853800903810835659831173696396465410573075578 -3905356009776229418935908969084901777161285772610734056245264176199983282362 -9243150822898802087782083582569387718010137408195023053062329504663705594403 -79207927321560114457596629472924327212630999737789491694628*x^50 - 400136364 -1205954524277253466159627211505461211798229164611000835355077955105452940106 -5043117114065854192422518937652264386811681003511656062957851230278085993229 -0192913573475644905186402717704749806127538925050731511982133457968662243173 -0574757902251581738927743514*x^49 + 9180213565693093847510479570029388499565 -5962139940688297118935762169143151779122206282849955988804045093690808202777 -1911618936765072016334219087961215540705432215522135777876375064000492729289 -146413824719753030999530625757538495495631483556564886408485696916274754*x^4 -8 - 501301210215460642688466550524464459820491039666763299722186435065388308 -0998476722426260605286629208716991084876566352805637002187528368901275570021 -1644840502467709341605696416994819511376212841122712589602930316113642419950 -349056502832731819476610421210838732740*x^47 - 54944298141158889585149685718 -7336779616988953202758365462768772698687661348560047998087075022182507327394 -7519184487938281971887003668567460606612213622645012761958365390879314022191 -3390146402903001771434654731924912308476740943900732699364805260630537589779 -248726*x^46 + 26686242659774581832060629132908634079744101584587342617793147 -5307484074819549903437909197788777407246096377950996274109900334593209284669 -9285933458439326397108293597155087876694426014357663784876151672816297841341 -0567270026180297395204928647366053260719567023642*x^45 - 7052486107172135206 -1948720744051909520509772591994862049253916379923010961566356969081325001527 -6292596993146766741009335610467932996827331500592308883886627814990767499859 -2394117000761761120597925240350755933951486120638079133147944601048042610283 -120648681977182*x^44 + 12094887988138431717848391295686703675228636456392942 -8682928139939229340261144090919567211768947492261796729623549396284079133495 -0340419054279131563933305486551030416968393033147914495046708454093512499973 -890279938140031139050906270219603864516933692949758319412*x^43 - 13249348861 -2052453833911384927269989662957662727807923412036942065407705141769113172260 -4562201840504522929158651370739513572711063413085138434059101868053588204820 -3501768317607444088231087593813985100365809682458092656030031376932623184206 -7770517384807361785676*x^42 + 1335101451287203762576138569495941477971504274 -6021839256417498499034598980956043459656243655749784623012085862698394648682 -7521666667680743107938078657228707393173302010891133955653957891206671708545 -21488797288438881522832497235465398261203063264934026405622216*x^41 - 499475 -9281308667412284807719782367452360187792248198012964464639579785518460647882 -3014472001994317756006942461078978073213429085061547197216262635883812900592 -1762751571689421659752686372945957018076639346750248956405331139984740983345 -9224825604519148808410998*x^40 + 2123055922106609642987166390747900882690095 -8265815080171818541132693855937048009649851884749195950160943998565872859377 -2466719457136622623105718221481729397353928547971338648745934933818733937555 -9722029289477935787063071140468460122494931142480075599166922066*x^39 - 5735 -6058097105987281579532842451121455107789722350655401468909089438850594255611 -7398406496524366947519084716044767896958134185399473668974877433779111152344 -5537408221196487932870899207582741017935334684933397499648658504512170298450 -81211351675478818348250014*x^38 + 101323645478522769412770862955451494838700 -8662851023057079588279613730397359405727823936580260643332082414004528447161 -9032650746240307864113277781931187876839372237162972094621638339957461376513 -5960868446031017264818726765755631590746592742117108410287162304*x^37 - 1158 -2691707749694320983466811601420819483438159197492729367460974781919497846083 -2310429882055944418973561703899132956324878554694827218593251972032733158957 -9073374625050919799091874768764116278381338067763168272226788014070435497357 -3342854568112725548119716*x^36 + 8305639013155526915236550603371532656184411 -8485479725403465416008780582431421160189594698593377625798613038172701584227 -4206678281269713323953843252700015484543752538426082787722637328521354532797 -854400197712614233087564302182567125978130820395479367756272*x^35 - 72553146 -6299857240224175450027827480387792541339702494044488085609115659954701904593 -4063182032757400157986647557124710638076669642745888083114891044280939887931 -1080380921785649390927188469314188121124356596001115383235298455028416330896 -607528890361908254*x^34 + 19860798394812096491425064118869331882474934679022 -5013755600349219086403728983462588925205132120800514991648137327905331386108 -2705026046100093497647310070721575578185071569257102022328094661667732591461 -4871110127674403701118049341045392289086401193314942*x^33 - 4504073630957286 -8996977652497679946908816176921415580423759147328165686549644634042466661073 -3511461352309328969240076472657648713663010059789108519959246932375899814162 -7806075361906437084097330297847347043691634727928126429902493759079959944869 -550465866*x^32 + 69070920659658480551690757737221770374761684950145185121047 -2484618737300993281417864275556465857656908421568917719365815679023157411215 -6057258090256560697376971566576951036121500346489928053597706896717897892051 -06698965797835172312757476105925970954316*x^31 - 950505499088700807538705994 -4852731534709761992249213459182019380991510107647264892021396558868144681611 -0662751219780692605034863184825513108322135455467480199290708985357993844600 -052787576017748490330946803622885911462082828385374632295839177766961104*x^3 -0 + 146871001034451764467214379577713350818960453105454365246878113141243396 -2615951663537883759634270986980824512323040156750516514483187596408739659469 -9598984366473798855873087478723052705650039925818705324797901096311128210246 -360020474709693712139627212*x^29 - 21967157682673292571077015450821069674087 -1544590587052875727692154504672915643984006806321437086319058849365052767208 -2180148377519601579902888730828514202452285184145954435822512134773040530752 -315307032862652438081839581459737476241460047819927741316*x^28 + 25868119256 -5279242165718547565481040416951897690007278140339301372610232089805802058986 -0750808024571604981879223368087235334407689838584104951724530561739372122119 -8951117323168039502216475583876368959953874029365022369810172602125325497095 -6445408416*x^27 - 2428059268010321918244811964086129262156487932219116205050 -4070649327791508268466838408282079070232219613570494028527410574628542390142 -2207371899314254390315983442044698383945383757774385604939274532392556556337 -58840387565176697754574091764000708652*x^26 + 228044964584692160131546765047 -2366230486843363280069375103638842382972106217168205477299195570432297721283 -4433913421328769323459813505283451769698919188569838637736110033080505201432 -29246149018773191614239310593408598408683107352357568527200654044*x^25 - 240 -6358660663137122033270184955011680904324977408022614274765749948013776439046 -4906763369553397919412224096925386397722165397929814334230617641557808733911 -0574280678118160005286224756835902809740658092872319513670690482675603106255 -535345368222072*x^24 + 17662623687632442866313848276740533318473562530568602 -6085380981148726634500393960831149553262597329458902932994016704916196167706 -1802977969263820447192793617562366039417910781021352992596284460784056551089 -2584667589514772071439777359014056460388*x^23 - 1017233748361584303945573233 -3032677102808866261456706104325822118295706056417248083910297875201722536975 -2472365095568346621934137039403008509886158851525905826470428214804919613199 -4864749556380390451533567703437432891192535285335888731490497100*x^22 + 6962 -4456632649901142038343508876142609309013148113719161965752973745996685396900 -6242981394546059022035086880100336674301708003625923297490632324135942177919 -6475754925837957964115788320422751182797666627301620661963625816748809270833 -0371586416*x^21 - 5935499297476735425457730389595586123363077244239039067258 -8757027689826646450579634779345685940054648366379750425264531723684895242726 -1296842788479967443307602969542957303586075752713784702233094467073009888400 -4709831827016377193151480549079*x^20 - 9924231276887632055264945002835855931 -6153619298064184888082607712523327637455849379369518935749807342918090562216 -3515240369483362753072379694694969114717331800146736581921176222284191504989 -22256734920743781356158658426818610320388361445943*x^19 - 223034910041976985 -5872625998444601823522405237422212480311276936526222907234872314934718146257 -7999956125097315186127418244514895084164378747477418159356551630505131305135 -965903638935951781824035858082445936492127698502477328282539866049529*x^18 - - 236643075076678358536974434180237346813030211220576398492261042505158468477 -4245106684856714329733460194522211899691204030539339797067532556065266564996 -8995125799175143049170891303055998502994776437035748429866958228412329271509 -6914727786*x^17 + 2542147127057127485965235153724151047113766830500853009593 -4057432271073053439213859505464662101818485064985498169276132525055092922810 -7659183430955698520972071635491614118402866501132808889569521209673251362824 -76709756655755991836417802*x^16 + 183111149787713493280210397619912322103096 -5247871179773154030195420556994309371058325110985700072545919333159157805938 -6224014037352998052003315867311050614119923950889255536852768279112155091364 -24174340648729576596630358137790527045198*x^15 - 449821041069912943789836264 -5632599818971731559621159648780555694409049475593695526598586098851324811318 -2519341945707916157927951713037252573987087918917682037480599453640794209186 -225479459166338434922942612532823032751347335799704869*x^14 - 22982911151946 -0414712287398340054262339910173840391365052883789755652220150460120847132485 -5387525455121237089427182900348837425717452397567606502432587339063493335218 -99975599619910693111772391894198334123224235975702158966025975889*x^13 + 425 -1167449102860417605682557582269062328643891986101063790164447568501066388281 -7083671619051397999677516644732430950231634364346445730340715448369087696718 -20523719962939869299988336933823914482320626610429276999595557594057384713*x -^12 - 2634769415254884935578685134629261396873246071233388299830258283684407 -2876185708249044979665212650744995875688959242932243838420517823860588878429 -2448997291893491640954677331782979368685632076417137547307030222199889038379 -76940*x^11 - 178196131047104477494733878949091986680056821951080835036094383 -8004052330411696017910506157765585633940095861000688753523141138483928490467 -4511256960034750139170510478764583267207761340591670181326537548133703111264 -9106926204*x^10 + 1825000405670995013845885918902187142186986666482440933839 -6462521386957836588377301330171147216240982523247505481312286617417272521511 -8638399348219471080155689525455946137646839420547370091703312293991788729921 -1491191185252*x^9 - 65201626996640512322761674559318066561117950070675294766 -3169824762769899024352909587195016688965354038529484926750838814982572946010 -1979637110489360349176312329919783316622660007379629280095704481299477431710 -45016069129*x^8 - 1437891149083999662420144342263678250208894256538560561654 -8933951961391248431401653150798776891480895285823868174684751112400557598552 -7985918610201118598268431458892734242196304467884366814923258790382419891488 -25558929*x^7 - 1428280930363758251384969101052572662110879466805595758704451 -0527911033933582902662199662263051097627055254401259144549052189981714948608 -3243967370749726951525986876271444939969618263711803265644040382245363794511 -71*x^6 - 1170826372197459055177820600881979710066693446685651498813175990981 -0745762172031150515086932467894419392120220600061432329279936873889655682224 -7191725072125442393957901078704198243471395495180025340969870794174*x^5 - 11 -8223168675776843350634299306552668061864957826207103017499838634433318705119 -3832689526795798631026606743575718322278065328528551578753575871762638217620 -241416850427234233281589721441720700844787815627946*x^4 - 953048457007008296 -1795451881320794184817199918350969024576327248906812630041977334151670173523 -3419849726478663631547211301749427543946011643243124123502481796513891248511 -161398944690550172434214114*x^3 - 254706791524256177472181318251041912950779 -4390935955929617768730635253624759862293118182940797954335902313821207678848 -027543595348285081414397619295455292216447729433614628265514361363667915*x^2 - + 7114590568532928191072122754665584122789751912529693393245247725975835948 -7615527828928204048113*x - 1 -x^240 + (-15*y - 36)*x^239 + (499*y + 430)*x^238 + (-6344*y - 983)*x^237 + ( -35389*y - 20411)*x^236 + (-40904*y + 178707)*x^235 + (-424808*y - 438197)*x^ -234 + (1415485*y - 635208)*x^233 + (1438139*y + 2974605)*x^232 + (-5864817*y - + 6566480)*x^231 + (-25462020*y - 12961894)*x^230 + (19238389*y - 79956654) -*x^229 + (247313433*y - 30224897)*x^228 + (294927621*y + 801098945)*x^227 + -(-2353679384*y + 1069498319)*x^226 + (-3266832488*y - 5793469739)*x^225 + (1 -2761071756*y - 10152009124)*x^224 + (28891772141*y + 27706877778)*x^223 + (- -56780498004*y + 70327470888)*x^222 + (-156989267296*y - 100643285180)*x^221 -+ (163182970660*y - 341901790078)*x^220 + (692925090103*y + 282970748175)*x^ -219 + (-520851483678*y + 1249500770581)*x^218 + (-2100987167651*y - 97780636 -3155)*x^217 + (2144907137575*y - 3501192827999)*x^216 + (5741131351957*y + 5 -368774573391)*x^215 + (-12949633488740*y + 9667592872104)*x^214 + (-18978818 -705192*y - 28988343801763)*x^213 + (61143701295650*y - 42854297857883)*x^212 - + (99522339968066*y + 118416217970085)*x^211 + (-203990291010201*y + 226088 -796680855)*x^210 + (-487486417978576*y - 306059642167156)*x^209 + (371437987 -605861*y - 969565907346414)*x^208 + (1761877237395113*y + 250996844693464)*x -^207 + (347587448455796*y + 2909203449118066)*x^206 + (-4262623171412271*y + - 1900082482875272)*x^205 + (-5112561845313059*y - 5258998337190094)*x^204 + -(4703077156935772*y - 10817923562329066)*x^203 + (19596724151621886*y + 4579 -71706716061)*x^202 + (10779811934500297*y + 31310302362591686)*x^201 + (-444 -71188376651271*y + 33091705261026148)*x^200 + (-70367728073948453*y - 553681 -43890230595)*x^199 + (58047935399898944*y - 125056052810735004)*x^198 + (196 -220179915190037*y + 46078797156864550)*x^197 + (-15612945533449050*y + 27845 -2806220656846)*x^196 + (-364966710997667886*y + 30164046307811567)*x^195 + ( --76920393658091100*y - 455669527002677921)*x^194 + (569724473209147360*y - 1 -04273935104641941)*x^193 + (107554480539021407*y + 761016430421970356)*x^192 - + (-1120756441763956820*y + 138805435659787599)*x^191 + (-36744368496876235 -9*y - 1741313178847717412)*x^190 + (2626931562224608194*y - 1142827140366519 -672)*x^189 + (3001549496003468616*y + 3542726921147289593)*x^188 + (-3816304 -655625513057*y + 6563685064488706687)*x^187 + (-12280102244383760786*y - 216 -9956083918876046)*x^186 + (-3280308295039992672*y - 20013773166146345265)*x^ -185 + (28534969871679714183*y - 14758677431499660732)*x^184 + (3420538527727 -7312731*y + 35129207175233160758)*x^183 + (-35562575528916824663*y + 6232129 -2808100809456)*x^182 + (-97526968113689340266*y - 24577168539715006795)*x^18 -1 + (-2924482708853224503*y - 135200656059538396115)*x^180 + (16755988046047 -3073606*y - 50231770182088582728)*x^179 + (117217186558944665294*y + 1844313 -16627662099968)*x^178 + (-175018700423712057769*y + 199325075624692888658)*x -^177 + (-287672838056258651793*y - 130006789216819808906)*x^176 + (433136887 -58928043819*y - 370488386653834436323)*x^175 + (435685264104825475131*y - 87 -230951613648934063)*x^174 + (260789110179489506909*y + 473346146286012258862 -)*x^173 + (-477453708065915165092*y + 475828532275903297714)*x^172 + (-73312 -5023480253537968*y - 445824632107486741239)*x^171 + (377925441616168009977*y - - 1037951764481934863694)*x^170 + (1401192440853964064557*y + 2712041812199 -21501426)*x^169 + (-116817470274758714683*y + 1837817520966021102844)*x^168 -+ (-2362860273074857968126*y + 103875680474127044027)*x^167 + (-421763202246 -558569481*y - 2985437596461812106201)*x^166 + (3701454711020661872373*y - 87 -8419497758685431399)*x^165 + (1521006793930665203185*y + 4486769840934475059 -679)*x^164 + (-5292413186031800428648*y + 2393646591871321675898)*x^163 + (- -3527560907713404811933*y - 6046342849737077241029)*x^162 + (6659475347960239 -461641*y - 4934471883467342725819)*x^161 + (6606218484397706362957*y + 70346 -33694928572084799)*x^160 + (-7071251229918632950519*y + 85221454139378375409 -88)*x^159 + (-10654172673396879304988*y - 6660938661086516468010)*x^158 + (5 -677741559220425296264*y - 12963319200223537566424)*x^157 + (1537868439480061 -5926642*y + 3975042669473795569897)*x^156 + (-1409491575820818236069*y + 177 -68498236629148702410)*x^155 + (-19928654122136236656860*y + 2108177954625221 -499359)*x^154 + (-6549200784773657451762*y - 21617243705895522615660)*x^153 -+ (22645379524677683996954*y - 11738628703873244299229)*x^152 + (17408053637 -884918322314*y + 22982504260819896781381)*x^151 + (-22809630522578701355929* -y + 23340226072231874490562)*x^150 + (-29550558164952915082604*y - 224392369 -77615542871417)*x^149 + (22094525765620020809639*y - 36386527353264595233550 -)*x^148 + (44442209345887020103552*y + 21630493829993114594971)*x^147 + (-20 -362621509381561401708*y + 54254830555411448139989)*x^146 + (-659133869795653 -69752671*y - 17161940478911028975987)*x^145 + (10842803083053018739937*y - 7 -8798826823995559998884)*x^144 + (91671114659094334230114*y + 699010605156960 -463896)*x^143 + (13121977610624125288643*y + 103143317388027280663819)*x^142 - + (-112336281183122778011108*y + 29666952173920616332098)*x^141 + (-4771339 -6391497944676658*y - 119352040791078382516354)*x^140 + (12522214489937288097 -8343*y - 66535424263344578690303)*x^139 + (86443391588395703449231*y + 13128 -8792905554584140170)*x^138 + (-138308631379146285689943*y + 1087117764446364 -01209940)*x^137 + (-134836856528001466894586*y - 145826834678543169365085)*x -^136 + (152261003156819774060466*y - 165525545074570372890946)*x^135 + (2000 -19883617103704090631*y + 155735524429003454571137)*x^134 + (-155214006426713 -875482591*y + 236255888142978579163439)*x^133 + (-271843213937284128310312*y - - 151199785544397594300869)*x^132 + (145501652264843306972923*y - 305326875 -506321100258855)*x^131 + (336932852565943631529246*y + 140097781638111061499 -104)*x^130 + (-135773050794564515416176*y + 368242715265481945864410)*x^129 -+ (-400908655930869378612741*y - 131401561676926670933942)*x^128 + (12442649 -3872813948801626*y - 435145712814328666799539)*x^127 + (46899879143136708390 -7400*y + 112351662733835870233203)*x^126 + (-94381628626117531492779*y + 498 -937937395927788353831)*x^125 + (-521540559152841029573809*y - 72188367562634 -255595303)*x^124 + (49231480359271694594387*y - 535280543629519838165745)*x^ -123 + (541321200409785903521904*y + 28961946371400127296768)*x^122 + (-12936 -229773088822436824*y + 542775176498979507958864)*x^121 - 5428178716207228568 -54615*y*x^120 + (-12936229773088822436824*y - 542775176498979507958864)*x^11 -9 + (541321200409785903521904*y - 28961946371400127296768)*x^118 + (49231480 -359271694594387*y + 535280543629519838165745)*x^117 + (-52154055915284102957 -3809*y + 72188367562634255595303)*x^116 + (-94381628626117531492779*y - 4989 -37937395927788353831)*x^115 + (468998791431367083907400*y - 1123516627338358 -70233203)*x^114 + (124426493872813948801626*y + 435145712814328666799539)*x^ -113 + (-400908655930869378612741*y + 131401561676926670933942)*x^112 + (-135 -773050794564515416176*y - 368242715265481945864410)*x^111 + (336932852565943 -631529246*y - 140097781638111061499104)*x^110 + (145501652264843306972923*y -+ 305326875506321100258855)*x^109 + (-271843213937284128310312*y + 151199785 -544397594300869)*x^108 + (-155214006426713875482591*y - 23625588814297857916 -3439)*x^107 + (200019883617103704090631*y - 155735524429003454571137)*x^106 -+ (152261003156819774060466*y + 165525545074570372890946)*x^105 + (-13483685 -6528001466894586*y + 145826834678543169365085)*x^104 + (-1383086313791462856 -89943*y - 108711776444636401209940)*x^103 + (86443391588395703449231*y - 131 -288792905554584140170)*x^102 + (125222144899372880978343*y + 665354242633445 -78690303)*x^101 + (-47713396391497944676658*y + 119352040791078382516354)*x^ -100 + (-112336281183122778011108*y - 29666952173920616332098)*x^99 + (131219 -77610624125288643*y - 103143317388027280663819)*x^98 + (91671114659094334230 -114*y - 699010605156960463896)*x^97 + (10842803083053018739937*y + 787988268 -23995559998884)*x^96 + (-65913386979565369752671*y + 17161940478911028975987 -)*x^95 + (-20362621509381561401708*y - 54254830555411448139989)*x^94 + (4444 -2209345887020103552*y - 21630493829993114594971)*x^93 + (2209452576562002080 -9639*y + 36386527353264595233550)*x^92 + (-29550558164952915082604*y + 22439 -236977615542871417)*x^91 + (-22809630522578701355929*y - 2334022607223187449 -0562)*x^90 + (17408053637884918322314*y - 22982504260819896781381)*x^89 + (2 -2645379524677683996954*y + 11738628703873244299229)*x^88 + (-654920078477365 -7451762*y + 21617243705895522615660)*x^87 + (-19928654122136236656860*y - 21 -08177954625221499359)*x^86 + (-1409491575820818236069*y - 177684982366291487 -02410)*x^85 + (15378684394800615926642*y - 3975042669473795569897)*x^84 + (5 -677741559220425296264*y + 12963319200223537566424)*x^83 + (-1065417267339687 -9304988*y + 6660938661086516468010)*x^82 + (-7071251229918632950519*y - 8522 -145413937837540988)*x^81 + (6606218484397706362957*y - 703463369492857208479 -9)*x^80 + (6659475347960239461641*y + 4934471883467342725819)*x^79 + (-35275 -60907713404811933*y + 6046342849737077241029)*x^78 + (-529241318603180042864 -8*y - 2393646591871321675898)*x^77 + (1521006793930665203185*y - 44867698409 -34475059679)*x^76 + (3701454711020661872373*y + 878419497758685431399)*x^75 -+ (-421763202246558569481*y + 2985437596461812106201)*x^74 + (-2362860273074 -857968126*y - 103875680474127044027)*x^73 + (-116817470274758714683*y - 1837 -817520966021102844)*x^72 + (1401192440853964064557*y - 271204181219921501426 -)*x^71 + (377925441616168009977*y + 1037951764481934863694)*x^70 + (-7331250 -23480253537968*y + 445824632107486741239)*x^69 + (-477453708065915165092*y - - 475828532275903297714)*x^68 + (260789110179489506909*y - 473346146286012258 -862)*x^67 + (435685264104825475131*y + 87230951613648934063)*x^66 + (4331368 -8758928043819*y + 370488386653834436323)*x^65 + (-287672838056258651793*y + -130006789216819808906)*x^64 + (-175018700423712057769*y - 199325075624692888 -658)*x^63 + (117217186558944665294*y - 184431316627662099968)*x^62 + (167559 -880460473073606*y + 50231770182088582728)*x^61 + (-2924482708853224503*y + 1 -35200656059538396115)*x^60 + (-97526968113689340266*y + 24577168539715006795 -)*x^59 + (-35562575528916824663*y - 62321292808100809456)*x^58 + (3420538527 -7277312731*y - 35129207175233160758)*x^57 + (28534969871679714183*y + 147586 -77431499660732)*x^56 + (-3280308295039992672*y + 20013773166146345265)*x^55 -+ (-12280102244383760786*y + 2169956083918876046)*x^54 + (-38163046556255130 -57*y - 6563685064488706687)*x^53 + (3001549496003468616*y - 3542726921147289 -593)*x^52 + (2626931562224608194*y + 1142827140366519672)*x^51 + (-367443684 -968762359*y + 1741313178847717412)*x^50 + (-1120756441763956820*y - 13880543 -5659787599)*x^49 + (107554480539021407*y - 761016430421970356)*x^48 + (56972 -4473209147360*y + 104273935104641941)*x^47 + (-76920393658091100*y + 4556695 -27002677921)*x^46 + (-364966710997667886*y - 30164046307811567)*x^45 + (-156 -12945533449050*y - 278452806220656846)*x^44 + (196220179915190037*y - 460787 -97156864550)*x^43 + (58047935399898944*y + 125056052810735004)*x^42 + (-7036 -7728073948453*y + 55368143890230595)*x^41 + (-44471188376651271*y - 33091705 -261026148)*x^40 + (10779811934500297*y - 31310302362591686)*x^39 + (19596724 -151621886*y - 457971706716061)*x^38 + (4703077156935772*y + 1081792356232906 -6)*x^37 + (-5112561845313059*y + 5258998337190094)*x^36 + (-4262623171412271 -*y - 1900082482875272)*x^35 + (347587448455796*y - 2909203449118066)*x^34 + -(1761877237395113*y - 250996844693464)*x^33 + (371437987605861*y + 969565907 -346414)*x^32 + (-487486417978576*y + 306059642167156)*x^31 + (-2039902910102 -01*y - 226088796680855)*x^30 + (99522339968066*y - 118416217970085)*x^29 + ( -61143701295650*y + 42854297857883)*x^28 + (-18978818705192*y + 2898834380176 -3)*x^27 + (-12949633488740*y - 9667592872104)*x^26 + (5741131351957*y - 5368 -774573391)*x^25 + (2144907137575*y + 3501192827999)*x^24 + (-2100987167651*y - + 977806363155)*x^23 + (-520851483678*y - 1249500770581)*x^22 + (6929250901 -03*y - 282970748175)*x^21 + (163182970660*y + 341901790078)*x^20 + (-1569892 -67296*y + 100643285180)*x^19 + (-56780498004*y - 70327470888)*x^18 + (288917 -72141*y - 27706877778)*x^17 + (12761071756*y + 10152009124)*x^16 + (-3266832 -488*y + 5793469739)*x^15 + (-2353679384*y - 1069498319)*x^14 + (294927621*y -- 801098945)*x^13 + (247313433*y + 30224897)*x^12 + (19238389*y + 79956654)* -x^11 + (-25462020*y + 12961894)*x^10 + (-5864817*y - 6566480)*x^9 + (1438139 -*y - 2974605)*x^8 + (1415485*y + 635208)*x^7 + (-424808*y + 438197)*x^6 + (- -40904*y - 178707)*x^5 + (35389*y + 20411)*x^4 + (-6344*y + 983)*x^3 + (499*y - - 430)*x^2 + (-15*y + 36)*x - 1 -x^3 + (-y - 1)*x^2 + (y - 2)*x + 1 -x^6 + (-y - 1)*x^5 + (y - 2)*x^4 + 5*x^3 + (-y - 1)*x^2 + (y - 2)*x + 1 -x^15 + (-13*y - 28)*x^14 + (-35*y + 71)*x^13 + (-96*y + 193)*x^12 + (-5*y - -196)*x^11 + (-239*y - 365)*x^10 + (120*y + 1489)*x^9 + (-261*y - 2084)*x^8 + - (-261*y + 2345)*x^7 + (120*y - 1609)*x^6 + (-239*y + 604)*x^5 + (-5*y + 201 -)*x^4 + (-96*y - 97)*x^3 + (-35*y - 36)*x^2 + (-13*y + 41)*x - 1 -x^64 - 2869316*y*x^63 - 14321320456*x^62 + 157634598028*y*x^61 - 20284120752 -9344*x^60 - 187341502817748*y*x^59 + 42513677421330536*x^58 + 89659277585427 -48*y*x^57 - 581758105735037800*x^56 - 22856296353162116*y*x^55 - 17452945591 -56518504*x^54 - 264489521649865972*y*x^53 + 3806496834205999360*x^52 - 74814 -8105793479444*y*x^51 + 34464709754552397448*x^50 - 807085220707689700*y*x^49 - + 112558678351798157916*x^48 + 885683152130937644*y*x^47 + 3063853398816684 -17048*x^46 + 13203419547826420924*y*x^45 + 419863456051485069824*x^44 + 3434 -3465258453402972*y*x^43 + 465608689069031605064*x^42 + 80309592889200941068* -y*x^41 - 360175722030581287640*x^40 + 110486596140091600940*y*x^39 - 1490512 -424563931678536*x^38 + 143957811491089032572*y*x^37 - 3739364774219046032256 -*x^36 + 100323919847689168220*y*x^35 - 4985975135633301110936*x^34 + 5481611 -3881156185292*y*x^33 - 6135008383051601995834*x^32 - 54816113881156185292*y* -x^31 - 4985975135633301110936*x^30 - 100323919847689168220*y*x^29 - 37393647 -74219046032256*x^28 - 143957811491089032572*y*x^27 - 1490512424563931678536* -x^26 - 110486596140091600940*y*x^25 - 360175722030581287640*x^24 - 803095928 -89200941068*y*x^23 + 465608689069031605064*x^22 - 34343465258453402972*y*x^2 -1 + 419863456051485069824*x^20 - 13203419547826420924*y*x^19 + 3063853398816 -68417048*x^18 - 885683152130937644*y*x^17 + 112558678351798157916*x^16 + 807 -085220707689700*y*x^15 + 34464709754552397448*x^14 + 748148105793479444*y*x^ -13 + 3806496834205999360*x^12 + 264489521649865972*y*x^11 - 1745294559156518 -504*x^10 + 22856296353162116*y*x^9 - 581758105735037800*x^8 - 89659277585427 -48*y*x^7 + 42513677421330536*x^6 + 187341502817748*y*x^5 - 202841207529344*x -^4 - 157634598028*y*x^3 - 14321320456*x^2 + 2869316*y*x + 1 -x^21 + (-13*y - 229)*x^20 + (234*y - 100)*x^19 + (-480*y + 8370)*x^18 + (-17 -35*y - 16719)*x^17 + (4913*y - 7834)*x^16 + (-2688*y + 51064)*x^15 + (-3960* -y - 34104)*x^14 + (1782*y - 32956)*x^13 + (8448*y + 5262)*x^12 + (-6380*y + -97204)*x^11 + (-6380*y - 90824)*x^10 + (8448*y - 13710)*x^9 + (1782*y + 3117 -4)*x^8 + (-3960*y + 38064)*x^7 + (-2688*y - 48376)*x^6 + (4913*y + 2921)*x^5 - + (-1735*y + 18454)*x^4 + (-480*y - 7890)*x^3 + (234*y - 134)*x^2 + (-13*y -+ 242)*x - 1 -x^6 - 2*y*x^5 + (-y - 7)*x^4 - 4*x^3 + (y - 8)*x^2 + (2*y - 2)*x + 1 -x^240 + (-15*y - 36)*x^239 + (499*y + 430)*x^238 + (-6344*y - 983)*x^237 + ( -35389*y - 20411)*x^236 + (-40904*y + 178707)*x^235 + (-424808*y - 438197)*x^ -234 + (1415485*y - 635208)*x^233 + (1438139*y + 2974605)*x^232 + (-5864817*y - + 6566480)*x^231 + (-25462020*y - 12961894)*x^230 + (19238389*y - 79956654) -*x^229 + (247313433*y - 30224897)*x^228 + (294927621*y + 801098945)*x^227 + -(-2353679384*y + 1069498319)*x^226 + (-3266832488*y - 5793469739)*x^225 + (1 -2761071756*y - 10152009124)*x^224 + (28891772141*y + 27706877778)*x^223 + (- -56780498004*y + 70327470888)*x^222 + (-156989267296*y - 100643285180)*x^221 -+ (163182970660*y - 341901790078)*x^220 + (692925090103*y + 282970748175)*x^ -219 + (-520851483678*y + 1249500770581)*x^218 + (-2100987167651*y - 97780636 -3155)*x^217 + (2144907137575*y - 3501192827999)*x^216 + (5741131351957*y + 5 -368774573391)*x^215 + (-12949633488740*y + 9667592872104)*x^214 + (-18978818 -705192*y - 28988343801763)*x^213 + (61143701295650*y - 42854297857883)*x^212 - + (99522339968066*y + 118416217970085)*x^211 + (-203990291010201*y + 226088 -796680855)*x^210 + (-487486417978576*y - 306059642167156)*x^209 + (371437987 -605861*y - 969565907346414)*x^208 + (1761877237395113*y + 250996844693464)*x -^207 + (347587448455796*y + 2909203449118066)*x^206 + (-4262623171412271*y + - 1900082482875272)*x^205 + (-5112561845313059*y - 5258998337190094)*x^204 + -(4703077156935772*y - 10817923562329066)*x^203 + (19596724151621886*y + 4579 -71706716061)*x^202 + (10779811934500297*y + 31310302362591686)*x^201 + (-444 -71188376651271*y + 33091705261026148)*x^200 + (-70367728073948453*y - 553681 -43890230595)*x^199 + (58047935399898944*y - 125056052810735004)*x^198 + (196 -220179915190037*y + 46078797156864550)*x^197 + (-15612945533449050*y + 27845 -2806220656846)*x^196 + (-364966710997667886*y + 30164046307811567)*x^195 + ( --76920393658091100*y - 455669527002677921)*x^194 + (569724473209147360*y - 1 -04273935104641941)*x^193 + (107554480539021407*y + 761016430421970356)*x^192 - + (-1120756441763956820*y + 138805435659787599)*x^191 + (-36744368496876235 -9*y - 1741313178847717412)*x^190 + (2626931562224608194*y - 1142827140366519 -672)*x^189 + (3001549496003468616*y + 3542726921147289593)*x^188 + (-3816304 -655625513057*y + 6563685064488706687)*x^187 + (-12280102244383760786*y - 216 -9956083918876046)*x^186 + (-3280308295039992672*y - 20013773166146345265)*x^ -185 + (28534969871679714183*y - 14758677431499660732)*x^184 + (3420538527727 -7312731*y + 35129207175233160758)*x^183 + (-35562575528916824663*y + 6232129 -2808100809456)*x^182 + (-97526968113689340266*y - 24577168539715006795)*x^18 -1 + (-2924482708853224503*y - 135200656059538396115)*x^180 + (16755988046047 -3073606*y - 50231770182088582728)*x^179 + (117217186558944665294*y + 1844313 -16627662099968)*x^178 + (-175018700423712057769*y + 199325075624692888658)*x -^177 + (-287672838056258651793*y - 130006789216819808906)*x^176 + (433136887 -58928043819*y - 370488386653834436323)*x^175 + (435685264104825475131*y - 87 -230951613648934063)*x^174 + (260789110179489506909*y + 473346146286012258862 -)*x^173 + (-477453708065915165092*y + 475828532275903297714)*x^172 + (-73312 -5023480253537968*y - 445824632107486741239)*x^171 + (377925441616168009977*y - - 1037951764481934863694)*x^170 + (1401192440853964064557*y + 2712041812199 -21501426)*x^169 + (-116817470274758714683*y + 1837817520966021102844)*x^168 -+ (-2362860273074857968126*y + 103875680474127044027)*x^167 + (-421763202246 -558569481*y - 2985437596461812106201)*x^166 + (3701454711020661872373*y - 87 -8419497758685431399)*x^165 + (1521006793930665203185*y + 4486769840934475059 -679)*x^164 + (-5292413186031800428648*y + 2393646591871321675898)*x^163 + (- -3527560907713404811933*y - 6046342849737077241029)*x^162 + (6659475347960239 -461641*y - 4934471883467342725819)*x^161 + (6606218484397706362957*y + 70346 -33694928572084799)*x^160 + (-7071251229918632950519*y + 85221454139378375409 -88)*x^159 + (-10654172673396879304988*y - 6660938661086516468010)*x^158 + (5 -677741559220425296264*y - 12963319200223537566424)*x^157 + (1537868439480061 -5926642*y + 3975042669473795569897)*x^156 + (-1409491575820818236069*y + 177 -68498236629148702410)*x^155 + (-19928654122136236656860*y + 2108177954625221 -499359)*x^154 + (-6549200784773657451762*y - 21617243705895522615660)*x^153 -+ (22645379524677683996954*y - 11738628703873244299229)*x^152 + (17408053637 -884918322314*y + 22982504260819896781381)*x^151 + (-22809630522578701355929* -y + 23340226072231874490562)*x^150 + (-29550558164952915082604*y - 224392369 -77615542871417)*x^149 + (22094525765620020809639*y - 36386527353264595233550 -)*x^148 + (44442209345887020103552*y + 21630493829993114594971)*x^147 + (-20 -362621509381561401708*y + 54254830555411448139989)*x^146 + (-659133869795653 -69752671*y - 17161940478911028975987)*x^145 + (10842803083053018739937*y - 7 -8798826823995559998884)*x^144 + (91671114659094334230114*y + 699010605156960 -463896)*x^143 + (13121977610624125288643*y + 103143317388027280663819)*x^142 - + (-112336281183122778011108*y + 29666952173920616332098)*x^141 + (-4771339 -6391497944676658*y - 119352040791078382516354)*x^140 + (12522214489937288097 -8343*y - 66535424263344578690303)*x^139 + (86443391588395703449231*y + 13128 -8792905554584140170)*x^138 + (-138308631379146285689943*y + 1087117764446364 -01209940)*x^137 + (-134836856528001466894586*y - 145826834678543169365085)*x -^136 + (152261003156819774060466*y - 165525545074570372890946)*x^135 + (2000 -19883617103704090631*y + 155735524429003454571137)*x^134 + (-155214006426713 -875482591*y + 236255888142978579163439)*x^133 + (-271843213937284128310312*y - - 151199785544397594300869)*x^132 + (145501652264843306972923*y - 305326875 -506321100258855)*x^131 + (336932852565943631529246*y + 140097781638111061499 -104)*x^130 + (-135773050794564515416176*y + 368242715265481945864410)*x^129 -+ (-400908655930869378612741*y - 131401561676926670933942)*x^128 + (12442649 -3872813948801626*y - 435145712814328666799539)*x^127 + (46899879143136708390 -7400*y + 112351662733835870233203)*x^126 + (-94381628626117531492779*y + 498 -937937395927788353831)*x^125 + (-521540559152841029573809*y - 72188367562634 -255595303)*x^124 + (49231480359271694594387*y - 535280543629519838165745)*x^ -123 + (541321200409785903521904*y + 28961946371400127296768)*x^122 + (-12936 -229773088822436824*y + 542775176498979507958864)*x^121 - 5428178716207228568 -54615*y*x^120 + (-12936229773088822436824*y - 542775176498979507958864)*x^11 -9 + (541321200409785903521904*y - 28961946371400127296768)*x^118 + (49231480 -359271694594387*y + 535280543629519838165745)*x^117 + (-52154055915284102957 -3809*y + 72188367562634255595303)*x^116 + (-94381628626117531492779*y - 4989 -37937395927788353831)*x^115 + (468998791431367083907400*y - 1123516627338358 -70233203)*x^114 + (124426493872813948801626*y + 435145712814328666799539)*x^ -113 + (-400908655930869378612741*y + 131401561676926670933942)*x^112 + (-135 -773050794564515416176*y - 368242715265481945864410)*x^111 + (336932852565943 -631529246*y - 140097781638111061499104)*x^110 + (145501652264843306972923*y -+ 305326875506321100258855)*x^109 + (-271843213937284128310312*y + 151199785 -544397594300869)*x^108 + (-155214006426713875482591*y - 23625588814297857916 -3439)*x^107 + (200019883617103704090631*y - 155735524429003454571137)*x^106 -+ (152261003156819774060466*y + 165525545074570372890946)*x^105 + (-13483685 -6528001466894586*y + 145826834678543169365085)*x^104 + (-1383086313791462856 -89943*y - 108711776444636401209940)*x^103 + (86443391588395703449231*y - 131 -288792905554584140170)*x^102 + (125222144899372880978343*y + 665354242633445 -78690303)*x^101 + (-47713396391497944676658*y + 119352040791078382516354)*x^ -100 + (-112336281183122778011108*y - 29666952173920616332098)*x^99 + (131219 -77610624125288643*y - 103143317388027280663819)*x^98 + (91671114659094334230 -114*y - 699010605156960463896)*x^97 + (10842803083053018739937*y + 787988268 -23995559998884)*x^96 + (-65913386979565369752671*y + 17161940478911028975987 -)*x^95 + (-20362621509381561401708*y - 54254830555411448139989)*x^94 + (4444 -2209345887020103552*y - 21630493829993114594971)*x^93 + (2209452576562002080 -9639*y + 36386527353264595233550)*x^92 + (-29550558164952915082604*y + 22439 -236977615542871417)*x^91 + (-22809630522578701355929*y - 2334022607223187449 -0562)*x^90 + (17408053637884918322314*y - 22982504260819896781381)*x^89 + (2 -2645379524677683996954*y + 11738628703873244299229)*x^88 + (-654920078477365 -7451762*y + 21617243705895522615660)*x^87 + (-19928654122136236656860*y - 21 -08177954625221499359)*x^86 + (-1409491575820818236069*y - 177684982366291487 -02410)*x^85 + (15378684394800615926642*y - 3975042669473795569897)*x^84 + (5 -677741559220425296264*y + 12963319200223537566424)*x^83 + (-1065417267339687 -9304988*y + 6660938661086516468010)*x^82 + (-7071251229918632950519*y - 8522 -145413937837540988)*x^81 + (6606218484397706362957*y - 703463369492857208479 -9)*x^80 + (6659475347960239461641*y + 4934471883467342725819)*x^79 + (-35275 -60907713404811933*y + 6046342849737077241029)*x^78 + (-529241318603180042864 -8*y - 2393646591871321675898)*x^77 + (1521006793930665203185*y - 44867698409 -34475059679)*x^76 + (3701454711020661872373*y + 878419497758685431399)*x^75 -+ (-421763202246558569481*y + 2985437596461812106201)*x^74 + (-2362860273074 -857968126*y - 103875680474127044027)*x^73 + (-116817470274758714683*y - 1837 -817520966021102844)*x^72 + (1401192440853964064557*y - 271204181219921501426 -)*x^71 + (377925441616168009977*y + 1037951764481934863694)*x^70 + (-7331250 -23480253537968*y + 445824632107486741239)*x^69 + (-477453708065915165092*y - - 475828532275903297714)*x^68 + (260789110179489506909*y - 473346146286012258 -862)*x^67 + (435685264104825475131*y + 87230951613648934063)*x^66 + (4331368 -8758928043819*y + 370488386653834436323)*x^65 + (-287672838056258651793*y + -130006789216819808906)*x^64 + (-175018700423712057769*y - 199325075624692888 -658)*x^63 + (117217186558944665294*y - 184431316627662099968)*x^62 + (167559 -880460473073606*y + 50231770182088582728)*x^61 + (-2924482708853224503*y + 1 -35200656059538396115)*x^60 + (-97526968113689340266*y + 24577168539715006795 -)*x^59 + (-35562575528916824663*y - 62321292808100809456)*x^58 + (3420538527 -7277312731*y - 35129207175233160758)*x^57 + (28534969871679714183*y + 147586 -77431499660732)*x^56 + (-3280308295039992672*y + 20013773166146345265)*x^55 -+ (-12280102244383760786*y + 2169956083918876046)*x^54 + (-38163046556255130 -57*y - 6563685064488706687)*x^53 + (3001549496003468616*y - 3542726921147289 -593)*x^52 + (2626931562224608194*y + 1142827140366519672)*x^51 + (-367443684 -968762359*y + 1741313178847717412)*x^50 + (-1120756441763956820*y - 13880543 -5659787599)*x^49 + (107554480539021407*y - 761016430421970356)*x^48 + (56972 -4473209147360*y + 104273935104641941)*x^47 + (-76920393658091100*y + 4556695 -27002677921)*x^46 + (-364966710997667886*y - 30164046307811567)*x^45 + (-156 -12945533449050*y - 278452806220656846)*x^44 + (196220179915190037*y - 460787 -97156864550)*x^43 + (58047935399898944*y + 125056052810735004)*x^42 + (-7036 -7728073948453*y + 55368143890230595)*x^41 + (-44471188376651271*y - 33091705 -261026148)*x^40 + (10779811934500297*y - 31310302362591686)*x^39 + (19596724 -151621886*y - 457971706716061)*x^38 + (4703077156935772*y + 1081792356232906 -6)*x^37 + (-5112561845313059*y + 5258998337190094)*x^36 + (-4262623171412271 -*y - 1900082482875272)*x^35 + (347587448455796*y - 2909203449118066)*x^34 + -(1761877237395113*y - 250996844693464)*x^33 + (371437987605861*y + 969565907 -346414)*x^32 + (-487486417978576*y + 306059642167156)*x^31 + (-2039902910102 -01*y - 226088796680855)*x^30 + (99522339968066*y - 118416217970085)*x^29 + ( -61143701295650*y + 42854297857883)*x^28 + (-18978818705192*y + 2898834380176 -3)*x^27 + (-12949633488740*y - 9667592872104)*x^26 + (5741131351957*y - 5368 -774573391)*x^25 + (2144907137575*y + 3501192827999)*x^24 + (-2100987167651*y - + 977806363155)*x^23 + (-520851483678*y - 1249500770581)*x^22 + (6929250901 -03*y - 282970748175)*x^21 + (163182970660*y + 341901790078)*x^20 + (-1569892 -67296*y + 100643285180)*x^19 + (-56780498004*y - 70327470888)*x^18 + (288917 -72141*y - 27706877778)*x^17 + (12761071756*y + 10152009124)*x^16 + (-3266832 -488*y + 5793469739)*x^15 + (-2353679384*y - 1069498319)*x^14 + (294927621*y -- 801098945)*x^13 + (247313433*y + 30224897)*x^12 + (19238389*y + 79956654)* -x^11 + (-25462020*y + 12961894)*x^10 + (-5864817*y - 6566480)*x^9 + (1438139 -*y - 2974605)*x^8 + (1415485*y + 635208)*x^7 + (-424808*y + 438197)*x^6 + (- -40904*y - 178707)*x^5 + (35389*y + 20411)*x^4 + (-6344*y + 983)*x^3 + (499*y - - 430)*x^2 + (-15*y + 36)*x - 1 -x^6 + (-2*y - 2)*x^5 + (2*y - 4)*x^4 + 14*x^3 + (-2*y - 2)*x^2 + (2*y - 4)*x - + 1 -x^8 + 9*x^6 - 16*x^4 + 9*x^2 + 1 -x^20 + 6*x^19 + 24*x^18 + 46*x^17 + 57*x^16 + 51*x^15 + 37*x^14 + 21*x^13 + -12*x^12 + 3*x^11 - 11*x^10 - 3*x^9 + 15*x^8 + 14*x^7 + 9*x^6 + 15*x^5 + 15*x -^4 + 6*x^3 + 3*x^2 + 3*x + 1 -x^20 + 12*x^18 + 6*x^16 - 5*x^14 - 9*x^12 + 17*x^10 - 9*x^8 + 6*x^4 - 3*x^2 -+ 1 -x^24 + 4*x^22 + 8*x^20 + 20*x^18 + 32*x^16 - 12*x^14 - 42*x^12 - 12*x^10 + 3 -2*x^8 + 20*x^6 + 8*x^4 + 4*x^2 + 1 -x^21 - 7*x^20 + (3*y + 16)*x^19 + (-22*y - 3)*x^18 + (64*y - 46)*x^17 + (-80 -*y + 89)*x^16 + (14*y - 133)*x^15 + (57*y + 244)*x^14 + (-56*y - 259)*x^13 + - (132*y - 3)*x^12 + (-317*y + 204)*x^11 + (317*y - 113)*x^10 + (-132*y + 129 -)*x^9 + (56*y - 315)*x^8 + (-57*y + 301)*x^7 + (-14*y - 119)*x^6 + (80*y + 9 -)*x^5 + (-64*y + 18)*x^4 + (22*y - 25)*x^3 + (-3*y + 19)*x^2 - 7*x + 1 -x^4 - y*x^3 - 3*x^2 + y*x + 1 -x^4 + (-1/4*y + 1/2)*x^3 - 2*x^2 + (1/4*y + 1/2)*x + 1 -x^2 - x + 1 - -""" diff --git a/tests/unittests/rootsreal.py b/tests/unittests/rootsreal.py deleted file mode 100644 index f30951a..0000000 --- a/tests/unittests/rootsreal.py +++ /dev/null @@ -1,314 +0,0 @@ -# -*- coding: utf-8 -*- -# Created 09/26/2017 - -"""Original pari/GP test file rootsreal : -default(realprecision,38); -T=x^3-6*x^2+11*x-6; -polrootsreal(T) -polrootsreal(T, [-oo,3/2]) -polrootsreal(T, [3/2,6]) -polrootsreal(T, [-oo,+oo]) -polrootsreal(T, [2,3]) -polrootsreal(T, [1,2]) -polsturm(T, [-oo,3/2]) -polsturm(T, [3/2,6]) -polsturm(T, [-oo,+oo]) -polsturm(T, [2,3]) -polsturm(T, [1,2]) -polsturm(T, [1,+oo]) -polsturm(T, 2,3) -polsturm(T, 2.,3) -polsturm(T,,2) -polrootsreal(x^10 + 23*x^9 + 19*x^8 + 18*x^7 + 39*x^6 + 41*x^5 + 46*x^4 + 24*x^3 - 4*x^2 + 2*x + 42) -polrootsreal(polchebyshev(9)) -polrootsreal(polchebyshev(10)) -polrootsreal(x^0) -polrootsreal(1) -polrootsreal(0) -polrootsreal(Pol(0)) -polrootsreal(Mod(1,2)) - -polroots(T*x+0.) -polroots(1) -polrootsreal(T,[1,1]) -polrootsreal(T,[0,0]) -polsturm(T,[1,1]) -polsturm(T,[2,1]) - -U=(x^2-1)*(x-2); -polsturm(U) -polsturm(U,[-oo,1]) -polsturm(U,[-1,+oo]) - -polrootsreal(x,[1,2]) -polrootsreal(x,[-2,-1]) -polrootsreal(x,[-1,1]) - -polrootsreal(x^3-2) -polrootsreal(x^3+2) -\\#1605 -polsturm(33*x^2-4*x-1) -polrootsreal(4*x) -polsturm(-4*x) -polsturm((x^4-2)^2) - -\\#1807 -T=x^3+x^2-x+2; -polrootsreal(T) -polsturm(T) -polsturm(T,[-3,-1]) -polsturm(T,[-2,-1]) -polsturm(T,[-oo,-2]) -polsturm(T,[-2,oo]) -T=4*x^3-2*x^2-x-1; -polsturm(T,[0,oo]) -polsturm(T,[0,1]) -polsturm(T,[0,2]) -polsturm(T,[1,3]) - -\\#1808 -polrootsreal(3*x^3-4*x^2+3*x-1) - -\\#1809 -polrootsreal(x^3-3*x^2-3*x+2) - -\\#1810 -polrootsreal(x^3-x^2) -polrootsreal((x^3-x^2)*(x-2)^3*(x-3)^2) - -default(realprecision,19); -#polroots((x+1)^2 * (x-1)^7 * (x^2-x+1)^5 * 1.0) - -\\#1884 -default(realprecision,38); -polsturm(x^2-1,[-1,1]) -polrootsreal(x^2-1,[-1,1]) -""" -import unittest -from cypari2 import Pari, PariError - -pari = Pari() - - -class TestRootsreal(unittest.TestCase): - def setUp(self): - pari.set_real_precision(38) - - def tearDown(self): - pari.set_real_precision(15) - - def test_rootsreal(self): - T = 'x^3-6*x^2+11*x-6'; - self.assertEquals(pari.polrootsreal(T), '[1.0000000000000000000000000000000000000, 2.00000000000000000000' - '00000000000000000, 3.0000000000000000000000000000000000000]~') - self.assertEquals(pari.polrootsreal(T, ['-oo', '3/2']), '[1.0000000000000000000000000000000000000]~') - self.assertEquals(pari.polrootsreal(T, ['3/2', 6]), - '[2.0000000000000000000000000000000000000, 3.0000000000000000000000000000000000000]~') - self.assertEquals(pari.polrootsreal(T, ['-oo', '+oo']), - '[1.0000000000000000000000000000000000000, 2.0000000000000000000000000000000000000, ' - '3.0000000000000000000000000000000000000]~') - self.assertEquals(pari.polrootsreal(T, [2, 3]), - '[2.0000000000000000000000000000000000000, 3.0000000000000000000000000000000000000]~') - self.assertEquals(pari.polrootsreal(T, [1, 2]), - '[1.0000000000000000000000000000000000000, 2.0000000000000000000000000000000000000]~') - - self.assertEquals(str(pari.polsturm(T, ['-oo', '3/2'])), '1') - self.assertEquals(str(pari.polsturm(T, ['3/2', 6])), '2') - self.assertEquals(str(pari.polsturm(T, ['-oo', '+oo'])), '3') - self.assertEquals(str(pari.polsturm(T, [2, 3])), '2') - self.assertEquals(str(pari.polsturm(T, [1, 2])), '2') - self.assertEquals(str(pari.polsturm(T, [1, '+oo'])), '3') - self.assertEquals(str(pari.polsturm(T, 2, 3)), '2') - self.assertEquals(str(pari.polsturm(T, '2.', 3)), '2') - self.assertEquals(str(pari.polsturm(T, None, 2)), '2') - self.assertEquals(str(pari.polrootsreal('x^10 + 23*x^9 + 19*x^8 + 18*x^7 + 39*x^6 + 41*x^5 + 46*x^4 + 24*x^3' - ' - 4*x^2 + 2*x + 42', precision=128)), - '[-22.176420046821213834911725420609849287, -1.2204011038823372357354593544256902868]~') - self.assertEquals(str(pari.polrootsreal(pari.polchebyshev(9), precision=128)), - '[-0.98480775301220805936674302458952301367, -0.86602540378443864676372317075293618347, -' + - '0.64278760968653932632264340990726343291, -0.34202014332566873304409961468225958076, 0.E' + - '-38, 0.34202014332566873304409961468225958076, 0.64278760968653932632264340990726343291,' + - ' 0.86602540378443864676372317075293618347, 0.98480775301220805936674302458952301367]~') - self.assertEquals(str(pari.polrootsreal(pari.polchebyshev(10), precision=128)), - '[-0.98768834059513772619004024769343726076, -0.89100652418836786235970957141362631277, -' + - '0.70710678118654752440084436210484903928, -0.45399049973954679156040836635787119898, -0.' + - '15643446504023086901010531946716689231, 0.15643446504023086901010531946716689231, 0.4539' + - '9049973954679156040836635787119898, 0.70710678118654752440084436210484903928, 0.89100652' + - '418836786235970957141362631277, 0.98768834059513772619004024769343726076]~') - self.assertEquals(str(pari.polrootsreal('x^0', precision=128)), '[]~') - self.assertEquals(str(pari.polrootsreal(1, precision=128)), '[]~') - - with self.assertRaises(PariError) as context: - pari.polrootsreal(0, precision=128) - self.assertTrue('zero polynomial in realroots' in str(context.exception)) - with self.assertRaises(PariError) as context: - pari.polrootsreal(pari.Pol(0), precision=128) - self.assertTrue('zero polynomial in realroots' in str(context.exception)) - with self.assertRaises(PariError) as context: - pari.polrootsreal(pari.Mod(1, 2), precision=128) - self.assertTrue('incorrect type in realroots (t_INTMOD)' in str(context.exception)) - - self.assertEquals(pari.polroots('(x^3-6*x^2+11*x-6)*x+0.'), - '[0.E-38 + 0.E-38*I, 1.0000000000000000000000000000000000000 + 0.E-38*I, 2.00000000000000' + - '00000000000000000000000 + 0.E-38*I, 3.0000000000000000000000000000000000000 + 0.E-38*I]~') - self.assertEquals(pari.polroots(1), '[]~') - self.assertEquals(str(pari.polrootsreal(T, [1, 1], precision=128)), - '[1.0000000000000000000000000000000000000]~') - self.assertEquals(str(pari.polrootsreal(T, [0, 0], precision=128)), '[]~') - self.assertEquals(str(pari.polsturm(T, [1, 1])), '1') - self.assertEquals(str(pari.polsturm(T, [2, 1])), '0') - - U = '(x^2-1)*(x-2)'; - self.assertEquals(str(pari.polsturm(U)), '3') - self.assertEquals(str(pari.polsturm(U, ['-oo', 1])), '2') - self.assertEquals(str(pari.polsturm(U, [-1, '+oo'])), '3') - - self.assertEquals(str(pari.polrootsreal('x', [1, 2])), '[]~') - self.assertEquals(str(pari.polrootsreal('x', [-2, -1])), '[]~') - self.assertEquals(str(pari.polrootsreal('x', [-1, 1], precision=128)), '[0.E-38]~') - - self.assertEquals(str(pari.polrootsreal('x^3-2', precision=128)), '[1.2599210498948731647672106072782283506]~') - self.assertEquals(str(pari.polrootsreal('x^3+2', precision=128)), '[-1.2599210498948731647672106072782283506]~') - - # #1605 - self.assertEquals(str(pari.polsturm('33*x^2-4*x-1')), '2') - self.assertEquals(str(pari.polrootsreal('4*x', precision=128)), '[0.E-38]~') - self.assertEquals(str(pari.polsturm('-4*x')), '1') - with self.assertRaises(PariError) as context: - pari.polsturm('(x^4-2)^2') - self.assertTrue('domain error in polsturm: issquarefree(pol) = 0' in str(context.exception)) - - # #1807 - T = 'x^3+x^2-x+2'; - self.assertEquals(str(pari.polrootsreal(T, precision=128)), '[-2.0000000000000000000000000000000000000]~') - self.assertEquals(str(pari.polsturm(T)), '1') - self.assertEquals(str(pari.polsturm(T, [-3, -1])), '1') - self.assertEquals(str(pari.polsturm(T, [-2, -1])), '1') - self.assertEquals(str(pari.polsturm(T, ['-oo', -2])), '1') - self.assertEquals(str(pari.polsturm(T, [-2, 'oo'])), '1') - - T = '4*x^3-2*x^2-x-1'; - self.assertEquals(str(pari.polsturm(T, [0, 'oo'])), '1') - self.assertEquals(str(pari.polsturm(T, [0, 1])), '1') - self.assertEquals(str(pari.polsturm(T, [0, 2])), '1') - self.assertEquals(str(pari.polsturm(T, [1, 3])), '1') - - # #1808 - self.assertEquals(str(pari.polrootsreal('3*x^3-4*x^2+3*x-1', precision=128)), - '[0.59441447601624956642908249516963028371]~') - - # #1809 - self.assertEquals(str(pari.polrootsreal('x^3-3*x^2-3*x+2', precision=128)), - '[-1.1451026912004224304268100262663119669, 0.47602360291813403446915767711979045497, ' - '3.6690790882822883959576523491465215119]~') - - # #1810 - self.assertEquals(str(pari.polrootsreal('x^3-x^2', precision=128)), - '[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000]~') - self.assertEquals(str(pari.polrootsreal('(x^3-x^2)*(x-2)^3*(x-3)^2', precision=128)), - '[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000, 2.00000000000000000000' + - '00000000000000000, 2.0000000000000000000000000000000000000, 2.000000000000000000' + - '0000000000000000000, 3.0000000000000000000000000000000000000, 3.0000000000000000' + - '000000000000000000000]~') - - pari.set_real_precision(19) - self.assertEquals(len(pari.polroots('(x+1)^2 * (x-1)^7 * (x^2-x+1)^5 * 1.0')), 19) - - # #1884 - pari.set_real_precision(38) - self.assertEquals(str(pari.polsturm('x^2-1', [-1, 1])), '2') - self.assertEquals(str(pari.polrootsreal('x^2-1', [-1, 1], precision=128)), - '[-1.0000000000000000000000000000000000000, 1.0000000000000000000000000000000000000]~') - -"""**** Original expected results **** - -[1.0000000000000000000000000000000000000, 2.00000000000000000000000000000000 -00000, 3.0000000000000000000000000000000000000]~ -[1.0000000000000000000000000000000000000]~ -[2.0000000000000000000000000000000000000, 3.00000000000000000000000000000000 -00000]~ -[1.0000000000000000000000000000000000000, 2.00000000000000000000000000000000 -00000, 3.0000000000000000000000000000000000000]~ -[2.0000000000000000000000000000000000000, 3.00000000000000000000000000000000 -00000]~ -[1.0000000000000000000000000000000000000, 2.00000000000000000000000000000000 -00000]~ -1 -2 -3 -2 -2 -3 -2 -2 -2 -[-22.176420046821213834911725420609849287, -1.220401103882337235735459354425 -6902868]~ -[-0.98480775301220805936674302458952301367, -0.86602540378443864676372317075 -293618347, -0.64278760968653932632264340990726343291, -0.3420201433256687330 -4409961468225958076, 0.E-38, 0.34202014332566873304409961468225958076, 0.642 -78760968653932632264340990726343291, 0.8660254037844386467637231707529361834 -7, 0.98480775301220805936674302458952301367]~ -[-0.98768834059513772619004024769343726076, -0.89100652418836786235970957141 -362631277, -0.70710678118654752440084436210484903928, -0.4539904997395467915 -6040836635787119898, -0.15643446504023086901010531946716689231, 0.1564344650 -4023086901010531946716689231, 0.45399049973954679156040836635787119898, 0.70 -710678118654752440084436210484903928, 0.891006524188367862359709571413626312 -77, 0.98768834059513772619004024769343726076]~ -[]~ -[]~ - *** at top-level: polrootsreal(0) - *** ^--------------- - *** polrootsreal: zero polynomial in realroots. - *** at top-level: polrootsreal(Pol(0)) - *** ^-------------------- - *** polrootsreal: zero polynomial in realroots. - *** at top-level: polrootsreal(Mod(1,2 - *** ^-------------------- - *** polrootsreal: incorrect type in realroots (t_INTMOD). -[0.E-38 + 0.E-38*I, 1.0000000000000000000000000000000000000 + 0.E-38*I, 2.00 -00000000000000000000000000000000000 + 0.E-38*I, 3.00000000000000000000000000 -00000000000 + 0.E-38*I]~ -[]~ -[1.0000000000000000000000000000000000000]~ -[]~ -1 -0 -3 -2 -3 -[]~ -[]~ -[0.E-38]~ -[1.2599210498948731647672106072782283506]~ -[-1.2599210498948731647672106072782283506]~ -2 -[0.E-38]~ -1 - *** at top-level: polsturm((x^4-2)^2) - *** ^------------------- - *** polsturm: domain error in polsturm: issquarefree(pol) = 0 -[-2.0000000000000000000000000000000000000]~ -1 -1 -1 -1 -1 -1 -1 -1 -1 -[0.59441447601624956642908249516963028371]~ -[-1.1451026912004224304268100262663119669, 0.4760236029181340344691576771197 -9045497, 3.6690790882822883959576523491465215119]~ -[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000]~ -[0.E-38, 0.E-38, 1.0000000000000000000000000000000000000, 2.0000000000000000 -000000000000000000000, 2.0000000000000000000000000000000000000, 2.0000000000 -000000000000000000000000000, 3.0000000000000000000000000000000000000, 3.0000 -000000000000000000000000000000000]~ -19 -2 -[-1.0000000000000000000000000000000000000, 1.0000000000000000000000000000000 -000000]~ - -""" diff --git a/tests/unittests/ser.py b/tests/unittests/ser.py deleted file mode 100644 index 7ad4a25..0000000 --- a/tests/unittests/ser.py +++ /dev/null @@ -1,314 +0,0 @@ -# -*- coding: utf-8 -*- -# Created 09/26/2017 - -"""Original pari/GP test file ser : -default(realprecision,38); -s=x+x^2+O(x^5) -f=[atan,asin,acos,cosh,sinh,tanh,cotanh,acosh,asinh,atanh]; -{ -for (i=1,#f, - print(f[i](s)); - print(f[i](O(x^5))); - print(f[i]([Pol(1)])); -) -} -O(x^-2) -O(1/x^2) -trace(I*x+1+O(x^2)) -norm(I*x+1+O(x^2)) -a=Ser(vector(200,i,i)); -a^2 == a*(a+1) - a \\ test RgX_mullow, RgX_sqrlow -3+O(1) -serreverse(x/2+O(x^2)) -serreverse(tan(x)/2) - -Ser(x+y+O(x^2),x) -Ser(x+y+O(x^2),y) -Ser("") -s = Ser(Mod(0,7)) -Ser(Mod(1,7)*(x^4+x^2), x,3) -s+O(x^16) -s+Mod(1,7) -s+Mod(1,7)*x -s/x -s' -deriv(s,y) -trace(s) -round(s) -round(s,&e) -lift(s) -lift(s,x) -liftint(s) -Ser(x,, -5) -O(x^2)*0 -deriv(Mod(2,4)*x^2+O(x^3)) -x^3*(1+O(y^2)) -Mod(1,3)*x^3*(1+O(y^2)) -O(x)/2 -s = O(3^2)+O(x); -s/3 -s/2 -s*3 -(1+O(x))^2 -1/(x+0.)+O(x^2) -[1==O(x), 1==O(x^0), 1==O(x^-1)] -[-1==O(x), -1==O(x^0), -1==O(x^-1)] -[2==O(x), 2==O(x^0), 2==O(x^-1)] - -a=1./x+O(1);a-a -a=1/x+O(1);a-a -a=Mod(1,2)/x+O(1);a-a - -subst(1+O(x),x,y) -subst(1+x+O(x^2),x,y^2) -O(1)==O(x) -O(1)==x -O(x)==1 - -exp(x+O(x^200))*exp(-x+O(x^200)) -exp(x+O(x^200))^2==exp(2*x+O(x^200)) - -subst(1+x^3+O(x^6),x,x+O(x^4)) -subst(1+x^2+O(x^6),x,x+O(x^3)) -subst(1+x^3+x^4+O(x^6),x,x+x^2+O(x^3)) - -subst(x^2+O(x^3),x,0*x) -subst(x^2+O(x^3),x,Mod(0,3)*x) -subst(x^2+O(x^3),x,O(3)*x) -subst(1+x+O(x^2),x,0*x) -subst(1+x+O(x^2),x,Mod(0,3)*x) -subst(1+x+O(x^2),x,O(3)*x) - -\\ Errors. Keep at end of file -subst(x^-1+O(x),x,Mod(0,3)) -subst(O(x^-1),x,Mod(0,3)) -subst(x^-1+O(x),x,0*x) -subst(O(x^-1),x,0*x) -""" -import unittest -from cypari2 import Pari, PariError - -pari = Pari() - - -class TestSer(unittest.TestCase): - def test_ser(self): - pari.set_real_precision(38) - s = 'x+x^2+O(x^5)' - f = [pari.atan, pari.asin, pari.acos, pari.cosh, pari.sinh, pari.tanh, pari.cotanh, pari.acosh, pari.asinh]; - - res1 = ['x + x^2 - 1/3*x^3 - x^4 + O(x^5)', - 'x + x^2 + 1/6*x^3 + 1/2*x^4 + O(x^5)', - '1.5707963267948966192313216916397514421 - x - x^2 - 1/6*x^3 - 1/2*x^4 + O(x^5)', - '1 + 1/2*x^2 + x^3 + 13/24*x^4 + O(x^5)', - 'x + x^2 + 1/6*x^3 + 1/2*x^4 + O(x^5)', - 'x + x^2 - 1/3*x^3 - x^4 + O(x^5)', - 'x^-1 - 1 + 4/3*x - 2/3*x^2 + O(x^3)', - '1.5707963267948966192313216916397514421*I - 1.0000000000000000000000000000000000000*I*x - ' - '1.0000000000000000000000000000000000000*I*x^2 - 0.16666666666666666666666666666666666667*I*x^3 - ' - '0.50000000000000000000000000000000000000*I*x^4 + O(x^5)', - 'x + x^2 - 1/6*x^3 - 1/2*x^4 + O(x^5)'] - - res2 = ['O(x^5)', - 'O(x^5)', - '1.5707963267948966192313216916397514421 + O(x^5)', - '1 + O(x^5)', - 'O(x^5)', - 'O(x^5)', - 'O(x^5)', - '1.5707963267948966192313216916397514421*I + O(x^5)', - 'O(x^5)'] - - res3 = ['[0.78539816339744830961566084581987572105 + O(x^16)]', - '[1.5707963267948966192313216916397514421 + O(x^8)]', - '[O(x^8)]', - '[1.5430806348152437784779056207570616826 + O(x^16)]', - '[1.1752011936438014568823818505956008152 + O(x^16)]', - '[0.76159415595576488811945828260479359041 + O(x^16)]', - '[1.3130352854993313036361612469308478329 + O(x^16)]', - '[O(x^8)]', - '[0.88137358701954302523260932497979230903 + O(x^16)]'] - - for i in range(0, len(f)): - self.assertEquals(str(f[i](s, precision=128)), res1[i]); - self.assertEquals(str(f[i]('O(x^5)', precision=128)), res2[i]); - self.assertEquals(str(f[i]([pari.Pol(1)], precision=128)), res3[i]); - - self.assertEquals(str(pari.atanh(s, precision=128)), 'x + x^2 + 1/3*x^3 + x^4 + O(x^5)') - self.assertEquals(str(pari.atanh('O(x^5)', precision=128)), 'O(x^5)') - with self.assertRaises(PariError) as context: - pari.atanh([pari.Pol(1)], precision=128) - self.assertTrue('impossible inverse in div_ser: O(x^16)' in str(context.exception)) - self.assertEquals(pari.trace('I*x+1+O(x^2)'), '2 + O(x^2)') - self.assertEquals(pari.norm('I*x+1+O(x^2)'), '1 + O(x^2)') - - self.assertEquals(pari.Ser('x+y+O(x^2)','x'), 'y + x + O(x^2)') - self.assertEquals(pari.Ser('x+y+O(x^2)','y'), '(y + O(y^17)) + (1 + O(y^16))*x + O(x^2)') - with self.assertRaises(PariError) as context: - pari.Ser('""') - self.assertTrue('incorrect type in gtoser (t_STR)' in str(context.exception)) - s = pari.Ser(pari.Mod(0,7)) - self.assertEquals(s, 'Mod(0, 7)*x^15 + O(x^16)') - self.assertEquals(pari.Ser('Mod(1,7)*(x^4+x^2)', 'x', 3), 'Mod(1, 7)*x^2 + Mod(1, 7)*x^4 + O(x^5)') - self.assertEquals(pari.deriv(s, 'y'), 'Mod(0, 7)*x^15 + O(x^16)') - self.assertEquals(pari.trace(s), 'Mod(0, 7)*x^15 + O(x^16)') - self.assertEquals(pari.lift(s), 'O(x^16)') - self.assertEquals(pari.lift(s, 'x'), 'Mod(0, 7)*x^15 + O(x^16)') - self.assertEquals(pari.liftint(s), 'O(x^16)') - self.assertEquals(pari.deriv('Mod(2,4)*x^2+O(x^3)'), 'Mod(0, 4)*x + O(x^2)') - - self.assertEquals(pari.subst('1+O(x)', 'x', 'y'), '1 + O(y)') - self.assertEquals(pari.subst('1+x+O(x^2)', 'x', 'y^2'), '1 + y^2 + O(y^4)') - self.assertEquals(pari.subst('1+x^3+O(x^6)', 'x', 'x+O(x^4)'), '1 + x^3 + O(x^6)') - self.assertEquals(pari.subst('1+x^2+O(x^6)', 'x', 'x+O(x^3)'), '1 + x^2 + O(x^4)') - self.assertEquals(pari.subst('1+x^3+x^4+O(x^6)', 'x', 'x+x^2+O(x^3)'), '1 + x^3 + 4*x^4 + O(x^5)') - - self.assertEquals(pari.subst('x^2+O(x^3)', 'x', '0*x'), '0') - self.assertEquals(pari.subst('x^2+O(x^3)', 'x', 'Mod(0,3)*x'), 'Mod(0, 3)') - self.assertEquals(pari.subst('x^2+O(x^3)', 'x', 'O(3)*x'), 'O(3^2)*x^2 + O(x^3)') - self.assertEquals(pari.subst('1+x+O(x^2)', 'x', '0*x'), '1') - self.assertEquals(pari.subst('1+x+O(x^2)', 'x', 'Mod(0,3)*x'), 'Mod(1, 3)') - self.assertEquals(pari.subst('1+x+O(x^2)', 'x', 'O(3)*x'), '1 + O(3)*x + O(x^2)') - - def test_serreverse(self): - self.assertEquals(pari.serreverse('x/2+O(x^2)'), '2*x + O(x^2)') - self.assertEquals(pari.serreverse('tan(x)/2'), '2*x - 8/3*x^3 + 32/5*x^5 - 128/7*x^7 + 512/9*x^9 - 204' - '8/11*x^11 + 8192/13*x^13 - 32768/15*x^15 + O(x^17)') - - def test_errors(self): - with self.assertRaises(PariError) as context: - pari.subst('x^-1+O(x)', 'x', pari.Mod(0, 3)) - self.assertTrue('impossible inverse in gsubst: Mod(0, 3)' in str(context.exception)) - with self.assertRaises(PariError) as context: - pari.subst('O(x^-1)', 'x', pari.Mod(0, 3)) - self.assertTrue('impossible inverse in gsubst: Mod(0, 3)' in str(context.exception)) - with self.assertRaises(PariError) as context: - pari.subst('x^-1+O(x)', 'x', '0*x') - self.assertTrue('impossible inverse in gsubst: 0' in str(context.exception)) - with self.assertRaises(PariError) as context: - pari.subst('O(x^-1)', 'x', '0*x') - self.assertTrue('impossible inverse in gsubst: 0' in str(context.exception)) - - - - - -"""**** Original expected results **** - -x + x^2 + O(x^5) -x + x^2 - 1/3*x^3 - x^4 + O(x^5) -O(x^5) -[0.78539816339744830961566084581987572105 + O(x^16)] -x + x^2 + 1/6*x^3 + 1/2*x^4 + O(x^5) -O(x^5) -[1.5707963267948966192313216916397514421 + O(x^8)] -1.5707963267948966192313216916397514421 - x - x^2 - 1/6*x^3 - 1/2*x^4 + O(x^ -5) -1.5707963267948966192313216916397514421 + O(x^5) -[O(x^8)] -1 + 1/2*x^2 + x^3 + 13/24*x^4 + O(x^5) -1 + O(x^5) -[1.5430806348152437784779056207570616826 + O(x^16)] -x + x^2 + 1/6*x^3 + 1/2*x^4 + O(x^5) -O(x^5) -[1.1752011936438014568823818505956008152 + O(x^16)] -x + x^2 - 1/3*x^3 - x^4 + O(x^5) -O(x^5) -[0.76159415595576488811945828260479359041 + O(x^16)] -x^-1 - 1 + 4/3*x - 2/3*x^2 + O(x^3) -O(x^5) -[1.3130352854993313036361612469308478329 + O(x^16)] -1.5707963267948966192313216916397514421*I - 1.000000000000000000000000000000 -0000000*I*x - 1.0000000000000000000000000000000000000*I*x^2 - 0.166666666666 -66666666666666666666666667*I*x^3 - 0.50000000000000000000000000000000000000* -I*x^4 + O(x^5) -1.5707963267948966192313216916397514421*I + O(x^5) -[O(x^8)] -x + x^2 - 1/6*x^3 - 1/2*x^4 + O(x^5) -O(x^5) -[0.88137358701954302523260932497979230903 + O(x^16)] -x + x^2 + 1/3*x^3 + x^4 + O(x^5) -O(x^5) - *** at top-level: ...rint(f[i](O(x^5)));print(f[i]([Pol(1)]));) - *** ^----------------- - *** in function f: atanh - *** ^----- - *** atanh: impossible inverse in div_ser: O(x^16). -O(x^-2) -O(x^-2) -2 + O(x^2) -1 + O(x^2) -1 -O(x^0) -2*x + O(x^2) -2*x - 8/3*x^3 + 32/5*x^5 - 128/7*x^7 + 512/9*x^9 - 2048/11*x^11 + 8192/13*x^ -13 - 32768/15*x^15 + O(x^17) -y + x + O(x^2) -(y + O(y^17)) + (1 + O(y^16))*x + O(x^2) - *** at top-level: Ser("") - *** ^------- - *** Ser: incorrect type in gtoser (t_STR). -Mod(0, 7)*x^15 + O(x^16) -Mod(1, 7)*x^2 + Mod(1, 7)*x^4 + O(x^5) -Mod(0, 7)*x^15 + O(x^16) -Mod(1, 7) + O(x^16) -Mod(1, 7)*x + O(x^16) -Mod(0, 7)*x^14 + O(x^15) -Mod(0, 7)*x^14 + O(x^15) -Mod(0, 7)*x^15 + O(x^16) -Mod(0, 7)*x^15 + O(x^16) -Mod(0, 7)*x^15 + O(x^16) -Mod(0, 7)*x^15 + O(x^16) -O(x^16) -Mod(0, 7)*x^15 + O(x^16) -O(x^16) - *** at top-level: Ser(x,,-5) - *** ^---------- - *** Ser: domain error in gtoser: precision < 0 -0 -Mod(0, 4)*x + O(x^2) -(1 + O(y^2))*x^3 -(Mod(1, 3) + O(y^2))*x^3 -O(x) -O(3) + O(x) -O(3^2) + O(x) -O(3^3) + O(x) -1 + O(x) - *** _+_: Warning: normalizing a series with 0 leading term. -x^-1 + O(x) -[0, 1, 1] -[0, 1, 1] -[0, 1, 1] -0.E-38*x^-1 + O(x^0) -O(x^0) -Mod(0, 2)*x^-1 + O(x^0) -1 + O(y) -1 + y^2 + O(y^4) -1 -1 -0 -1 + O(x^200) -1 -1 + x^3 + O(x^6) -1 + x^2 + O(x^4) -1 + x^3 + 4*x^4 + O(x^5) -0 -Mod(0, 3) -O(3^2)*x^2 + O(x^3) -1 -Mod(1, 3) -1 + O(3)*x + O(x^2) - *** at top-level: subst(x^-1+O(x),x,Mo - *** ^-------------------- - *** subst: impossible inverse in gsubst: Mod(0, 3). - *** at top-level: subst(O(x^-1),x,Mod( - *** ^-------------------- - *** subst: impossible inverse in gsubst: Mod(0, 3). - *** at top-level: subst(x^-1+O(x),x,0* - *** ^-------------------- - *** subst: impossible inverse in gsubst: 0. - *** at top-level: subst(O(x^-1),x,0*x) - *** ^-------------------- - *** subst: impossible inverse in gsubst: 0. - -""" diff --git a/tests/unittests/set.py b/tests/unittests/set.py index 414c4a2..427dfe6 100644 --- a/tests/unittests/set.py +++ b/tests/unittests/set.py @@ -21,7 +21,6 @@ setsearch(L,3) setsearch(1,3) setunion(a,b) - X = [1,2,3]; Y = [2,3,4]; setbinop((x,y)->x+y, X,Y) setbinop((x,y)->x+y, X) @@ -69,7 +68,6 @@ def test_set(self): str(context.exception)) """**** Original expected results **** - [1, 2, 3] [] [1, 2, 3] @@ -94,5 +92,4 @@ def test_set(self): *** at top-level: setbinop(x->x,X) *** ^---------------- *** setbinop: incorrect type in setbinop [function needs exactly 2 arguments] (t_CLOSURE). - """ diff --git a/tests/unittests/subst.py b/tests/unittests/subst.py deleted file mode 100644 index fdf0b83..0000000 --- a/tests/unittests/subst.py +++ /dev/null @@ -1,147 +0,0 @@ -# -*- coding: utf-8 -*- -# Created 09/26/2017 - -"""Original pari/GP test file subst : -x; y; p; q; -subst(Y/X,X,x) -substvec(x+y,[x,y],[1,x]) - -\\ #1321 -v = [p + w*q, w*p + q] * Mod(1, w + 1); -substvec(x+y, [x, y], v) -\\ #1447 -subst(O(x^2),x,0*x) -subst(x+O(x^2),x,Mod(1,3)) -subst(x+O(x^2),x,Mod(0,3)) -subst(1/x+O(x^2),x,Mod(0,3)) -subst(2+x+O(x^2),x,Mod(0,3)) -subst(Pol(0),x,Mod(1,3)) -subst(Pol(0),x,Mod(1,3)*matid(2)) -subst(Pol(1),x,Mod(1,3)) -subst(Pol(1),x,Mod(1,3)*matid(2)) - -substpol(x,1/x,y) -substpol(Mod(x*y^2, y^3*x^2+1), y^2,y) -substpol(x*y^2/(y^3*x^2+1), y^2,y) -substpol(List(), y^2,y) -substpol(List(x^2*y^2), y^2,y) -substpol(x^2+y^3*x^3+O(x^4),y^2, y) - -subst(1,x,[;]) -subst(1,x,Mat([1,2])) -subst(x^2+x^3+O(x^4),x, 2*y+O(y^2)) - -substpol(1+O(x^2),x^2,x) -substpol(x^2+O(x^4),x^2,x) -substpol(x+O(x^4),x^2,x) -substpol(1,x^2,x) - -\\#1727 -substvec(1+x+y+x*y+O(x^2), [x,y],[x,y]) - -subst(Mod(1/z,y),z,x) -""" -import unittest -from cypari2 import Pari, PariError - -pari = Pari() - - -class TestSubst(unittest.TestCase): - def test_subst(self): - self.assertEquals(pari.subst('Y/X', 'X', 'x'), 'Y/x') - self.assertEquals(pari.substvec('x+y', ['x', 'y'], [1, 'x']), 'x + 1') - - # #1321 - v = '[p + w*q, w*p + q] * Mod(1, w + 1)'; - self.assertEquals(pari.substvec('x+y', ['x', 'y'], v), '0') - # #1447 - self.assertEquals(pari.subst('O(x^2)', 'x', '0*x'), 'O(x^2)') - with self.assertRaises(PariError) as context: - pari.subst('x+O(x^2)', 'x', pari.Mod(1, 3)) - self.assertTrue('forbidden substitution t_SER , t_INTMOD' in str(context.exception)) - - self.assertEquals(pari.subst('x+O(x^2)', 'x', pari.Mod(0, 3)), 'Mod(0, 3)') - - with self.assertRaises(PariError) as context: - pari.subst('1/x+O(x^2)', 'x', pari.Mod(0, 3)) - self.assertTrue('impossible inverse in gsubst: Mod(0, 3)' in str(context.exception)) - - self.assertEquals(pari.subst('2+x+O(x^2)', 'x', pari.Mod(0, 3)), 'Mod(2, 3)') - self.assertEquals(pari.subst(pari.Pol(0), 'x', pari.Mod(1, 3)), 'Mod(0, 3)') - self.assertEquals(pari.subst(pari.Pol(0), 'x', 'Mod(1,3)*matid(2)'), '[Mod(0, 3), 0; 0, Mod(0, 3)]') - self.assertEquals(pari.subst(pari.Pol(1), 'x', pari.Mod(1, 3)), 'Mod(1, 3)') - self.assertEquals(pari.subst(pari.Pol(1), 'x', 'Mod(1,3)*matid(2)'), '[1, 0; 0, 1]') - - self.assertEquals(pari.substpol('x', '1/x', 'y'), '-1/-y') - self.assertEquals(pari.substpol(pari.Mod('x*y^2', 'y^3*x^2+1'), 'y^2', 'y'), 'Mod(y*x, y^2*x^2 + 1)') - self.assertEquals(pari.substpol('x*y^2/(y^3*x^2+1)', 'y^2', 'y'), 'y*x/(y^2*x^2 + 1)') - self.assertEquals(pari.substpol(pari.List(), 'y^2', 'y'), 'List([])') - self.assertEquals(pari.substpol(pari.List('x^2*y^2'), 'y^2', 'y'), 'List([y*x^2])') - self.assertEquals(pari.substpol('x^2+y^3*x^3+O(x^4)', 'y^2', 'y'), 'x^2 + y^2*x^3 + O(x^4)') - - self.assertEquals(pari.subst(1, 'x', '[;]'), '[;]') - with self.assertRaises(PariError) as context: - pari.subst(1, 'x', pari.Mat([1, 2])) - self.assertTrue('forbidden substitution t_INT , t_MAT (1x2)' in str(context.exception)) - self.assertEquals(pari.subst('x^2+x^3+O(x^4)', 'x', '2*y+O(y^2)'), '4*y^2 + O(y^3)') - - self.assertEquals(pari.substpol('1+O(x^2)', 'x^2', 'x'), '1 + O(x)') - self.assertEquals(pari.substpol('x^2+O(x^4)', 'x^2', 'x'), 'x + O(x^2)') - with self.assertRaises(PariError) as context: - pari.substpol('x+O(x^4)', 'x^2', 'x') - self.assertTrue('domain error in gdeflate: valuation(x) % 2 != 0' in str(context.exception)) - self.assertEquals(pari.substpol(1, 'x^2', 'x'), '1') - - # #1727 - self.assertEquals(pari.substvec('1+x+y+x*y+O(x^2)', ['x', 'y'], ['x', 'y']), '(y + 1) + (y + 1)*x + O(x^2)') - - self.assertEquals(pari.subst(pari.Mod('1/z', 'y'), 'z', 'x'), 'Mod(1, y)/(Mod(1, y)*x)') - -"""**** Original expected results **** - -Y/x -x + 1 -0 -O(x^2) - *** at top-level: subst(x+O(x^2),x,Mod - *** ^-------------------- - *** subst: forbidden substitution t_SER , t_INTMOD. -Mod(0, 3) - *** at top-level: subst(1/x+O(x^2),x,M - *** ^-------------------- - *** subst: impossible inverse in gsubst: Mod(0, 3). -Mod(2, 3) -Mod(0, 3) - -[Mod(0, 3) 0] - -[ 0 Mod(0, 3)] - -Mod(1, 3) - -[1 0] - -[0 1] - --1/-y -Mod(y*x, y^2*x^2 + 1) -y*x/(y^2*x^2 + 1) -List([]) -List([y*x^2]) -x^2 + y^2*x^3 + O(x^4) -[;] - *** at top-level: subst(1,x,Mat([1,2]) - *** ^-------------------- - *** subst: forbidden substitution t_INT , t_MAT (1x2). -4*y^2 + O(y^3) -1 + O(x) -x + O(x^2) - *** at top-level: substpol(x+O(x^4),x^ - *** ^-------------------- - *** substpol: domain error in gdeflate: valuation(x) % 2 != 0 -1 -(y + 1) + (y + 1)*x + O(x^2) -Mod(1, y)/(Mod(1, y)*x) - -""" From a3fd91779ad07f91e5a1893c0e12cd1365b3bb05 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Wed, 17 Jan 2018 15:36:36 +0100 Subject: [PATCH 26/28] unittests : remove unittest_template file --- tests/unittest_template | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 tests/unittest_template diff --git a/tests/unittest_template b/tests/unittest_template deleted file mode 100644 index 2629415..0000000 --- a/tests/unittest_template +++ /dev/null @@ -1,10 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the $creation_date - -""" -Original pari/GP test file $file_name: -parigp_src -""" - -class Test$file_name( From f2554cf955df46ee810782dd6887f11627d95bc8 Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Thu, 18 Jan 2018 11:14:23 +0100 Subject: [PATCH 27/28] unittests : Enhance alltest.py Add file's description. Remove the option to use test suite. --- tests/unittests/alltest.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/unittests/alltest.py b/tests/unittests/alltest.py index 78795b0..8b423b6 100644 --- a/tests/unittests/alltest.py +++ b/tests/unittests/alltest.py @@ -1,3 +1,8 @@ +""" + alltest.py : Launch unittests modules in ``testmodules`` list. + + Each test module corresponds to a PARI-GP test file that was ported into a gmpy2 unittest. +""" import unittest import sys from cypari2 import Pari, PariError @@ -6,7 +11,6 @@ testmodules = [ 'bern', - 'set', 'bit', 'characteristic', 'charpoly', @@ -39,6 +43,7 @@ 'qfb', 'qfbclassno', 'qfsolve', + 'set', 'subcyclo', 'sumdedekind', 'sumformal', @@ -72,15 +77,9 @@ for t in testmodules: - if not ((t in require_galpol and not galpol_installed) or (t in require_seadata and not seadata_installed)): - try: - # If the module defines a suite() function, call it to get the suite. - mod = __import__(t, globals(), locals(), ['suite']) - suitefn = getattr(mod, 'suite') - suite.addTest(suitefn()) - except (ImportError, AttributeError): - # else, just load all the test cases from the module. - suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t)) + if (galpol_installed or t not in require_galpol) and (seadata_installed or t not in require_seadata): + # Load all the test cases from the module. + suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t)) res = unittest.TextTestRunner().run(suite) retcode = 0 if res.wasSuccessful() else 1 From 3505e1dbd27173a3bf8069567672959f1e4fe16c Mon Sep 17 00:00:00 2001 From: Vincent Klein Date: Thu, 18 Jan 2018 12:12:18 +0100 Subject: [PATCH 28/28] unittests : Remove comments from tests_generator.py --- tests/unittests/bern.py | 2 -- tests/unittests/characteristic.py | 2 -- tests/unittests/chinese.py | 2 -- tests/unittests/disc.py | 2 -- tests/unittests/ellmodulareqn.py | 2 -- tests/unittests/factorint.py | 2 -- tests/unittests/galpol.py | 2 -- tests/unittests/idealappr.py | 2 -- tests/unittests/isprime.py | 2 -- tests/unittests/lambert.py | 2 -- tests/unittests/lex.py | 2 -- tests/unittests/lindep.py | 2 -- tests/unittests/linear.py | 2 -- tests/unittests/set.py | 2 -- tests/unittests/subcyclo.py | 2 -- 15 files changed, 30 deletions(-) diff --git a/tests/unittests/bern.py b/tests/unittests/bern.py index 9b7b12e..89b040d 100644 --- a/tests/unittests/bern.py +++ b/tests/unittests/bern.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/19/2017 """Original pari/GP test file bern : bernfrac(0); diff --git a/tests/unittests/characteristic.py b/tests/unittests/characteristic.py index e07fc6f..3ee1415 100644 --- a/tests/unittests/characteristic.py +++ b/tests/unittests/characteristic.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 """Original pari/GP test file characteristic : v=[1,1.,Mod(1,6),1/2,I+Mod(1,3), O(2), quadgen(5)*Mod(1,3), Mod(1,x)]; diff --git a/tests/unittests/chinese.py b/tests/unittests/chinese.py index bfad209..01dbd78 100644 --- a/tests/unittests/chinese.py +++ b/tests/unittests/chinese.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 """Original pari/GP test file chinese : chinese(Mod(x,x^2+1),Mod(x,x^2+1)) diff --git a/tests/unittests/disc.py b/tests/unittests/disc.py index 85a46b9..26bce58 100644 --- a/tests/unittests/disc.py +++ b/tests/unittests/disc.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 """Original pari/GP test file disc : poldisc(Mod(1, 2)*x) diff --git a/tests/unittests/ellmodulareqn.py b/tests/unittests/ellmodulareqn.py index bfd9eed..731f278 100644 --- a/tests/unittests/ellmodulareqn.py +++ b/tests/unittests/ellmodulareqn.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 """Original pari/GP test file ellmodulareqn : \\package:seadata diff --git a/tests/unittests/factorint.py b/tests/unittests/factorint.py index e1c31c1..5651b20 100644 --- a/tests/unittests/factorint.py +++ b/tests/unittests/factorint.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 """Original pari/GP test file factorint : factorint(-33623546348886051018593728804851,1) diff --git a/tests/unittests/galpol.py b/tests/unittests/galpol.py index b7d885f..43db99a 100644 --- a/tests/unittests/galpol.py +++ b/tests/unittests/galpol.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 """Original pari/GP test file galpol : \\ package: galpol diff --git a/tests/unittests/idealappr.py b/tests/unittests/idealappr.py index e109615..f718641 100644 --- a/tests/unittests/idealappr.py +++ b/tests/unittests/idealappr.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 """Original pari/GP test file idealappr : idealaddtoone(nfinit(x),[1,[;]]); diff --git a/tests/unittests/isprime.py b/tests/unittests/isprime.py index 7ec357f..721ad98 100644 --- a/tests/unittests/isprime.py +++ b/tests/unittests/isprime.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/25/2017 """Original pari/GP test file isprime : isprime(5368962301599408606279497323618896374219) diff --git a/tests/unittests/lambert.py b/tests/unittests/lambert.py index 53c3797..2460eeb 100644 --- a/tests/unittests/lambert.py +++ b/tests/unittests/lambert.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/25/2017 """Original pari/GP test file lambert : do(y)=my(x = lambertw(y)); exp(x)*x / y; diff --git a/tests/unittests/lex.py b/tests/unittests/lex.py index 4f62408..202a501 100644 --- a/tests/unittests/lex.py +++ b/tests/unittests/lex.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/25/2017 """Original pari/GP test file lex : v = [0, 2, [1,2], [1,2;3,4], [1,0;1,2], [1,2,3]~, [1,2,3;4,5,6]]; diff --git a/tests/unittests/lindep.py b/tests/unittests/lindep.py index 6c5d913..fdddac1 100644 --- a/tests/unittests/lindep.py +++ b/tests/unittests/lindep.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/25/2017 """Original pari/GP test file lindep : lindep([sqrt(2), sqrt(3), sqrt(2)+sqrt(3)]) diff --git a/tests/unittests/linear.py b/tests/unittests/linear.py index e754fb6..c97fe8d 100644 --- a/tests/unittests/linear.py +++ b/tests/unittests/linear.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/25/2017 """Original pari/GP test file linear : HEAP=[98, if(precision(1.)==38,10174,10354)]; diff --git a/tests/unittests/set.py b/tests/unittests/set.py index 427dfe6..898747d 100644 --- a/tests/unittests/set.py +++ b/tests/unittests/set.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/20/2017 """Original pari/GP test file set : Set(Vecsmall([1,2,1,3])) diff --git a/tests/unittests/subcyclo.py b/tests/unittests/subcyclo.py index a4f84e4..a14c015 100644 --- a/tests/unittests/subcyclo.py +++ b/tests/unittests/subcyclo.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# This file was generated by tests_generator.py -# Generated the 09/21/2017 """Original pari/GP test file subcyclo : polsubcyclo(8,1)