source: git/Tst/Buch/Example_6_2_10.tst @ 891438c

spielwiese
Last change on this file since 891438c was 891438c, checked in by Gerhard Pfister <pfister@…>, 23 years ago
*GP: initial release git-svn-id: file:///usr/local/Singular/svn/trunk@5579 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 979 bytes
Line 
1LIB "tst.lib";
2tst_init();
3
4proc invers(poly p, int k)
5{
6    poly q=1/p[1];
7    poly re=q;
8    p=q*(p[1]-jet(p,k));
9    poly s=p;
10    while(p!=0)
11    {
12       re=re+q*p;
13       p=jet(p*s,k);
14     }
15     return(re);
16}
17
18proc Weierstrass(poly f,poly g,int k)
19{
20   int i;
21   int n=nvars(basering);
22   poly p=f;
23   for(i=1;i<=n-1;i++)
24   {
25      p=subst(p,var(i),0);
26   }
27   if(p==0)
28   {
29      "the polynomial is not regular";
30      return(0);
31   }
32   int m=ord(p);
33   poly hf=f/var(n)^m;
34   poly rf=f-var(n)^m*hf;
35   poly invhf=invers(f/var(n)^m,k);
36   poly w=-invhf*rf;
37   poly u=g/var(n)^m;
38   poly v=u;
39   poly H=jet((w*u)/var(n)^m,k);
40   while(H!=0)
41   {
42      v=v+H;
43      H=jet((w*H)/var(n)^m,k);
44   }
45   poly q=v*invhf;
46   return(q);
47}
48
49ring R=0,(x,y),ds;
50poly f=y4+xy+x2y6+x7;
51poly g=y4;
52poly q=Weierstrass(f,g,10);
53poly w=jet(q*f,10);
54ring S=(0,x),y,ds;
55poly w=imap(R,w);
56w;
57
58setring R;
59q=Weierstrass(f,g,15);
60w=jet(q*f,15); 
61setring S;
62w=imap(R,w);
63w;
64
65
66tst_status(1);$
Note: See TracBrowser for help on using the repository browser.