Michael Somos on Fri, 15 Mar 2002 14:32:13 -0500


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

serreverse() bugs


PARI-GP developers:

There is at least two bugs in 'serreverse()'. One is very easy to fix,
but the other is probably a stack clobber bug. Here is the evidence :

? \v
                 GP/PARI CALCULATOR Version 2.2.3 (development)
                 UltraSparc (MicroSparc kernel) 32-bit version
              (readline v2.2 enabled, extended help not available)
? serreverse(O(x))
  ***   incorrect type in gmulsg.
? serreverse(x+O(x^2))
  ***   bug in GP (Bus Error), please report
? oo=12;
? a(n)=eval(Str("a"n))
? d(z,n)=denominator(polcoeff(z,n))/n!
? y=sum(n=1,oo,a(n)*x^n/n!,x*O(x^oo));
? for(n=2,oo,z=serreverse(y+x*O(x^n));print(n" "gettime" "d(z,n)))
2 30 a1^3
3 0 a1^5
4 0 a1^7
5 0 0
6 10 0
7 10 0
8 20 a1^15
9 50 0
10 200 0
11 1560 0
12 16430 0
? 

The first bug is due to assumption that terms exist which don't in :

    u[2]=un; u[3]=lmulsg(-2,(GEN)x[3]);
    y[2]=un; y[3]=lneg((GEN)x[3]);

The second bug is a mystery to me. Shalom, Michael