Michael Somos on Tue, 4 Sep 2001 17:06:56 -0400

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

addfrac() + Karatsuba = bug

The following indicates a problem with 'addfrac()' which interacts
badly with the Karatsuba multiplication in the kernel. It only acts
up when the numbers get big enough for Karatsuba to kick in. It is
there in CVS 2.2.1 a few weeks ago. I suggest making the Karatsuba
threshold a 'default()' settable parameter for user convenience.

parisize = 4000000, primelimit = 500000
? add(v1,v2)=[v1[1]*v2[2]+v1[2]*v2[1],v1[2]*v2[2]]
? equ(v1,v2)=v1[1]*v2[2]==v1[2]*v2[1]
? frv(x)=[numerator(x),denominator(x)]
? tst(x1,x2)=equ(frv(x1+x2),add(frv(x1),frv(x2)))
? rn()=random(N)
? doit(x,n)=
? doit(10^241,10)
? \v
                  GP/PARI CALCULATOR Version 2.1.0 (released)
                i686 running linux (ix86 kernel) 32-bit version
                (readline v2.2 enabled, extended help available)

Shalom, Michael