Karim BELABAS on Fri, 3 Dec 1999 18:11:42 +0100 (MET)


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

Re: power series bug?


[Michael Somos:]
> gp> for(n=1,12,print(n" "(1+O(t))*x^n * (1+O(t))*x^n ))
> 1 (1 + O(t))*x^2
[...]
> 9 (1 + O(t))*x^18 + O(t)*x^13
[...]
> This looks like a bug to me. The 1.39 version did not do this. Shalom, Michael

Strictly speaking it's not a bug since the result is correct (0 is indeed
O(t)). On the other hand, given the input, it could have been more precise.
It comes from Karatsuba multiplication and the annoying fact that

   (a0 + a1) * (b0 + b1) - a0 * b0 - a1 * b1

which is the standard way of computing the "middle term" is not exactly the
same as

    a0 * b1 + a1 * b0

when the entries are approximate. I don't see any way of correcting this
besides disabling fast multiplication when the entries are not exact, and we
don't want that. I can fix this particular case though: factor out x first,
multiply what's left, then multiply back by x^n.

     Karim.

P.S: 1.39 didn't have Karatsuba...
__
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://hasse.mathematik.tu-muenchen.de/ntsw/pari/