source: git/Tst/Short/gcd0_s.tst @ 559a4b

spielwiese
Last change on this file since 559a4b was 559a4b, checked in by Jens Schmidt <schmidt@…>, 26 years ago
Initial revision git-svn-id: file:///usr/local/Singular/svn/trunk@1409 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.2 KB
Line 
1// $Id: gcd0_s.tst,v 1.1 1998-04-21 12:55:43 schmidt Exp $
2
3//
4// gcd0_s.tst - short tests for gcd calculations in Z.
5//
6// All univariate non-trivial examples come from gcdUniv0Std.fex or
7// gcdUniv0Alpha.fex.  Some of the examples are multiplied with elements
8// from Q to test clearing of denominators.
9//
10// The examples in variables `u' and `v' came from `coprasse(2/0/1)'
11// in stdMultiv0Gcd.in.
12//
13// To Do:
14//
15// o multivariate gcd calculations with parameters
16// o algrebraic extensions of char 0 not implemented yet
17//   (but tests already exist)
18//
19
20LIB "tst.lib";
21tst_init();
22tst_ignore("CVS ID  : $Id: gcd0_s.tst,v 1.1 1998-04-21 12:55:43 schmidt Exp $");
23
24//
25// - ring r1=0,x,dp.
26//
27
28tst_ignore( "ring r1=0,x,dp;" );
29ring r1=0,x,dp;
30
31poly f=(-9554*x^4-12895*x^3-10023*x^2-6213*x);
32poly g;
33
34// some trivial examples
35gcd(0, 0);
36gcd(0, 3123);
37gcd(4353, 0);
38
39gcd(0, f);
40gcd(f, 0);
41
42gcd(23123, f);
43gcd(f, 13123);
44
45// some trivial examples involving rational numbers
46f=11/47894*19*(-9554*x^4-12895*x^3-10023*x^2-6213*x);
47
48gcd(0, 3123/123456);
49gcd(4353/8798798, 0);
50
51gcd(0, f);
52gcd(f, 0);
53
54gcd(23123/3, f);
55gcd(f, 13123/2);
56
57// some less trivial examples
58f=(2*x^3+2*x^2+2*x);
59g=(x^3+2*x^2+2*x+1);
60gcd(f, g);
61
62f=(-x^9-6*x^8-11*x^7-17*x^6-14*x^5-14*x^4-8*x^3-6*x^2-2*x-1);
63g=(-x^9-2*x^8-2*x^7-3*x^4-6*x^3-6*x^2-3*x-1);
64gcd(f, g);
65
66f=(4*x^9+12*x^8+29*x^7+42*x^6+54*x^5+48*x^4+35*x^3+17*x^2+6*x+1);
67g=(x^11+6*x^10+11*x^9+17*x^8+14*x^7+14*x^6+8*x^5+6*x^4+2*x^3+x^2);
68gcd(f, g);
69gcd(1/13*f, 1/4*g);
70
71f=(1412500*x^6+6218750*x^5-6910000*x^4-1201250*x^3-19470000*x^2-27277500*x);
72g=(156600000*x^5-1363865625*x^4+2627604000*x^3-2727731250*x^2+4628808000*x);
73gcd(f, g);
74
75//
76// - ring r2=(0,a),x,dp; minpoly=a^4+a^3+a^2+a+1.
77//
78
79tst_ignore( "ring r2=(0,a),x,dp;" );
80ring r2=(0,a),x,dp;
81minpoly=a^4+a^3+a^2+a+1;
82
83poly f=(-9554*x^4-12895*x^3-10023*x^2-6213*x);
84poly g;
85
86// first, some of the r1 examples (slightly modified)
87gcd(0, 0);
88gcd(0, 3123*a);
89gcd(4353, 0);
90
91gcd(0, f);
92gcd(f, 0);
93
94gcd(23123, f);
95gcd(f, 13123);
96
97// some trivial examples involving rational numbers
98f=11/47894*19*(-9554*x^4-12895*x^3-10023*x^2-6213*x);
99
100gcd(0, 3123/(123456*a));
101gcd(4353/8798798, 0);
102
103gcd(0, f/a);
104gcd(f, 0);
105
106gcd(23123/(3*a), f);
107gcd(f, 13123/2);
108
109// some less trivial examples
110f=(2*x^3+2*x^2+2*x);
111g=(x^3+2*x^2+2*x+1);
112gcd(f, g);
113
114// we go on with modified variable names
115tst_ignore( "ring r2=(0,v),u,dp;" );
116kill r2;
117ring r2=(0,v),u,dp;
118minpoly=v^4+v^3+v^2+v+1;
119
120poly f;
121poly g;
122
123// last not least, some less trivial examples
124// involving the algebraic variable.  Examples
125// are from r3.
126f=(-8*u^2*v+8*u*v^2-24*u);
127g=(-64*u^2*v+16*u*v^2);
128gcd(f, g);
129
130f=(192*u^6*v^4-240*u^5*v^5+384*u^5*v^3+48*u^4*v^6+96*u^4*v^4-576*u^4*v^2-48*u^3*v^5+144*u^3*v^3);
131g=(1536*u^6*v^4-768*u^5*v^5-1536*u^5*v^3+96*u^4*v^6+768*u^4*v^4-96*u^3*v^5);
132gcd(f, g);
133
134f=(-256*u^3*v+128*u^2*v^2-16*u*v^3);
135g=(-64*u^3+48*u^2*v^2+32*u^2*v-192*u^2-12*u*v^3-4*u*v^2+48*u*v);
136gcd(f, g);
137
138//
139// - ring r3=(0,t),x,dp.
140//
141
142tst_ignore( "ring r3=(0,t),x,dp;" );
143ring r3=(0,t),x,dp;
144
145poly f=(-9554*x^4-12895*x^3-10023*x^2-6213*x);
146poly g;
147
148// first, some of the r1 examples (slightly modified)
149gcd(0, 0);
150gcd(0, 3123*t);
151gcd(4353, 0);
152
153gcd(0, f);
154gcd(f, 0);
155
156gcd(23123, f);
157gcd(f, 13123);
158
159// some trivial examples involving rational numbers
160f=11/47894*19*(-9554*x^4-12895*x^3-10023*x^2-6213*x);
161
162gcd(0, 3123/(123456*t));
163gcd(4353/8798798, 0);
164
165gcd(0, f/t);
166gcd(f, 0);
167
168gcd(23123/(3*t), f);
169gcd(f, 13123/2);
170
171// some less trivial examples
172f=(2*x^3+2*x^2+2*x);
173g=(x^3+2*x^2+2*x+1);
174gcd(f, g);
175
176// we go on with modified variable names
177tst_ignore( "ring r3=(0,u),v,dp;" );
178kill r3;
179ring r3=(0,u),v,dp;
180
181poly f;
182poly g;
183
184// last not least, some less trivial examples
185// involving the transcendental variable
186f=(-8*u^2*v+8*u*v^2-24*u);
187g=(-64*u^2*v+16*u*v^2);
188gcd(f, g);
189
190f=(192*u^6*v^4-240*u^5*v^5+384*u^5*v^3+48*u^4*v^6+96*u^4*v^4-576*u^4*v^2-48*u^3*v^5+144*u^3*v^3);
191g=(1536*u^6*v^4-768*u^5*v^5-1536*u^5*v^3+96*u^4*v^6+768*u^4*v^4-96*u^3*v^5);
192gcd(f, g);
193
194f=(-256*u^3*v+128*u^2*v^2-16*u*v^3);
195g=(-64*u^3+48*u^2*v^2+32*u^2*v-192*u^2-12*u*v^3-4*u*v^2+48*u*v);
196gcd(f, g);
197
198//
199// - ring r4=0,(t,x),dp.
200//
201// The examples from r4 are those from r3 with parameters
202// changed to ring variables.
203//
204
205tst_ignore( "ring r4=0,(t,x),dp;" );
206ring r4=0,(t,x),dp;
207
208poly f=(-9554*x^4-12895*x^3-10023*x^2-6213*x);
209poly g;
210
211// first, some of the r1 examples (slightly modified)
212gcd(0, 0);
213gcd(0, 3123*t);
214gcd(4353, 0);
215
216gcd(0, f);
217gcd(f, 0);
218
219gcd(23123, f);
220gcd(f, 13123);
221
222// some trivial examples involving rational numbers
223f=11/47894*19*(-9554*x^4-12895*x^3-10023*x^2-6213*x);
224
225gcd(0, 3123/123456*t);
226gcd(4353/8798798, 0);
227
228gcd(23123/3*t, f);
229gcd(f, 13123/2);
230
231// some less trivial examples
232f=(2*x^3+2*x^2+2*x);
233g=(x^3+2*x^2+2*x+1);
234gcd(f, g);
235
236// we go on with modified variable names
237tst_ignore( "ring r4=0,(u,v),dp;" );
238kill r4;
239ring r4=0,(u,v),dp;
240
241poly f;
242poly g;
243
244// last not least, some less trivial examples
245// involving both variables
246f=(-8*u^2*v+8*u*v^2-24*u);
247g=(-64*u^2*v+16*u*v^2);
248gcd(f, g);
249
250f=(192*u^6*v^4-240*u^5*v^5+384*u^5*v^3+48*u^4*v^6+96*u^4*v^4-576*u^4*v^2-48*u^3*v^5+144*u^3*v^3);
251g=(1536*u^6*v^4-768*u^5*v^5-1536*u^5*v^3+96*u^4*v^6+768*u^4*v^4-96*u^3*v^5);
252gcd(f, g);
253
254f=(-256*u^3*v+128*u^2*v^2-16*u*v^3);
255g=(-64*u^3+48*u^2*v^2+32*u^2*v-192*u^2-12*u*v^3-4*u*v^2+48*u*v);
256gcd(f, g);
257$
Note: See TracBrowser for help on using the repository browser.