Karim Belabas on Wed, 18 Dec 2013 11:54:28 +0100


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

Re: Polresultant bug ?


* Ewan Delanoy [2013-12-18 11:32]:
>  it seems I found an example where according to GP, the resultant of
>  two expressions that evaluate to zero gives an expression that
>  evaluate to a nonzero (and in fact, huge) value.
[...]
> 
> annulator_for_a=256*a^12 - 363776*a^10 + 193847136*a^8 - 46812817968*a^6 + 4719167653697*a^4 - 114005664356542*a^2 + 1412780238606961
> floating_a=polroots(annulator_for_a)[1]
> annulator_for_b=b^6 - 108*b^4 + 2684*b^2 - 59536
> floating_b=real(polroots(annulator_for_b)[2])
> floating_c=floating_a-floating_b
> term1=subst(annulator_for_a,a,b+c)
> should_be_zero1=subst(subst(term1,b,floating_b),c,floating_c)
> annulator_for_c=polresultant(term1,annulator_for_b,b)
> should_be_zero2=subst(annulator_for_c,c,floating_c)
[...]
> ? should_be_zero2=subst(annulator_for_c,c,floating_c)
> %9 = 2.2768496195346216922 E60 - 5.226873626511962736 E59*I

annulator_for_c is huge (L2-norm > 10^92, degree 72), evaluating it at z which
is *close* to a root, with relative error 10^-38, produces a result with
relative error larger than 10^(92-38) = 10^54 => you're observing random noise.

Increase accuracy (for the initial root compuations) and the problem
disappears:

\p500
[... your code ...]
? should_be_zero2=subst(annulator_for_c,c,floating_c)
%9 = -6.067433938162414826 E-374 + 0.E-378*I

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`