Ticket #13314: 13314_polroots_test.patch
File 13314_polroots_test.patch, 5.2 KB (added by , 10 years ago) |
---|
-
sage/rings/polynomial/multi_polynomial_element.py
# HG changeset patch # User Jeroen Demeyer <jdemeyer@cage.ugent.be> # Date 1346672496 -7200 # Node ID f51ba871a50b7d33235ea89cacdc1ef268a340ae # Parent de89b9eba0d8afd11fa0d363d21defecabd5848c Add regression test for PARI polroots() diff --git a/sage/rings/polynomial/multi_polynomial_element.py b/sage/rings/polynomial/multi_polynomial_element.py
a b 1491 1491 sage: R.<z> = PolynomialRing(CC,1) 1492 1492 sage: f = z^4 - 6*z + 3 1493 1493 sage: f.factor() 1494 (z - 1.60443920904349 - 2.91339356278998e-26*I) * (z - 0.511399619393097 + 6.96082630860956e-26*I) * (z + 1.05791941421830 - 1.59281852704435*I) * (z + 1.05791941421830 + 1.59281852704435*I) # 32-bit 1495 (z - 1.60443920904349) * (z - 0.511399619393097) * (z + 1.05791941421830 - 1.59281852704435*I) * (z + 1.05791941421830 + 1.59281852704435*I) # 64-bit 1494 (z - 1.60443920904349) * (z - 0.511399619393097) * (z + 1.05791941421830 - 1.59281852704435*I) * (z + 1.05791941421830 + 1.59281852704435*I) 1496 1495 1497 1496 TESTS: 1498 1497 1499 Check if we can handle polynomials with no variables, #7950::1498 Check if we can handle polynomials with no variables, see :trac:`7950`:: 1500 1499 1501 1500 sage: P = PolynomialRing(ZZ,0,'') 1502 1501 sage: res = P(10).factor(); res … … 1513 1512 ... 1514 1513 ArithmeticError: Prime factorization of 0 not defined. 1515 1514 1516 Check if we can factor constant polynomial, #8207::1515 Check if we can factor a constant polynomial, see :trac:`8207`:: 1517 1516 1518 1517 sage: R.<x,y> = CC[] 1519 1518 sage: R(1).factor() 1520 1519 1.00000000000000 1521 1520 1522 Check that we prohibit too large moduli, #11829::1521 Check that we prohibit too large moduli, :trac:`11829`:: 1523 1522 1524 1523 sage: R.<x,y> = GF(previous_prime(2^31))[] 1525 1524 sage: factor(x+y+1,proof=False) -
sage/tests/parigp.py
diff --git a/sage/tests/parigp.py b/sage/tests/parigp.py
a b 1 1 r""" 2 3 2 This file is meant to catch errors in the PARI/GP package which are not 4 3 caught by any other tests. 5 4 6 Check that ticket #9876has been fixed, this test comes from PARI's5 Check that :trac:`9876` has been fixed, this test comes from PARI's 7 6 self-test "rnfkummer":: 8 7 9 8 sage: pari('setrand(1); lift(rnfkummer(bnrinit(bnfinit(y^4-52*y^2+26,1),3,1),Mat(5)))') # long time (4s on sage.math, 2011) 10 9 x^5 + (-12490585381661544359255403301035053110061910*y^3 + 8875378520404561472503422910872004290197460*y^2 + 643203912732761873050292808675549433737179610*y - 457038484130159980782436350930533714409061170)*x^3 + (-134027514281645340620300162483056350640850689292892267066826165512*y^3 + 95235243030030469814112992330493778292557062830362488860799262053*y^2 + 6901759924725033375901003506523314713919218011682438894990413482822*y - 4904148131739972327284545793455166015180538153351582525198684659988)*x^2 + (-47397957557570888155708856849994683849365520972511563824369572802678417823703951003630*y^3 + 33679323468496441220407209890566679520252152888549909181980050360738580514765560899830*y^2 + 2440762448949326006691055037485233408803108189791110990339027554592708168372793653934980*y - 1734320048033240933678067521047553381449799255523887315704756124974424249211251806055445)*x + (88847913213212543643724914281374137431466584547137800780754135469698376356168903046151157223082894732483818/5*y^3 - 63132205749445286461822170095386361952302057584137825393349862937480952856334509099209369622841067534904427/5*y^2 - 4575231959624371057665356018310756876851369587901000773265750996233180145132238920504044583057371848969400608/5*y + 3250999094748458040342075570309205473235256099747294466325048378505864671503910959921397017511503388596960342/5) 11 10 12 Check that ticket #10195(PARI bug 1153) has been fixed::11 Check that :trac:`10195` (PARI bug 1153) has been fixed:: 13 12 14 13 sage: print gp.eval("mathnf([0,0,0,0,0,0,0,0,0,13;0,0,0,0,0,0,0,0,23,6;0,0,0,0,0,0,0,23,-4,-7;0,0,0,0,0,0,17,-3,5,-5;0,0,0,0,0,56,16,-16,-15,-17;0,0,0,0,57,24,-16,-25,2,-21;0,0,0,114,9,56,51,-52,25,-55;0,0,113,-31,-11,24,0,28,34,-16;0,50,3,2,16,-6,-2,7,-19,-21;118,43,51,23,37,-52,18,38,51,28],0)") 15 14 [787850171872400 32189386376004 356588299060422 742392731867995 282253457851430 665185047494955 664535243562463 744564809133574 113975061998590 527459013372200] … … 23 22 [0 0 0 0 0 0 0 0 1 0] 24 23 [0 0 0 0 0 0 0 0 0 1] 25 24 26 Check that ticket #11604(PARI bug 1154) has been fixed::25 Check that :trac:`11604` (PARI bug 1154) has been fixed:: 27 26 28 27 sage: A = Matrix(ZZ,4,4,[32982266684193100, 1368614777139719, 224591013270052693, 276460184982223238,1368614777139719, 56791380087354, 9319512049770279, 11471848267545007,224591013270052693, 9319512049770279,1529340971891522140, 1882541434053596358,276460184982223238, 11471848267545007, 1882541434053596358, 2317313350044091414]) 29 28 sage: pari(A).qfminim(2,0) 30 29 [0, 0, [;]] 30 31 Check :trac:`13314`, the following should not give a 32 Segmentation Fault:: 33 34 sage: x = polygen(ComplexField(128)) 35 sage: p = x^84 + (16*x^4 - 1)^20 * (2^48*x^4 - 2049^4) 36 sage: len(pari(p).polroots(precision=128)) 37 84 31 38 """