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=10000;​​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: 13264
Starting block 1 to 13264
13264 iterations done.
The first run took this many seconds:2.99515
Computing MRB2...
Iterations required: 13465
Starting block 1 to 13465
13465 iterations done.
the second run took this many seconds:3.10201
Error estimate = 0.×
-10000
10
Estimated good digits = at least 10000
10000 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4346929931473009293080432343