In[]:=
Needs["SubKernels`LocalKernels`"]​​Block[{$mathkernel=$mathkernel<>" -threadpriority=2"},LaunchKernels[]]
Out[]=
{KernelObject[1,local],KernelObject[2,local],KernelObject[3,local],KernelObject[4,local],KernelObject[5,local],KernelObject[6,local],KernelObject[7,local],KernelObject[8,local],KernelObject[9,local],KernelObject[10,local],KernelObject[11,local],KernelObject[12,local],KernelObject[13,local],KernelObject[14,local],KernelObject[16,local],KernelObject[18,local],$Failed}
In[]:=
ClearAll[RootPade6,expM,MRB1,MRB2,err,goodDigits];​​​​RootPade6[n_Integer,prec_Integer]:=Module[{x,pc,z,t,N0=n,A1,A2,A3,B1,B2},(*Padécoefficientsfordegree[3/2]*)A1=3(2N0+1)/(5N0);​​A2=3(N0+1)(2N0+1)/(20N0^2);​​A3=(N0+1)(2N0+1)/(60N0^3);​​B1=2(3N0-1)/(5N0);​​B2=(2N0-1)(3N0-1)/(20N0^2);​​(*initialseed*)x=N[N0^(1/N0),prec/8/6/4];​​pc=Precision[x];​​While[pc<prec,pc=Min[6pc,prec];(*6xprecisioneachstep*)x=SetPrecision[x,pc];​​t=x^N0;​​z=(N0-t)/t;(*residualforx^n=n*)(*6th-orderiteration:r_{i+1}=r_iR_N(z)*)x=x*(1+A1z+A2z^2+A3z^3)/(1+B1z+B2z^2);];​​N[x,prec]];​​​​pr=20000;​​steps=1;​​​​expM[pre_Integer,alpha_?NumericQ]:=Module[{d,bb,cc,s,n,pr2,block,start,stop,rng,xvals,ctab,m,dot},pr2=Floor[1.005pre];​​n=Floor[alphapr2];​​block=Ceiling[n/steps];​​Print["Iterations required: ",n];​​d=N[ChebyshevT[n,3],pr2+50];​​bb=SetPrecision[-1,pr2+50];​​cc=-d;​​s=SetPrecision[0,pr2+50];​​start=1;​​While[start<=n,stop=Min[start+block-1,n];​​Print["Starting block ",start," to ",stop];​​rng=Range[start,stop];​​(*RootPade6replacementforExp[Log[rng]/rng]-1*)xvals=ParallelTable[N[RootPade6[k,pr2]-1,pr2],{k,start,stop}];​​ctab=Table[cc=bb-cc;​​m=start+j-2;​​bb*=2(m+n)(m-n)/((m+1)(2m+1));​​cc,{j,1,stop-start+1}];​​dot=ctab.xvals;​​If[Dimensions[dot]=!={},Print["ERROR: dot is not scalar."];​​Print["Head[dot] = ",Head[dot]];​​Print["Dimensions[dot] = ",Dimensions[dot]];​​Abort[];];​​s+=dot;​​Print[stop," iterations done."];​​start=stop+1;];​​N[-s/d,pre]];​​​​Print["Computing MRB1..."];​​Print["The first run took this many seconds:",AbsoluteTiming[MRB1=expM[pr,1.32]][[1]]];​​​​Print["Computing MRB2..."];​​Print["the second run took this many seconds:",AbsoluteTiming[MRB2=expM[pr,1.34]][[1]]];​​​​If[ValueQ[MRB1]&&ValueQ[MRB2],err=N[Abs[MRB2-MRB1],50];​​Print["Error estimate = ",ScientificForm[err,20]];​​goodDigits=If[NumericQ[err]&&err>0,Floor[-Log10[err]],"at least "<>ToString[pr]];​​Print["Estimated good digits = ",goodDigits],Print["MRB1 or MRB2 failed; no valid error estimate."]];​​​​Print[pr," digits are ",MRB2];
Computing MRB1...
Iterations required: 26530
Starting block 1 to 26530
26530 iterations done.
The first run took this many seconds:13.5812
Computing MRB2...
Iterations required: 26932
Starting block 1 to 26932
26932 iterations done.
the second run took this many seconds:13.7103
Error estimate = 0.×
-20000
10
Estimated good digits = at least 20000
20000 digits are 0.18785964246206712024851793405427323005590309490013878617200468408947723156466021370329665443310749690384234585625801906123137009475922663043892934889618412083733662608161360273812637937343528321255276396217148932170207628206217151671540841268044836354167199851976802527598938993914457983505561350964852107120784442309586812949768852694956420425558648367044104252795247106066609263397483410311578167864166891546003422225883800254553968929471142122189105098328712277308020036445215390536395055332203470627551159812828039510219264914673176293516190659816018664245824950697203381992958420935515162514399357600764593291281451709082424915883204169066409334435914806705564692806787007028115009380606938139385953360657987405562062348704329360737819564603104763950664893061360645528067515193508280837376719296866398103094949637496277383049846324563479311575300289212523291816195626973697074865765476071178017195787368300965902260668753656305516567361288150201438756136686552210674305370591039735756191489093690777983203551193362404637253494105428363699717024418551654837279358822008134480961058802030647819619596953756287834812334976385863010140727252923014723333362509185840248037040488819676767601198581116791693527968520441600270861372286889451015102919988536905728659287086875425492533794395347589703563313440382638887986656195980733514739902565778133172261076127975852722742777308985774922305970962572562718836755752978879253616876739403543214513627725492293131262764357321446216187786377154205423128223446295396532903322171479820280759842210655648900485368587070832688748773776350476891609831855362816671591084121934201643860002585084265564350069548328301205461932051559350400235083512613359217408970073297842771289673651619602250771173880842623256978854653786904622270856748747470930693573266685908561628237538655124329756474649146191795758693429962081498785366631701972645342604683780107590551486787190395783150604524441907570445113820585333984692194828794764865759317859581652749297782209597744091137143421692962459317532453734012995939950049179129836808485471439258467042385286083200536645105866781511964596760791964317343076715344983004971288694016566004270621110790531647215045563299438840052111523901687731154569610283692050368961088060316036603828965332393835241545101375341656734726074648911200880998381520466954150263770355732835929966306427173051589721163519991611359546703154087252872439981978725027467973886388970568674353778579810585561924921857169491356734627040774914487996820654828174658806422363481607809507770579393134958298066028252721284916888092303252902700599177550596158359199931908693930397366116465148582199729253371067687386862350479158797379682698478780822234106187896746674506800644040655538752132814949807002098581322206201090112659034497174108010632475647128346095492843700651474502182261204156439303088598264262568281260924911367339672359337145342169025601400501694699838759073429203617293015314004059362464067814007794756130773697324099235294647945807781646076962408645956660841411263999885757394293152262838987984363507193714865734919620254284435104114728419738149338070662225731910214815857450428867284772504343867184431491289486354489294921432596608471496000725340662153875613413252542741301581824766364321115068094774514063091609280297193276067969468609263620817634422729775463267371611103022200194984554072338596799729567453184904338263329318881603300540136903161043099737778639343931356214965499699373142058190653346615738352222808713909343313252383603052871723148111510297058562812995589918303810719663081327016704986176831683295290537987600306665702034358849603421048114886812160836119446055719139732929706832326450945715371702023251751982208521511884275346588918121726603331928048011747590461318984497207220682489191539332580026246272161764244687477896097649060704796053517402052279920211128765398353817401179552670033758313960788477267092157001428248335741882127065588260757223843468364254606243762949725572084429109010146920322976340088313403816403729113113149598830486629449645321931135749564539123854566628815660998603254478398628780147569772281911518615208276282401455651794253838186194793399401497599872404273885056441143756079520211579102553987653665393231584920065329570705591855222675428457368126706995658246747621115995677988710899431291034014425497659371352169077892867695205556979383621955999138096214465028267844577751983335618744957998843531990905504564240610916094297513674772622513506116867915294536437177399139221264837788062038727680883810322672849330859390787727347282725262001885607446549531438327158297381955786656871622816760083907552694743377480542717093388979753170189068955143939404845538298301981692536597974767785468650458596402381759301399961226676681173896705020332923490805136900674702817092565211984795692028584777685609789206862143074015933425777262910166752349405574100207286898501479277429106643136941528199585609819765232162553186237642605913206671239423983107480089006769757060713233301249195951646813480370178134651913158679298572877329166884183409104689850455863387020802246278862265851083444175134985044211165682182229987544995814627904111846130450604552093607482565452755172006070179548876855497412155324663057485119789823004269602941155616636110521840676184044084205770094483040514962265636910047690699522262104075018604051897916337230262423160504122540955373395122938520382475054222944756601093847861033931946586495561530055904964711128495288028053924864587580499609562509345343407175123631802494718047160260832853256049629656309261370518631640045447241831441782309591406841962005423176028252580335571371871977497060956384055720810057346255342254099623694355186490699544413627380028456124779940447711868140908231662296479219704103663768178282137621705550580121925358553695499643528482079343827576269272538307500362508665666647770931783939283648517292313833885523047392386980076244392321454060913989087618833115037462203543040453611996201100975157674453271122939154564380477390685465839397143691849272886463894932624302932955694297379816207899569893874908872847635958995253467600453216790182627301117505094784781487437814651251293161774803256008197523409391990608703942350668302785417518907424011631290578378020201562091526466340401827980148045291509976984972825363820102500962911148024640676301451565830553830773355410914297997159160285622761233987579707541064329187406065890822373966628948296693740859906362802605441821524277356458008784545262560415621860136438599073814315665679513498894949664937350396640721445882797369092517918305172718084062107825504329419787227269325909280724920673161692012668782775593550644549829865556797555361848999789377233987064778499846100137174512095866618017863961518698667954959959735708816930261328971725269826594343745870891904880361296161413276295049477874325917911767746063370115994626026536443190233139798695984918546221293260444599499166183736291061635705975504920946404849033875797809820427010166354510921194152351981428019047162537693953552578074637538772307366257575286156893403691167740764140892525840716296802534187524002139657046156113727069971731542422507141369775330539382226317371603550685305175111385884698945056548311555076053961285256482253369641361806531597334040437494466338897212784168519305062531258335711981939730618737425719646961187863364326756994978582216442533506909313550031128292162962710988346815309377306625961513399149868901791488593433017612142687839469171093064850486458597326643499200420098460393585741499523971541743360043809959839899333781670367577277556131726079817453533591028769609740645929425212285420447886348099070756700348811881260914041006512751422042082806001659852494404653791724456897913355432570503802422009617154242474604292693510610657994136280440032533611427840891180302025255102702582470779311103157123239625234146462959493651097984536253101230803238254046401309397103308731609574474264405063136920672207757059264117032912529232750743362922933897386092291769415465672762917187700223037355173202386933621871588301498231237649143483168570071174956881858687894838218158032905619220439142680416724308045713451266687210311841685737473748457230395105495415405276874349929279367096224047870329059597536422666277655144410592574838319236598451397022837270699784399523326339051142381260827049172093102219724623473692297340977976842579460118304313596537284860867259157191890408146861968204058357866396021972846502662576604162122055287158506294858772569451489788859159074747705209682015738349682491632609091178994446162573230775218081902342769116907420139735353661491958990164348552876348506513791509315806106096397563692271774631647617429914569168051978192084111743881512433365331862110082962859837396207697150083446380710763457523729681626923841966645139834411245298136331934037286288141007619907834451663736196757391179224053146097393287562188531042300659170692797577636377224975497431737524756936689291968398662264502782074226495044181452979714229306039239802644204160440691366038565097629993201524358581636390670844137539074259455315174754014252261620507014052343127979670130865153330590689256829819024205360429991283472487577464043340011966475449436495843592674607776112985937828779893876534998587816197367780546413262279838537759747669449159558385269709024799853856547521711839198564395479110964268461172015997278454396467899289910798038821481615216013174044820837295625377451609157669894861025388693330222979323500379590915734852558001274928562419160371220434737299241322374955413956510909912753892704247009065068195885135807416594659973882251841845134159816050708373641801647025390964838237376890906994600142351180093208185448109367706656234368078349463252950299360438231407358954912145785050887796941527017716788219850956322143386095682584483617200746770716544588855767785955399059946202571643618569702640606939293058169361625901389968073586342200527666976378551034510861792245642261282397027712088276587996764915389344196689183342591575812656497410050326421821004444836359870889897416129874591355957644934543469299314730092930804323431149015826050779772873774722711001938899788529770858339953523236990696119858300691163303972827938836201691493820071974674191127872874531866246036141094144989797683878109543594422933042894894042139918918364827593788007155639903472944522560946016204698658708200847916515342882009789101748805109214463246077854220138523323692971113054564024532612285399746352244973246975182406588241626537631077432439792118916880923826762215469093475692680513806109783164922553403356033057360376182908223562764068072018386594416940684060985652441478768649199165674472765936670072369624853660080454165095513041365361919169784145934800938249715624380740684598548517161597981962538609480054911472275805729414754779935818839653835095039190509836837540161352374227982128589263543914725919423492820650278196181966992883408960850885764772154128189249706873644905287178946917081347423081116839601763547138368499985533298859460415250318754619391782840459926046145843594013767274020010651696321893359457936066406081175293368846311685788432048075600450756299959777712220363437950339163455900301722282500611399585599852575164066053853019489846041036525395515113821985672124123833615657793915523412961600376421588831076497794080209490643726086245216006568862464061206867157250064830687832326613812368194321714716839828695151050190007396680939945513571864826696599626480964533216836259063064220796558215268494685978346206980000809316491942824021732166503677932072858143503305056781142964465192065669784362367372195332351939755567251048569173020699869093327446994060700216280286871873028877121737699863026482378906002428541081306088882892450815875367801025745818187699300684988894590863266118423273924333601032017301668095643939927449029290600997532782852090342538712008113968595964181804670946652992861801128193794498309152389719675220274491543482195589506081412780905072540394642814399346278776988328222016263827715198472490565473519591505553054362155886490410269032095594172124564462838829635924710017298237288347555117875015499933021760486717646303821204164864273784751386726648613324179148166949843587577464309127261888476826781977602767236997295181774397060524693425293406740014086843991599422966982119975336894265156920413900175534550155723982060344163927336426610643920153307031998973340190204302965461222959624461916104568629667623390889357959073366133817475446580977798183537777361237356274395588269776405148933462250387494854953412321805312844645758173583554493265794034034287693958076637775380224748807224591351645691063158938316222858809564689744883174888608186915318317712665217462209246767136087342163261840424925711560371468894223029590518529310672889881531474773440313732313132705416141916664238365702270333220472446678064232911510903762572282361531721183597695736502051098637641259567801543202109525732439838291556116048764636453231764387421953981854797035435164209253347094973059895569425315554394679104861830141825405221751777002242936929383773011067070140199873154406272286558414021996350316937409410262068850663455710138956529554576912747881225165468927050565048305980919956908574896470867681277110465882084916859570696659185708989009496208536373623828206712615192737359982418732536536489670927693533261260156284869411893552568336528080996233945895459372935765872413343030907744498868024153442110877202743564846472281366879927865255381295125167851491016848456450996397676367866651070575568671773084364153097538152886759999086558127080120097537097706150154522170822133076956153119398118967964237851537706134349974524213668215360230151928532893228708433151483722366022956107192309921693121241741677359036545860230665104497400910317213823778797343918915726633466862629608923345662998644846768825357876365170794882393309859072654348951623029916757207235897280653694880770800835741574838068627081442896039984984492620844553985526688407789507774261824433498844254844074236870579424733176688310745118187664501681800549795873238991583034997835408133840739226811840699853349800220364758757598521157277039869961393909684647203881562206323332579455601285719669685410046520886649938372263880908840231970800227412323238883166975393898640058259536485835668088242766895757222969859300337147298474047439875872291864562711725284926272308795101831164831544212817772890420828066273578853473241271651799794159180612757650457860205521444383399153601647391451813090182713072488492696355196404930044739774257817376268328724641745710964406175847174674950790152118966749711347506729629440355761341248191510826318879009559005504685329695767337923196502528389156601086029212954943495430681809358331810779182232324363653791001823813083335550934942594113889405563473328630545148186319801241912724509098449201158321542242979888816366956910580204211901384726472613034274252757156191250161339185284607165836494431163026914470878077674405318938360401049376200393022097499327354846630484483952589512639435035121393243157351771468150100098848378052211860083759217277083496100477009217812857432699218021511457325206689717942884163523187606323579092932021290402063134458838132598866957323075813793192470120608204110536191062841909908348562677659548179384536751899776743116726106227805552377477894164673977520429245206921756249505335877835768576804385242303234630350033569362556357759042341086963904788488578094437497616266113137884037960690553710989602952756968946716836752049253679488541513776965979693327424285179957488947554136543692680111494269764053410455754130998797694567189587253121226811837206666234324022845844052259408201843296157618742210602673977730204045245134711139791695149895645223225472071807119338855092330432277823661173811130488817742338555062434080334898789862673749112720514355514132619691836033881948724495393380665107434779241006012613127744479411146503799848134786300318768791530283196568632342577875123871309937630532322028825265464766020862455481089177546362902660896449021081151293777894038436263589775050271669548185820385881098026936896136335904977058273075830793055987396726517636061515816647939060024407688201010497799201464526372109012483278094848952049543471619137487630639233638589912933240245824088852570267495980395777018421507082984072390160253377666493009487200929822416438914379082651193044425410505528079919179480533680352622466452772877830782894596462540218049576307291291083339230945302737532807784989274918223304723751152963198436689417386692163265698840689309462876990337255843869989267061336647111474345043101390453147013880643355932730158672222429271393622737091423776810239783731668914047688625779651612853867638159961787147390819328108627913752465194734006717471119426784929337826499992943601433914736067996575814649036754441378364150654619119943568433284237664282833445398043013198553329579171945618882803335762030066523228200522121236699111537640342149508089518334428002065770022538054009861559081909611451147763454198594422567802944738113476051540512360371644707517602997405306779369938905394518480094391982260416864971302244638745886918997483517390180995207112302535453555005819921834068651504631055957604783143856370475011247594874101092706024890696585833746043834783484849301782139641948393851449256472774650822925797783213430482911196686354748367701137602951286044587335977592261830671923284792133484495350632046063361865170483026545354895224046134161169943670232704707312189922222563862300403388280943592337869230228557628367860136692270315925342646212444283787655885282021281716664921744478670658457941968957711183114799320870470551424189333680565339429179913113849546776851696319497247951564298702110778324804919687357815317011638822151014523817034744812540993798261396618464841613129951414598519857276366380518972348887331441389751310524270609523103524058842045171584765838746575786677823765401944701210096432946501487254415413895188085176844666583859034934054659159859975830792454257414424928484682465298165721383413526006993356630920634665756844230189709203247221538449370082356761951446880076797089197203775122753626825698803380791762914990674315479245893722343157507608251666010206194717273708107765652465293235442998150245679409107463354281283659357097225295920513809004499726705507613606307891054640408000983040357506098038038766859439251578093069219972845307799658203610533268972133380546014115014749030338582598222602600813260066601647072611922353556686536925294763432337810368752392422493625361407143669538386708164267120868866169848834692458260606627895681862228602334542926041226413285382798087677635558871572179289062513277844796012262659840493554296940547468121868903532088925835535752598391156049814396996338874186677780424663213838818094961038558291835172692069533645359313036783784985187062892371275027257219622734396127247812922195383959375333394393619860470975171312501612144091098583425684199814641692951650477074267502492747493111182038966922277061813573204678506866754495849660722562387915745484783363776404334611926396275750709333636126387402803374092454693308017329070070066635924243090423556292675922268093732319608312775771588803725136082940731453289789626170239177017029731480480318547321707646660461320383747828635475842732371506491331225342261837332886594923111209315788443282751031071629640350562615586188025361633643236855488452994410883876363165312620458873811066075419725710209086549748041458806899360258679020854448164822195830229331912137219871331879730670415025985227833138514083436098212808208975612479836456688805529213422000285771276877736585488727179883396657326714653163773759756134541011836302419708361257336026556402396370928700526767994042894882199591414710397822087440206286563929307208188188017738092040216569459713128227747488167872131414664967683901629806838229744695614966019750058006719865793311308213815719792542128004463292011011845621234773535160669865908992478068618695786975498078139492373026299911203855012672674760847140626346288482647961226416093521656335602304411821003013613943489977339317695453077666686043145942405545186208515646286160162036684342254415919479968727835903307634497996968667515675656405606627724827473897519276007