Ewan Delanoy on Wed, 18 Dec 2013 11:31:55 +0100


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

Polresultant bug ?




  Hello all,

  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.
  Below I paste both the source code and the output I got.
  Thanks in advance for any help,

  Ewan


/* ************************************************************************************* */
/*The source code */
/* ************************************************************************************* */

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)

/* ************************************************************************************* */
/*The output  */
/* ************************************************************************************* */

MacBook-Pro-de-Ewan:~ ewandelanoy$ gp
                  GP/PARI CALCULATOR Version 2.5.3 (released)
          i386 running darwin (x86-64/GMP-5.0.4 kernel) 64-bit version
compiled: Jan 24 2013, gcc-4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
                 (readline v6.2 enabled, extended help enabled)

                     Copyright (C) 2000-2011 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and comes
WITHOUT ANY WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

parisize = 8000000, primelimit = 500509
? annulator_for_a=256*a^12 - 363776*a^10 + 193847136*a^8 - 46812817968*a^6 + 4719167653697*a^4 - 114005664356542*a^2 + 1412780238606961
%1 = 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]
%2 = 16.507639886376369964102375152715808868 - 1.1732991791154715940767062706818971012*I
? annulator_for_b=b^6 - 108*b^4 + 2684*b^2 - 59536
%3 = b^6 - 108*b^4 + 2684*b^2 - 59536
? floating_b=real(polroots(annulator_for_b)[2])
%4 = 9.1973372100322392595456421736424968201
? floating_c=floating_a-floating_b
%5 = 7.3103026763441307045567329790733120478 - 1.1732991791154715940767062706818971012*I
? term1=subst(annulator_for_a,a,b+c)
%6 = 256*b^12 + 3072*c*b^11 + (16896*c^2 - 363776)*b^10 + (56320*c^3 - 3637760*c)*b^9 + (126720*c^4 - 16369920*c^2 + 193847136)*b^8 + (202752*c^5 - 43653120*c^3 + 1550777088*c)*b^7 + (236544*c^6 - 76392960*c^4 + 5427719808*c^2 - 46812817968)*b^6 + (202752*c^7 - 91671552*c^5 + 10855439616*c^3 - 280876907808*c)*b^5 + (126720*c^8 - 76392960*c^6 + 13569299520*c^4 - 702192269520*c^2 + 4719167653697)*b^4 + (56320*c^9 - 43653120*c^7 + 10855439616*c^5 - 936256359360*c^3 + 18876670614788*c)*b^3 + (16896*c^10 - 16369920*c^8 + 5427719808*c^6 - 702192269520*c^4 + 28315005922182*c^2 - 114005664356542)*b^2 + (3072*c^11 - 3637760*c^9 + 1550777088*c^7 - 280876907808*c^5 + 18876670614788*c^3 - 228011328713084*c)*b + (256*c^12 - 363776*c^10 + 193847136*c^8 - 46812817968*c^6 + 4719167653697*c^4 - 114005664356542*c^2 + 1412780238606961)
? should_be_zero1=subst(subst(term1,b,floating_b),c,floating_c)
%7 = 9.556391613824554411 E-22 - 3.105697067803841053 E-22*I
? annulator_for_c=polresultant(term1,annulator_for_b,b)
%8 = 281474976710656*c^72 - 2764647221252063232*c^70 + 12881090734407523762176*c^68 - 37900879189576872787705856*c^66 + 79099815954946491364482744320*c^64 - 124684759166630772970798278770688*c^62 + 154348991980763936851992593913872384*c^60 - 154045742043145589406276188287109431296*c^58 + 126278018863764650417996510658035946881024*c^56 - 86188295361347830927179212093084919761207296*c^54 + 49478930044049671150743174794661019965550755840*c^52 - 24074514186962292770585768259851360789778778816512*c^50 + 9984746464975367599334473741516071684995601427070976*c^48 - 3544601773895860008395886389523866780061142280317173760*c^46 + 1080184220852605057051843703838564046424092897453830832128*c^44 - 283063744081987480169735131103108552441984386863102852857856*c^42 + 63829717334668411467356121108379367011430103612372083744374784*c^40 - 12380931236742739255452291376833192852560602832000266561304526848*c^38 + 2062669465587519366960798626747033680113649744703395573266979635200*c^36 - 294342896040799822278685004581163889813837967268955216247392575873024*c^34 + 35822170668621222716189038834945741067330091385125921979038859956748800*c^32 - 3694599094972804492903490053128068674286670925141467454235954938531409408*c^30 + 319960240851023753657282679654500912353276531225489928628714114061458570560*c^28 - 22952312434864689467469374950794342367860497174354076088648823447738558224032*c^26 + 1335401226228804531541920693957281744805732107174509410209334522260764903215361*c^24 - 60809148557582404992881001669429869411357952385257095389093624573272338899376068*c^22 + 2017566414332545683415521294013316992700349372093541264046205901517553481808626562*c^20 - 39613544304889263163741162651933814231796557664739403511362146976834103910676919316*c^18 - 83073495714643564417538814552291747128655024979311195075325762617285571653876743441*c^16 + 33231267511964361910676895256530877688318203700802091854361052491266569180688206374776*c^14 - 990437872605966242896879211543870708900639163340555827418555490651344092124153842082212*c^12 + 9329123355315985874202674921963292146201078965294999311682648481220956976064727122600216*c^10 + 175291809114698568461616198975915940771681390157547657579559269812558585841725448099842799*c^8 - 5516460202934221606042560973891542814215012715277528647876259773181145457943877549960013748*c^6 + 41828868387403071247439595897666331473749908633963792469607411575327145770962254753636273922*c^4 + 83987635629795560703882737145865437422701153201689548742447524390115947794448018764725358492*c^2 + 50377342894868085617014097787813588839456717377524660244379704865045716237078210026453561601
? should_be_zero2=subst(annulator_for_c,c,floating_c)
%9 = 2.2768496195346216922 E60 - 5.226873626511962736 E59*I