Fix typo in display-html-help
[maxima.git] / share / contrib / Grobner / rtest_grobner.mac
blob383d63d52bbd9963dfe5f1d91d6ce5c7cb1b9f0f
1 /* this is a bit of a hack ... oh well. */
2 (if not ?boundp ('poly_monomial_order) then load (grobner), 0);
3 0;
5 /* mailing list 2015-12-10: "problem with poly_pseudo_divide" */
7 (kill(p, q, a, r, c, n),
8  p:-768*y[2]^3*y[5]^7-288*y[2]*y[4]^2*y[5]^6-2016*y[2]^3*y[4]^2*y[5]^5
9   -540*y[2]*y[4]^4*y[5]^4-1788*y[2]^3*y[4]^4*y[5]^3
10   -252*y[2]*y[4]^6*y[5]^2-540*y[2]^3*y[4]^6*y[5],
11  q:50688*y[2]^2*y[4]^2*y[5]^10+16896*y[4]^4*y[5]^9
12   +198144*y[2]^2*y[4]^4*y[5]^8+59712*y[4]^6*y[5]^7
13   +292680*y[2]^2*y[4]^6*y[5]^6+79656*y[4]^8*y[5]^5
14   +193464*y[2]^2*y[4]^8*y[5]^4+47640*y[4]^10*y[5]^3
15   +48240*y[2]^2*y[4]^10*y[5]^2+10800*y[4]^12*y[5],
16  qlist : [q],
17  [a, r, c, n] : poly_pseudo_divide(p,qlist,[y[2]]));
18 [[y[2]*((-64*y[5]^4)-104*y[4]^2*y[5]^2-45*y[4]^4)],
19  y[2]*((-135168*y[4]^4*y[5]^13)-241152*y[4]^6*y[5]^11
20                                +883008*y[4]^8*y[5]^9
21                                +3230808*y[4]^10*y[5]^7
22                                +4009776*y[4]^12*y[5]^5
23                                +2253960*y[4]^14*y[5]^3
24                                +486000*y[4]^16*y[5]),
25  4224*y[4]^2*y[5]^7+12288*y[4]^4*y[5]^5+12102*y[4]^6*y[5]^3
26                    +4020*y[4]^8*y[5],1];
28 is (equal (c*p, sum (a[i]*qlist[i], i, 1, n) + r));
29 true;
31 poly_add(z+x^2*y,x-z,[x,y,z]);
32 x^2*y+x$
33 poly_subtract(z+x^2*y,x-z,[x,y,z]);
34 2*z+x^2*y-x$
35 poly_multiply(z+x^2*y,x-z,[x,y,z])-(z+x^2*y)*(x-z),expand;
37 poly_primitive_part(35*y+21*x,[x,y]);
38 5*y + 3*x$
39 poly_expand((x-y)*(y+x),[x,y]);
40 x^2-y^2$
41 poly_expand((y+x)^2,[x,y]);
42 y^2+2*x*y+x^2$
43 poly_expand((y+x)^5,[x,y]);
44 y^5+5*x*y^4+10*x^2*y^3+10*x^3*y^2+5*x^4*y+x^5$
45 poly_expand(-1-x*exp(y)+x^2/sqrt(y),[x]);
46 (-x*sqrt(y)*%e^y)-sqrt(y)+x^2$
47 poly_expand(-1-sin(x)^2+sin(x),[sin(x)]);
48 (-sin(x)^2)+sin(x)-1$
49 poly_expt(x-y,3,[x,y])-(x-y)^3,expand;
51 poly_content(35*y+21*x,[x,y]);
53 poly_gcd(6*x^3+19*x^2+19*x+6,6*x^5+13*x^4+12*x^3+13*x^2+6*x,[x]);
54 6*x^2+13*x+6$
55 poly_grobner_equal([y+x,x-y],[x,y],[x,y]);
56 false$
57 poly_s_polynomial(x+y,x-y,[x,y]);
58 2*y$
59 poly_normal_form(x^2+y^2,[x-y,x+y],[x,y]);
60 2*y^2$
61 poly_pseudo_divide(2*x^2+3*y^2,[7*x-y^2,11*x+y],[x,y]);
62 [[2*y^2+14*x,0],2*y^4+147*y^2,49,2]$
63 poly_exact_divide((x+y)^2,x+y,[x,y]);
64 y+x$
65 poly_buchberger([x^2-y*x,x^2+y+x*y^2],[x,y]);
66 [x^2-x*y,x*y^2+y+x^2,(-x*y^2)-x*y-y,y^2-x*y,(-y^3)-y^2-y]$
67 poly_reduction([x^2-x*y,x*y^2+y+x^2,x*y^2+x*y+y,x*y-y^2,y^3+y^2+y],[x,y]);
68 [x*y-y^2,y^3+y^2+y,x^2-y^2]$
69 poly_minimization([x^2-x*y,x*y^2+y+x^2,x*y^2+x*y+y,x*y-y^2,y^3+y^2+y],[x,y]);
70 [x*y^2+y+x^2,x*y^2+x*y+y,y^3+y^2+y]$
71 poly_reduced_grobner([x^2-y*x,x^2+y+x*y^2],[x,y]);
72 [y^2-x*y,(-y^3)-y^2-y,x^2-y^2]$
73 poly_normalize(2*x+y,[x,y]);
74 y/2+x$
75 poly_normalize_list([2*x+y,3*x^2+7],[x,y]);
76 [y/2+x,x^2+7/3]$
77 poly_depends_p(x^2+y,x,[x,y,z]);
78 true$
79 poly_depends_p(x^2+y,z,[x,y,z]);
80 false$
81 poly_elimination_ideal([x+y,x-y],0,[x,y]);
82 [y,x]$
83 poly_elimination_ideal([x+y,x-y],1,[x,y]);
84 [y]$
85 poly_elimination_ideal([x+y,x-y],2,[x,y]);
86 []$
87 poly_reduced_grobner([x^2-2*x*y+2*y-1,x^2*y^2-2*x*y^3+2*y^3+y-2],[x,y]);
88 [(-2*x*y)+2*y+x^2-1,(-y^2)-y+2]$
89 poly_reduced_grobner([x^2+2*y^2-3,x^2+x*y+y^2-3],[x,y]);
90 [y^2-x*y,y^3-y,(-2*y^2)-x^2+3]$