Sun Aug 18 16:08:47 2002 run on Windows
% Test series for the package MODSR: SOLVE and ROOTS for
% modular polynomials and modular polynomial systems.
% Moduli need not be primes.
on modular;
setmod 8;
1
m_solve(2x=3);
{}
% {}
m_solve(2x=4);
{{x=2},{x=6}}
% {{x=2},{x=6}}
m_solve(x^2-1);
{{x=1},{x=3},{x=5},{x=7}}
% {{x=1},{x=3},{x=5},{x=7}}
m_solve({x^2-y^3=3});
{{x=0,y=5},
{x=2,y=1},
{x=4,y=5},
{x=6,y=1}}
% {{x=0,y=5}, {x=2,y=1}, {x=4,y=5}, {x=6,y=1}}
m_solve({x^2-y^3=3,x=2});
{{y=1,x=2}}
% {{y=1,x=2}}
m_solve({x=2,x^2-y^3=3});
{{x=2,y=1}}
% {{x=2,y=1}}
m_solve({x1,x2 + 6,2*x1**3 + 4*x2**4 + x3 + 6});
{{x1=0,x2=2,x3=2}}
% {{x1=0,x2=2,x3=2}}
setmod 800;
8
m_solve(x^2-1);
{{x=1},
{x=49},
{x=351},
{x=399},
{x=401},
{x=449},
{x=751},
{x=799}}
% {{x=1}, {x=49}, {x=351}, {x=399}, {x=401}, {x=449}, {x=751}, {x=799}}
m_solve({x1 + 51,
282*x1^4 + x2 + 468,
x3 + 1054,
256*x1^2 + 257*x2^4 + 197*x3 + x4 + 653,
255*x1^4 + 40*x2^2 + x5 + 868,
230*x1^4 + 670*x3 + 575*x4^4 + 373*x5^3 + x6 + 1328,
182*x4^4 + 727*x5^2 + 609*x6**4 + x7 + 1032,
623*x1^3 + 614*x2^4 + 463*x3**2 + 365*x4 + 300*x7 + x8 + 1681});
{{x1=749,x2=50,x3=546,x4=729,x5=77,x6=438,x7=419,x8=399}}
% {{x1=749,x2=50,x3=546,x4=729,x5=77,x6=438,x7=419,x8=399}}
m_solve{x+y=4,x^2+y^2=8};
{{x=2,y=2},
{x=22,y=782},
{x=42,y=762},
{x=62,y=742},
{x=82,y=722},
{x=102,y=702},
{x=122,y=682},
{x=142,y=662},
{x=162,y=642},
{x=182,y=622},
{x=202,y=602},
{x=222,y=582},
{x=242,y=562},
{x=262,y=542},
{x=282,y=522},
{x=302,y=502},
{x=322,y=482},
{x=342,y=462},
{x=362,y=442},
{x=382,y=422},
{x=402,y=402},
{x=422,y=382},
{x=442,y=362},
{x=462,y=342},
{x=482,y=322},
{x=502,y=302},
{x=522,y=282},
{x=542,y=262},
{x=562,y=242},
{x=582,y=222},
{x=602,y=202},
{x=622,y=182},
{x=642,y=162},
{x=662,y=142},
{x=682,y=122},
{x=702,y=102},
{x=722,y=82},
{x=742,y=62},
{x=762,y=42},
{x=782,y=22}}
off modular;
% m_roots has the modulus as its second argument.
m_roots(x^2-1,8);
{1,3,5,7}
% {1,3,5,7}
m_roots(x^3-1,7);
{1,2,4}
% {1,2,4}
m_roots(x^3-x,7);
{0,1,6}
% {0,1,6}
m_roots((x-1)*(x-2)*(x-3),7);
{1,2,3}
% {1,2,3}
m_roots((x-1)*(x-2)*(x^3-1)*(x-5),7);
{1,2,4,5}
% {1,2,4,5}
m_roots((x-1)*(x-2)*(x^3-1)*(x-5),1009);
{1,2,5,374,634}
% {1,2,5,374,634}
m_roots((x-1)*(x-2)*(x^3-1)*(x-5),1000);
{1,2,5,26,51,101,127,130,151,201,226,251,255,301,351,377,401,426,451,501,505,551
,601,626,627,651,701,751,755,801,826,851,877,901,951}
length ws;
35
% 35
end;
Time for test: 1852 ms