McLaughlin, James on Thu, 29 Jan 2004 00:10:49 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Bug?


I am using 
  GP/PARI CALCULATOR Version 2.2.6 (development CHANGES-1.756)
        i386 running cygwin (ix86 kernel) 32-bit version
      compiled: May 28 2003, gcc-3.2 20020927 (prerelease)
        (readline v4.3 enabled, extended help available)
               Copyright (C) 2003 The PARI Group
 
I have a simple program which I use to work out the regular continued fraction expansion of rational functions (it may not be the most efficient but thats something else). Here is a really simple version that reproduces the problem I am having:
 
 
allocatemem(356000000)
{
a=1; b=7; d=17;
f=Pol(a*x^2+b*x+d,x);
r=Pol((x+1)*(f+1),x);
s=Pol(x*f,x);
cf=[];
while(s,
c=5; m=0;
t = r;
while(c,
dr = poldegree(t);
ds = poldegree(s);
cr = polcoeff(t,dr);
cs = polcoeff(s,ds);
e = dr - ds;
m = Pol(m + (x^e)*cr/cs,x);
t = Pol(t - s*(x^e)*cr/cs,x);
c = floor((poldegree(t) +1)/(poldegree(s) +1));
);
cf = concat(cf,[m]);
r = s;
s = t;
);
x=3;
der=cf;
print(der);
print(comp);
print(eval(cf));
kill(x);
}
 
It does not seem to matter how big I make the stack with "allocatemem( )", I still get an error message:
 

  ***   the PARI stack overflows !
  current stack size: 356000000 (339.508 Mbytes)
  [hint] you can increase GP stack with allocatemem()

 
This should require almost no computation. When I run it at my old university, where they have version
 GP/PARI CALCULATOR Version 2.1.4 (released)
                 UltraSparc (MicroSparc kernel) 32-bit version
                (readline v4.1 enabled, extended help available)
                       Copyright (C) 2002 The PARI Group

It runs pretty much instantaneously. Do later versions have some problem or is there something in my code that is provoking something odd?
 
Thanks,
 
Jimmy Mc Laughlin.