Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

28495 views
License: GPL3
ubuntu2004
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))

poldisc(y^2/x+1, y)
poldisc(x, y)

check(P)=
{
  my(d=poldegree(P));
  if(poldisc(P)*y^(d*(d-1))!=poldisc(subst(P,x,x/y)*y^d),error(P));
}
test(a)=
{
  check(a^0*x^6+(a^9+a^8+a^7+a^6+a^4+a^3+a)*x+(a^9+a^8+a^7+2*a^6+a^4+a^2));
  print(a^0*x^0*0,":",a^0*x^0);
}

test(ffgen(2^10,'a));
test(ffgen(3^10,'a));
test(ffgen([nextprime(2^100),5],'a));
test(Mod(Mod(1,2),ffinit(2,5,'a)));
test(Mod(Mod(1,3),ffinit(3,5,'a)));
my(p=nextprime(2^100)); test(Mod(Mod(1,nextprime(2^100)),ffinit(p,3,'a)));

\\ #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)

poldiscfactors(x^0)
poldiscfactors(x)
poldiscfactors(x^2+1)
T=x^4 - 36769809176826048*x^3 + 341005843447471336362247372459582*x^2 - 55175428449449617975400382424484477584006986048*x + 2251690401007462966577022376495167683872612094945483390567809;
poldiscfactors(T)
poldiscfactors(T,1)

T=y^24+4*y^23-14*y^22-72*y^21+79*y^20+596*y^19-26*y^18-2440*y^17-913*y^16+6004*y^15+4594*y^14-6872*y^13-3220*y^12+14436*y^11+20340*y^10+10564*y^9+21950*y^8+28292*y^7+38580*y^6+31312*y^5+64413*y^4+46004*y^3+48710*y^2+18852*y+22307;
poldiscfactors(T)

a=ffgen(3^2,'a);poldisc(x^6+a*x+y)

poldisc(Pol(0))

\\#2157
poldisc(x^4 + 8/y*x)

\\ ERRORS, keep at end of file
poldisc(x^2/y^2, y)