PARI/GP Bug report logs - #1309
division by zero in roots0()

Package: pari; Maintainer for pari is Aurel Page <aurel.page@normalesup.org>; Source for pari is src:pari.

Reported by: Volker Braun <vbraun@stp.dias.ie>

Date: Sat, 28 Apr 2012 20:18:06 UTC

Severity: normal

Done: Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list@pari.math.u-bordeaux.fr, Karim.Belabas@math.u-bordeaux.fr:
Bug#1309; Package pari. (full text, mbox, link).


Acknowledgement sent to Volker Braun <vbraun@stp.dias.ie>:
New Bug report received and forwarded. Copy sent to Karim.Belabas@math.u-bordeaux.fr. (full text, mbox, link).


Message #5 received at submit@pari.math.u-bordeaux.fr (full text, mbox, reply):

From: Volker Braun <vbraun@stp.dias.ie>
To: submit@pari.math.u-bordeaux.fr
Subject: division by zero in roots0()
Date: Sat, 28 Apr 2012 16:05:32 -0400
Package: PARI
Version: 2.5.1 (development git-5c5e253)

Sometimes, roots0() dies with a 

  ***   division by zero
  ***   Error in the PARI system. End of program.

error message. This happens for floating point root finding with
multiple roots and flags=0. I've attached a libpari sample program that
demonstrates the problem. Compile with

gcc -I <pari_header_path> test.c -lpari

Tested on Fedora 16 x86_64 with the pari version included in Sage 5.0
beta 13.

--------------- test.c source code follows ---------------
#include <pari/pari.h> 

void init_test(long prec); 

void compute_roots(GEN poly)
{ 
  GEN l = roots0(poly, 0, 6);    /* division by zero here */
  return; 
} 


GEN init_poly()
{
  GEN gen_0 = gp_read_str("2.121429575870572868398326873886106213222660315137652347832926946793548191542248265463634433338025237518826292992919442239635259327659589013816797093555956927098361695846256627618521054270873407821238096441456244603108538349606962322855859082198854916946139861575297666867525090450112928827935900276201308133592687528431380911810073047490211082194657894036408553470765643576251192961826362692400943850464414957334803279804995725945264667672466415589518809434961883493237381209086475387860115957346585507205125562350941869752363268192634670520999312370124552225705292567456299869270063673012539026439572684040215374509621550738659606090956985915522994161461976289878947494655122739161328416788572006478993481786215177430612752096196026785207678533407416020515960848174638431107369368905578439394610098603682636522+0.E-828*I");
  GEN gen_1 = gp_read_str("78.50950400170524229554399181951926083184502341685623959688385991079464832001397689469895426749933607068893420630447966488074528629362740440985937334216476953436049514221185145908084301187970825766411860064337998194059599558381845430751687456343845574129945117145071791493013615219492829275500301343084884309940904905126252614724798282270952156836329767972236880708307178774046720305939292503641085258668634478592995557590223695972299571591782419874776065166418447755180408393496863466781510928073376191049136916445495442738972952530023857558763668317501522704335989217452505392702333626400468392089283390809013764641034691180895031582945964264299343938611355152888989209421585839103232863340730543895917374350071598955010217481283497836209879797171893754976458521578637128149207264660439051115018371926608521005+0.E-828*I");
  GEN gen_2 = gp_read_str("1140.453016011043442438686877716359225732052983799716316632359719253597632621615488782448235319215085328102581880122271355984762875115912712281576427117333919230551024533215009593784551134043819881637014914273120736519355405330220591968781600752684843682615427003054779021312772529871333308544720077719231094275655476030042366844409339294546199051506281393373187071357292073856670228160274206125313929570811941950636518286803877388407063593798735217754524338783054615498105515238435959423213961977524494647153815471298601727608611769656902700005595957563532791052913026304293426889443794640809934931621714982310036295751218490192776887354452565432744586017926897162132622798555037425813103576331049237678376321247738569788897767553062408857659257176977756008124767614356592509617544622554302976009214464715369897+0.E-828*I");
  GEN gen_3 = gp_read_str("7392.293651681336387838811484830560239797008850610727106717224780143513756107421420096768262037805610997693815862482167356010707473257554062884079410336211091318211514664505873596302305560003470011749167945071131965628011666628900248945562687006843164501051029451431691429085874184166413136955015577089907364196902885015138500539266513855763550910438639634792307332812322144062235515687646701702874740116890902236236931269365351874165914262473698976405272846636915327217964806521692790733439705200027042264129776079464141240178727901223259280222297887668731216407711050257390840429038833970650595051599208663957167133126899117217857498538798894998578097006995266567948284604553188511509765246798108360408004553593863296910710560513200872351644847326409456522566843470461899982221391055834389084527463471249001975+0.E-828*I");
  GEN gen_4 = gp_read_str("5266.175764541496667386797894143368636549165971972233349466988390747519689794802923398427432113893077829775883505538596444571153926504873179714552325529266639127653385775691640517222446571300780786583916414290904032905954045745008531247078558995351557021865259748489565538163321474673076529444170653491988463574867300746947965087524424771190185140457997186592359175460054848085804745226071580435075230181150757129339217682573929512319813841247159971712811127762437788660311940351569555048473511054303838890736437491162962408829489922136286903308967742689083981369428241146616949042624750638099734766555624219239260846759062388821090764658456318654977730304994242223829690597482160490558552403634928477006255063811705441948306713815977416444454735228888485259370840458010731885711160672308105122865113464002659708");
  GEN gen_5 = gp_read_str("-255085.2746810946945321411134130498038640981579366841879500685479005155713134236195149282914601979928184550798220769225795696554746166273053008493975078662781094055274423564267215248773746463882853887824501487701064395966119019983213422996187463036494164069355913258085262445248406247369583174059672570826935151315742567115234965159740550507251577442347741078252773993746367144091704837660068659590778663954303585486230162309596018046694593823915643296822069017331930293620391229073063656197487418217184473372752126923086576352869161298002559445628266374675202532178912051228257860949881963361059258103551430966844869583746651062765219268664696584124285827246142861575427925577177929553618761886650420618925589925318428663381819134139275508546245655524749551257428890054688170945265935446978454514503574121654942");
  GEN gen_6 = gp_read_str("-1.906811806542667659687115550375822049873369097488341694599102695511415188527388813622871833394580135190238143291545525632056449193591129622576109068673160886440758330686001526658932652771921603371687184378299934145244364305521869786972019721441399954160641301905448278314438464004352625489324891322419752874664279832742411158937039781189537628219791619389243457978269678707348767844974855795542250728464673678751519113500613373705070423577635625172485067648226781465451382056276820001857829323212059623384522575870897889221320293069560013375689991983493440136393319219489422770964668979270747014954031348469819056927725347617563867984580154239824942737908838256017049943968906610586444180267455268188353047470068645946990504605248988479349415906510336808168842814174422486594330167540562381109038522855381933629e6");
  GEN gen_7 = gp_read_str("-6.154014366240743453402889151561100004372699963176210415620069373100480284150064805589598158178008536152353759041794261609100820396165893750614224108222529359127290797336279286141231842153408242277989629407072780800075413542243850326445721169266593525499981029194503958315224502735914449205679478945073398864413448991238057874125915051400948810370832335597614435570035735989863289725290756295130097649225047530935161318550607520637621642148298219164801304744196552849834829667836559238466505577566671370991218278656694022811785147242021195818178616617229125060061715220857415990286176028537319073714313793130289783747795359342463444365288525785110923459602536768879040458482188129394665965694421158759726853872000490544504519702929316814671350465992809761469117973086854456520851377149072467320975977680812353364e6");
  GEN gen_8 = gp_read_str("-2.227174546629482100535776466485772861944540079484766657653032678460808019645862067883811160279065093223844596992135456900629460711749999859236058516851654942788105976715184819357060848547985320881831514376352748312544675546386608420042267797763365552047676453120365856531543201343573900665320778779454018660949716086157491919973174717247573444195774314018272436993728582110780480870957824867121631484245285839088252788477483584716028256324245646249782765149853823912423594888540310564592005707339919061143006597662162710459526870527670373696295360951516939563546793668553776102914032988721549107528968820863806719329521222716928937281494925093035099517366933998474350882285311429094160500888745315145624839097760480950507069226871431948146537421630236107212863094017324419879851999485656861240030110104360588390e6");
  GEN gen_9 = gp_read_str("7.345296695583238322153379669804642378063235186387676704714983816637346079271667583033125282607315804603163559554998068761249128012762513851121888151658999011588437581060039398973452108516183475554987527008759362533125704389252026634519783313778196895634993018210117839251415810016321824237505851197378344759908383569847258246832929694626289732703965578413401013661225621847810504639334547950760564044642336682067289590702924500424180202676518040751033485946497772310924281172070383047670291410923705219768295095151121468621236132285584058837611510837176808796850175533580583318536228743757826529021591681394587465673942923971137916381725584831626508841866693617633552155388600669068672660533602956040016054962492054715685689403410028144929281852717731285520430199939249918573971674610229838847928961340686481062e7");
  GEN gen_10 = gp_read_str("4.042232217845578236605127217586633187937208514563636529069568920977709855997179232782048135399242362886355777292177069998554003682434485265146847485607661273971241820823130997424849729519926799352211578817804116026103249583714162233657007261703379544173594008463430353383074423908312137678125750425194593535169073772819116140758161662405395608407624351558167482717577927730363882254909026663657224209272085838091690784257612685276107391581820950353473407841254750993645726671774623260334685280479227944608281163871633306695040204516404378028169483094944463890544056591684581771789004872742134762396472413937428004755721605855721381720769954455717925501044787877690941501220251785030533517483775425466170717361734653753706522557158332880258706820189673363661518752462997976781210923016926629650099726838219132548e8");
  GEN gen_11 = gp_read_str("1.316553037190390540683335122929029458096798525977961376111817244605817724166678006898912400919336645758058772335699407545171898097407939632712427767853895276023135083423585386105070689209872614824486321440095828806071823564332983054670488145956503814385765648723555518113444773718966200257727640645444024768354015480923373398003166360391663536109228728843957490890947370071580488691431037166301178677416562171365815589938105511195479663656740728968349618931286059900172058110103786311886088265787546667901969622317852371709435041530722630464796732377231856887726903649257277193993995006352400059890718472314567792508387997553353465416409050771490792887654135923176740158286426999990848475169072826639903733971856400270479758218817752502962976564507744605135934103229299485593104463485905131565059453643464256926e9");
  GEN gen_12 = gp_read_str("3.142337722987737690896946214269803499293003998869641009184291989638532271684570790144030232448019630338886242617079903436877906331464945788566815249689113997929523552257866216561056981684570679155962535846152244001391748000886240908366330936143704678827417282857148606740865714681750333826832059844364063027523370224318808318853407575491923987901051818824160417770875886183961315784144235339386020978957538420489860525239235240132329013259377701238655280706957593950532216523637369090746358804890495531146548061719945783652090624341838363634517584681994483025833527238269787151279809469299175329297702649740790460753770336400712217708117035260914608717781699226016910621447305728137355301891950761347615939639218497815265360671201381919017520866000809042236209280779431112099640540646904756649188647672216949115e9");
  GEN gen_13 = gp_read_str("5.903962523705029927939631340144024227598299998454541585197160388106490469954944857671509319920697336674796218225345070245240926613991616155668852393674877960387999931288587316006715982407972077027612393582831460202920410838185836083186407829696197890630504070313980588806035318357718170605590061072964581406700524981190710193024585838096402789491333730948638482780532435766709753058877313119380520260044449063340651148536238418001144227428118774367517409306963863636043546153819584675892709566544112809776426527970642903068596530306967035589469210352985237450357928698314387549492975648113973354856364195961525214732855727207322434068082028758229110951362562319340320761290914040188949907599351353557178599496723266617721496372724912346591182978323660360215101296309101163865816567703505847857782861456472694338e9");
  GEN gen_14 = gp_read_str("9.045281650848604547406659702698968801341136185384083488024473621472089838820753094234739693490242593096395940468290792016809962278528329496942901283294862683867314875157275456975525545302185898044480613639374189994734952762148168374143750602542586496018004216068929387734108776829593146598308033137810305957162318329003228891023906214020542898370424301443364035435523501458198372545280062176804664631479916323819250063912366422894457075036914862832764231466231462342253304378839602060870460271213217810421340709900006223528554432188533154308494783836014500647236405363201784373558915163403950346895006114768075040942105842131939751063124326602639845427988758852962780490600318609234820926625543165748674365150767108811211643004284110910524426351505473684177952634895244281598309105208102744130063767845745527332e9");
  GEN gen_15 = gp_read_str("1.153637652377644112123634792579489629076899095343205461436876682395940815014581135993344140066533406636013229696903058828676774772378106670219195546755900340278355378826630870567256861491075876748543856080967718795731416068069170545539250532668193506046541979916579757116710735189036464641946584496503272802407123570080791597763323449311797014348783415408578527180054062546879215331767372949509148181817866291271463887726485113668724543320301299553470455207649463788177738027982974830244046735900060140947087166992757543119065162714983347711917364246212564970836116442305667225485322906014863203997071507151381507439610101202473861755174262752597193434990710608162834277251328329723503071729252831206320887356042765361993566629313771906681733325421069002236629665098940146190167895090340288448672341801914188316e10");
  GEN gen_16 = gp_read_str("1.241141334460858457563251085218454167294625368032620246738305315800698907878049805994323215043811664875930968623314455188372806621014281575514224640565311101106688449065809905072462531623170929073145409530200364639330276837113143396886767463723357202874363082318957921514134965469711319294146606693584360056611278101169061300926309217653617154597803094921404045677242353172457317404342757736843780449263853487369431110714080168336275956606271619170046481709777237436390933796336170774124527378884023163450368173156711435531133788693464650847314096812988819942747236444016008664789349549374064946378675192433806695145859841267380335016205411147064420375354316121451126520272135423005424701022654815992105207946338487110658079530627213498828427620395053641488259329882581323920708932812281832306169052945297525763e10");
  GEN gen_17 = gp_read_str("1.136194374707123126929902389664086942078326825000430457181542121798907451851650944586763595141300006065193238013637515366637662461205870254524550071181770053168878144866187080327937000860160379787461446899060978312602981787252572277202163950747525925140167019786208303712330247608485164317380410081138487840274815963466515072233698855853728095972832666224786133197058077253502146401642030618922493424546510868210776685099607915575608775392644914842028073634192459069338505812754238548628626797734758752055435555148210422897554328119993804867700450806468869898076662731622769152287210214310062631918207463514322412558674260501052824744720415519985535692468158873079760451090682527469592699275531428365260471194953235371408071218344897252680743907785975277376772319970592423967700710346765481135646433694015938055e10");
  GEN gen_18 = gp_read_str("8.900126906592739855815254035119883635618619469271098944379122730897284393198501719710301271912797188771139852816941138511713132484507225831075506546432766801969614192883782324058614373326776872850790243280592209366946570174694208552880814404590859698928809582287143146706564534671745254767011439103277103774747291511187262801216902149018129628421538271278995539776311105513463859807307575296371484686750775038245509370290883346023536777687668833261373658479700288436941011167480935733579534560181963046076553779782548824381712093011736595041307977264758468240657824253940473323441809685605977092861281421235714556405232863365564819860833209411150560301689747935581636883418402230816641940020454614227542660466673882770381857786156188146463785652311899828686354046038196114322059406792160600607864623901682930090e9");
  GEN gen_19 = gp_read_str("5.984983539905756320670112398528620778828169694274651355006463982781477857228288533699405929443841595400638277294341057789935944712778423201263513218935530855776423343716464843918960021391283107026166299475397525150092835710269233338717142797968526020419563576605297125815754971723511644468673707179322443184333027389602057894306155867653219596987335516952568140697705513860531237513004646750047305889081547562972649135013343122872317231810863473378604605719742634550022797833120583049454391974621305968526262748066684293154563749597789947272788976894035520089459471616849361182090378322250515494365009454805258718315674239220604317459098713311757606936990909536754586001784859027467519733238009550250841525847813535418295992866377883291775103581070504239779449919278960397619199373602679060993219705429551716331e9");
  GEN gen_20 = gp_read_str("3.459463653764786530044677573335575687921725146178815321247995077461680397826122016011961337179263879894321348692964716581736507198537612455514965556640922315936719140353865884147691128357663605653955813127584469691549576695160185611735372023581249620012843458988059021564242012176872157903812511488799062352462229588433690409196505589394321426401496368717882605531726312494327448243040035353726107767182969524184273765888422225258158942823694422535657804769890074607869613469992022520224953448127471195600751442288048120467880583994997153763217313908418864153515857050675021574559904681206015412806063580624033552624056182496403750388673175892074724365567938837580113474556386342115420773939658158876769742520981976796024540548578244189687044553875317530429635052750221414433913515019417170525153174136488752913e9");
  GEN gen_21 = gp_read_str("1.717934241655492032918420468968705173723989854553563454817316317776963886070161521629514516046986939941059805161165313888163070341264883500886393008690670324935759795545973799495864227004745371899411642434153622733429478536029554934317421274067509783524268043149551915133311289295787315581364498276262154231811307891186877298672339802645048116715989383552042407474518789802393966376539743728523077372165881455352631060609042335828140222018354886999498643734574584994739397574274066883036068421653825165664256875498397638421811458230346153633162390461234272248004956497786722319551190037835529382165393965020339163101397905663696598467500276636065127533637363262942994905516076351440358569115508547118578272017846458844016203417155495036548524110519431496416019877009412710644128035084191797554989661253592020089e9");
  GEN gen_22 = gp_read_str("7.312217761253156953540622321808388510240610816347887558052471235978999372335703439732059236656774245242534359375789288164653061705518818249620851453993043976107159604677563648299674491000969297735686159932883740614627853669475297415232383689447406891259758215446406967170661525371365044082578958766594155661264263600909449625082042734625696611177696820845575612284467065059293739787650274426414475255651642141554902531455482629254664465776853015981077670722124043798372322720749462084708459951252271166002415702370012607188365692710733495847094243735961643331468274834376179344528842076545415457715436330891337947596063596844002355151451276395481980284895610667215740944737496913020030378363392250853737423223559725440851190040932367765502280964495251180285971179401792834352617303877977468070973518520888078221e8");
  GEN gen_23 = gp_read_str("2.656370439176996939490160800957645383058962840734417738351047961803804641128543050428168003818218405207900185998262144167459182796995959837875456861857118695394778461865262612210938524941487757327833640194503655626096394474991736532454380714832437433144547831598386884332238483990185069361455591814003240219360937066601716772233654285135321453369416271688996325019293571899983456609367557395338475804333056471103221441350897858475483283431077132590016533037499971831028458395861576095249681850592746937784271160254224148172087047882602254246480890809092911133096940385370070435487675861333936534377157472874819803000424049553277271089514997460756798223657960180918086200985221341735046571122333433224810708265045024715559411175779821001029594845152977380543845946887462865050432891352521047542620016178508225424e8");
  GEN gen_24 = gp_read_str("8.182823049465309816969957154306013162002315390438242550903558178609385734514288121129599071981662912921753584826181272892256188895873992102269650896727768913851745523971480361459980522599989199328827698328502522636684765217471998242667917143149611138990784068077322843823201124907442163085541093863600605697226624526748169818032158478192897743253414413508114599017117931796884708639587111151990512413679097457878968955600919547720739482080874899413368842767151550470040565487530720664134237919080033712657393201126365606472357376573268714685988069328277150742541175559078481361238571521013919317851305816511585592173194847260664267440662936769800299551788379499392109330304986203671316707362728319599618944288100632711320184165854925783947451697849760413395712628985010799737799955180813792342544418718810173738e7");
  GEN gen_25 = gp_read_str("2.117699983622424655164025804660529102643550075608351096616252258993717688832863976934442812174635196145211440216676466209462436043915509986534322335873745719595438077463144709986837802785160918205620944970340670417046549517879634189951572445756764188778806277054484691182256680436819275471647821252296441338007879098182191463879830099587628785775618068763674785677131692220744042057255206340105742252191074380434052348959146989551550295805515449190545794508610848143225661658043152475986913735262234440716614262717936791762855576102867232671805148611882204111287920480831707920739296071204378667235215767327768682514972568369681761214175190653330034135859961881388137065956186047374778929100114718460200733493937829689058323005938115659443472950829265736761285757384716148846568258082587180086571244384942503978e7");
  GEN gen_26 = gp_read_str("4.545193481642178705391011670703534144529762334605926616832143513717117254419968382310133247735708962306580196728629200188046806368571480238319766695482007198416623637407588282803326567148464161156952963867354285937329636450779467399100082861070915324478106921280854222826490728823426150107014479799817296016833428389555860692166702507089424890078302148861632013863561473901430504354647727279889733624200931941465370668244973638907717964720370058329836766308019602014824558303140218130265259744347880895342068868880074583264983401849577598047521575793378809345367819039983070859901885132090098739988920806867820314445350863370112730071008198951016054803266776780934599940561854392813171149878324780203116986466620950029931206275354679882702860483090931508330839993116228075806656162160182613889583565779237168344e6");
  GEN gen_27 = gp_read_str("794522.8700927836840754681782699727790237870843604733884088298736050287392176051070028655411721976417483625216448659867242078070130440986300723400807695951819296985254130251582386292723433791310012459808925819931761838357586645416274997441958904467523346573312204231953563315824774880212942216817436211759275865014584607064528017150273581295837762563363575272483640868251584919722668018077777532519532911423515957504819856822228348750432709094650164445734919962335298860842687429060301206539047299133674592923579076919428324965635568999233555626458749416938430515282623779279323676333997386784984054503004071334458695843982487379242658793799972710895225776590998898238792689975025788307611710476565045699149656988530561893764823438554246314788915706351795723192182596986666283889481110038026255729803586887271743");
  GEN gen_28 = gp_read_str("110224.7069233411809873688351692834718107257117066935086755424094500655445203470428196466229940199072642021443870203548052534737723844873596369603003287087044929136009587721898882192911886206510392294070124215512881003563345731892764378213878284921261144870944993699201903349824139235151070248188018044459738288833481308708817547651417528825248940000513224885387425435471198636118356166076220257095640840888064804970243324691916655364728973980231719557419058804755758653996989712132092357981667165653731938463964479202167489243553441792702240203201469705065259166008394794868583610701771031673412859198631280739710181846992201150207287910445025219708680220963415509366941902292262696233699327096574520977389313823524531759453164599123046907078081023513872570015596236946987947237372089463257476916760353139083435");
  GEN gen_29 = gp_read_str("11674.41072672632554606644552288980419600896355414855004441740777191924207001671859746109131852760118960429928613701517560211758523540464702369113217686698914015335123101656374219143556439672649397239952519507536099641240697415728458620202579565846175261585607422353128687523566822268150109354445420440767542497624755306183028935498528292377818420391062117969232533665877484271587230431133811681822306547428383848079630176198541111320530025091948349399078859062935909409545971226707507393878990388049610264238716464440101486629734884618740086479967417434523100981104536462175011092154071077649233454034693527520337813103869873086556052975575717345679542763115822312833852556464127495370875586505541159262650057724973980699698138182416441695067233360154866301065808351950998549738111010394641017065713816905904418");
  GEN gen_30 = gp_read_str("886.6611838418743543348209797472317264551258487307354380249545137085028491518226153912876432247443464388359950625395403566213072518412795071003224499814523088879588941650876652729051969710821129293457366140007509558669549556219945165086500313849060658345987766577526722058538125680321777608978194683036552562596952153731132354852704757718523130558382482849291446975612354491027152690856263662116068511619387282983270827660375421555453766457792683378318927646680959708828887873620588818997522446740620074329571230768009564968666292433631968744126383109415936744685932366841811005322953687526708516022021976208805640028205916775918893796806145752585548404861178891119857204639289458196962133450652741869980100937188986791513865418586182593629120966556355667725580997363162807611644950975745992276877840683427257589");
  GEN gen_31 = gp_read_str("42.99659961880109218848133363954311522387342442292600752526806623580081685446067964660812435420713888299574232882917008642152392587805502988932124142735294316429343767674611355817886481009587223675562047179953527585525762039003725389386520654281429028200780880738473215089171500436263340386241127151240373843803558012586825865395400162314835913066726131980158124728107219746624691379983930813670623619186442590484249550167679027947281253497067976641658435852677298899373449550646790124099841822405858306920363339528754493871888483045259597916801665876708497121895462552707174396224290916006808688876884030903336078552985080435974326660922657678022462349104498095749768080869539287734337171243922292122840731653977238148788261850509655571616771758561570354031036955687466710357568690424450979134479359024528744186+0.E-828*I");
  GEN gen_32 = gp_read_str("1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000+0.E-828*I");
  GEN poly = mkpoln(33, gen_32, gen_31, gen_30, gen_29, gen_28, gen_27, gen_26, gen_25, gen_24, gen_23, gen_22, gen_21, gen_20, gen_19, gen_18, gen_17, gen_16, gen_15, gen_14, gen_13, gen_12, gen_11, gen_10, gen_9, gen_8, gen_7, gen_6, gen_5, gen_4, gen_3, gen_2, gen_1, gen_0);
  return poly;
}


int main(void)
{
  pari_init(10*1024*1024,0);
  GEN poly = init_poly();
  output(poly);
  compute_roots(poly);
  return 0;
}






Information forwarded to bug-submit-list@pari.math.u-bordeaux.fr, Karim.Belabas@math.u-bordeaux.fr:
Bug#1309; Package pari. (full text, mbox, link).


Acknowledgement sent to Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>:
Extra info received and forwarded to list. Copy sent to Karim.Belabas@math.u-bordeaux.fr. (full text, mbox, link).


Message #10 received at 1309@pari.math.u-bordeaux.fr (full text, mbox, reply):

From: Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>
To: Volker Braun <vbraun@stp.dias.ie>, 1309@pari.math.u-bordeaux.fr
Subject: Re: Bug#1309: division by zero in roots0()
Date: Sun, 29 Apr 2012 11:53:10 +0200
On Sat, Apr 28, 2012 at 04:05:32PM -0400, Volker Braun wrote:
> Package: PARI
> Version: 2.5.1 (development git-5c5e253)
> 
> Sometimes, roots0() dies with a 
> 
>   ***   division by zero
>   ***   Error in the PARI system. End of program.
> 
> error message. This happens for floating point root finding with
> multiple roots and flags=0. I've attached a libpari sample program that
> demonstrates the problem. Compile with

Actually this looks like a bug in sqrt(t_COMPLEX):

? sqrt(0.E-97-1.1228632739542779264E-97*I)
  ***   at top-level: sqrt(0.E-97-1.122863
  ***                 ^--------------------
  *** sqrt: division by zero

Thanks for your bug report!

Cheers,
Bill



Reply sent to Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Volker Braun <vbraun@stp.dias.ie>:
Bug acknowledged by developer. (full text, mbox, link).


Message #15 received at 1309-close@pari.math.u-bordeaux.fr (full text, mbox, reply):

From: Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>
To: 1309-close@pari.math.u-bordeaux.fr
Cc: Volker Braun <vbraun@stp.dias.ie>, Bill Allombert <allomber@math.u-bordeaux.fr>
Subject: Re: Bug#1309: division by zero in roots0()
Date: Wed, 2 May 2012 12:51:49 +0200
* Bill Allombert [2012-04-29 12:14]:
> On Sat, Apr 28, 2012 at 04:05:32PM -0400, Volker Braun wrote:
> > Package: PARI
> > Version: 2.5.1 (development git-5c5e253)
> > 
> > Sometimes, roots0() dies with a 
> > 
> >   ***   division by zero
> >   ***   Error in the PARI system. End of program.
> > 
> > error message. This happens for floating point root finding with
> > multiple roots and flags=0. I've attached a libpari sample program that
> > demonstrates the problem. Compile with
> 
> Actually this looks like a bug in sqrt(t_COMPLEX):
> 
> ? sqrt(0.E-97-1.1228632739542779264E-97*I)
>   ***   at top-level: sqrt(0.E-97-1.122863
>   ***                 ^--------------------
>   *** sqrt: division by zero

Our floating point model allows x + 0. = 0. even if x > 0, e.g.

  (12:49) gp > 1.e-39 + 0.
  %1 = 0.E-38

this was not taken into account here.

Fixed in branches master (testing, commit d1eb887b21) and pari-2.5 (stable,
commit 1550af281).

Thanks for your feedback !

    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/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`



Send a report that this bug log contains spam.


Bill Allombert <allomber@math.u-bordeaux.fr>. Last modified: Sat Apr 20 00:06:48 2024; Machine Name: pari

PARI/GP Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.