Bill Allombert on Sat, 11 Aug 2012 12:22:43 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: poolroots division by zero |
On Sat, Aug 11, 2012 at 02:07:11AM +0200, Sören Lennart Berg wrote: > I'm getting a 'division by zero' from polroots for the following input: > > ? polroots(64.0*z^6-640.0*z^5+2640.0*z^4-5760.0*z^3+7040.0*z^2-4608.0*z+1280.0) > *** at top-level: polroots(64.0*z^6-64 > *** ^-------------------- > *** polroots: division by zero > *** Break loop: type 'break' to go back to GP > > using integer coefficients everythings just fine: > ? polroots(64*z^6-640*z^5+2640*z^4-5760*z^3+7040*z^2-4608*z+1280) > %1 = [2.0000000000000000000000000000000000000 + 0.E-38*I, 2.0000000000000000000000000000000000000 + 0.E-38*I, 2.0000000000000000000000000000000000000 + 0.E-38*I, 2.0000000000000000000000000000000000000 + 0.E-38*I, 1.0000000000000000000000000000000000000 - 0.50000000000000000000000000000000000000*I, 1.0000000000000000000000000000000000000 + 0.50000000000000000000000000000000000000*I]~ > > For your interest: the library function roots0() with flag set to 1 works/doesn't crash. Hello Sören, I believe this is bug #1309 which is fixed in pari-2.5.2 and the development branch. 10- sqrt(0.E-97-1.12-97*I) -> div by 0 [#1309] [F76] see <http://pari.math.u-bordeaux1.fr/Bugs/1309> so I suggest you to upgrade to pari-2.5.2. (The bug first appeared in pari-2.4.2.alpha) Cheers, Bill.