Karim Belabas on Sun, 03 Oct 2004 19:59:39 +0200


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

Re: bug in poldegree?


* Markus Endres [2004-10-03 17:22]:
> on my system (debian) I use pari/gp 2.2.6 and the newest cvs-version
> 2.2.8. 
> 
> now, lets have a look at the following polynomial:
> 
> P=
> (2.5134558550000000000000000000000000000000000000000000000000000000000000000000000 E-88 + 0.E-87*I)*y^2 + (1.0000000000000000000000000000000000000000000000000000000000000000000000000000000 + 0.E-86*I)*y + (1.6086117470000000000000000000000000000000000000000000000000000000000000000000000 E-86 - 1.6086117470000000000000000000000000000000000000000000000000000000000000000000000 E-86*I)
> 
> I got this polynomial from some computings under 2.2.8. if I want to
> know
> 
> ? poldegree(P)
> = -2147483647
> 
> I get this strange degree

PARI's idea of -oo.

>it should be 2.

or possibly 1, since the leading coefficient is an inexact 0. [ Weird at first
glance but the test x == 0 for complex numbers is implemented to mimic |x|
== 0, and here abs(pollead(P)) is 0.E-87 ]

> under pari/gp 2.2.6 and the stable version everything is ok. 
> 
> is this a bug? 

Yes, it's due to an unfortunate optimization I introduced: when adding
two polynomials A and B of different degrees a > b, I assumed the result
would be non-zero if A was non-zero. (Hence skiiped a normalization.) This
isn't true if leading coefficients are (inexact) zero...

It's fixed in CVS.

Thanks,

    Karim.

P.S: The preferred way to report a bug [ or generally enquire about
surprising behaviour, or submit wishlist items... ] is to use the Bug
Tracking System at

  http://pari.math.u-bordeaux.fr/Bugs/
-- 
Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dep. de Mathematiques, Bat. 425   Fax: (+33) (0)1 69 15 60 19
Universite Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://pari.math.u-bordeaux.fr/  [PARI/GP]