/* Copyright (C) 2024 Alessandro Languasco */ /**************** A. LANGUASCO ******************** ************* COMPUTATION OF Shanks b and c constants ********** ********* and also gamma_SB/gamma_NH/catalan/Cilleruelo ********/ global(tab); \\global variable used to initialise sumnum \\ for computing the acceleration level for the EK mod 3 constant \\{acclevelC(a) = log( a *log(10)/log(2) - 2 ) /log(2) - 1;} {acclevelC(a) = local(num,den,res,logtwo); logtwo = log(2); num = a * log(10) + log( 2*logtwo + 4*log(3) ); den = 2 * logtwo; res = log( num/den ) / logtwo; return(res); } {EK_mod3(defaultprecision)=local(minutes, millisec, seconds, derlog, sumderlogs, errC, elaptimefinalcomp, J, logtwo, twopow, onethird, twothird, deltahurwitz, zeta2, zetaval, doublepow3, twicetwopow, den, resfile, logthree, gamma31, gamma32 ); print("************ A. LANGUASCO *************"); print("********* COMPUTATION of EK constants mod 3 **********"); \\ precision setting default(realprecision,defaultprecision+10); default(format,f); print("WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! "); gettime(); print("Starting computation of EK constants mod 3 :"); print("------ "); print ("Requested precision = ", defaultprecision ); J = ceil(acclevelC(defaultprecision)); if (J > 20, error("J > 20 : decrease the required precision !")); onethird = 1./3; twothird = 2./3 ; logtwo = log(2); logthree = log(3); den = (4.0)^(2^J); errC = (2*logtwo + 4*logthree) / den; \\ step 1 of the iteration twopow = 2; \\ keep this integral (faster computation of zetahurwitz) deltahurwitz = zetahurwitz(twopow,onethird)- zetahurwitz(twopow,twothird); zeta2 = Pi^2/(6.0); sumderlogs = ( (zetahurwitz(2,onethird,1) - zetahurwitz(2,twothird,1) ) / deltahurwitz - zetahurwitz(2,1,1)/zeta2 - logthree/8.0 ); twopow = twopow*2; \\ = 4 doublepow3 = 81; \\ = 3^4 for (k = 2, J, deltahurwitz = zetahurwitz(twopow,onethird)- zetahurwitz(twopow,twothird); zetaval = zeta(twopow); twicetwopow = 2 * twopow; sumderlogs += ( zetahurwitz(twopow,onethird,1) - zetahurwitz(twopow,twothird,1) ) / deltahurwitz - zetahurwitz(twopow,1,1)/zetaval - logthree/(doublepow3-1) ; twopow = twicetwopow; doublepow3 = doublepow3*doublepow3; \\ 3^(2^(k+1)) = 3^(2^k * 2) = (3^(2^k)) ^2 ); sumderlogs += (-logthree) * J; derlog = Euler - 1.5*logthree + 4 * log(2*Pi) - 6 * log(gamma(onethird)); \\ L'(1,chi)/L(1,chi) chi quad character mod 3 gamma31 = 0.5 * (Euler + 0.5 * logthree + derlog + sumderlogs); \\ EK_mod3 constant gamma32 = Euler + 0.5*logthree - gamma31; \\ OUTPUTS print("------ "); print("RESULTS "); print("------ "); print("gamma(3,1) = ", gamma31 ); print("gamma(3,2) = ", gamma32 ); default(format,e); print("verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = ", gamma31+gamma32 - (Euler + logthree/2) ); default(format,f); resfile = fileopen("EK3-results.txt", "w"); filewrite(resfile,"************ A. LANGUASCO *************"); filewrite(resfile,"********* COMPUTATION of EK-constants **********"); filewrite(resfile,"------"); filewrite1(resfile,"required precision = "); filewrite1(resfile,defaultprecision); filewrite1(resfile," --- acceleration level = "); filewrite(resfile, J ); filewrite(resfile,"------"); filewrite(resfile,"RESULTS"); filewrite(resfile,"------"); filewrite1(resfile,"gamma(3,1) = "); filewrite(resfile, gamma31 ); filewrite(resfile,"------"); filewrite1(resfile,"gamma(3,2) = "); filewrite(resfile, gamma32 ); filewrite(resfile,"------"); fileflush(resfile); default(format,e); default(realprecision,10); print("accuracy (gamma(3,1), gamma(3,2)) = ", errC); print("acceleration level = ", J); filewrite(resfile,"------"); filewrite1(resfile,"accuracy ((gamma(3,1), gamma(3,2)) = "); filewrite(resfile, errC ); filewrite(resfile,"------"); fileflush(resfile); elaptimefinalcomp=gettime(); seconds=floor(elaptimefinalcomp/1000)%60; minutes=floor(elaptimefinalcomp/60000); millisec=elaptimefinalcomp- minutes*60000 - seconds*1000; print("EK_mod3 computation time (output time included): ", minutes, " min, ", seconds, " sec, ", millisec, " millisec"); print("****** END PROGRAM ********"); filewrite1(resfile,"b/c/gamma_SB/gamma_NH/catalan/Cilleruelo/gauss_constant/gamma41/gamma43 computation time (output time included): "); filewrite1(resfile, minutes); filewrite1(resfile, " min, "); filewrite1(resfile, seconds); filewrite1(resfile, " sec, "); filewrite1(resfile, millisec); filewrite(resfile, " millisec"); filewrite(resfile, "****** END PROGRAM ********"); fileclose(resfile); default(format,f); } /**** RESULTS **** ------------------------------------------ macmini i7 Intel gp2c languasc@zygalski Shanks % gp2c-run -pmy_ -g -W EK_mod3.gp Last login: Mon Apr 8 17:25:31 on ttys007 languasc@zygalski ~ % cd /Users/languasc/Documents/LANGUASCO/matematica/lavori/\[80\]abelianmult languasc@zygalski [80]abelianmult % gp2c-run -pmy_ -g -W EK_mod3.gp Warning:EK_mod3.gp:34: variable undeclared f Warning:EK_mod3.gp:89: variable undeclared e Reading GPRC: /Users/languasc/.gprc GPRC Done. GP/PARI CALCULATOR Version 2.15.5 (released) i386 running darwin (x86-64/GMP-6.3.0 kernel) 64-bit version compiled: Feb 24 2024, Apple clang version 15.0.0 (clang-1500.1.0.2.5) threading engine: pthread (readline v8.0 enabled, extended help enabled) Copyright (C) 2000-2022 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 ?18 for how to get moral (and possibly technical) support. parisizemax = 2048000000, primelimit = 500000, nbthreads = 12 ? for(i=1,10,print("# digits = ",i*100);init_EK_mod3(); EK_mod3(i*100); print("-------")) # digits = 100 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 100 ------ RESULTS ------ gamma(3,1) = 1.0990495258666765304844653683056101172687703511660329427900550574515373847736945293167132458214808728695730304 gamma(3,2) = 0.027472283368911175819669340238055166097134263685265381883059344252077488613274625057041694877131921039043431397 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-115 accuracy (gamma(3,1), gamma(3,2)) = 4.311475482 E-154 acceleration level = 8 EK_mod3 computation time (output time included): 0 min, 0 sec, 35 millisec ****** END PROGRAM ******** ------- # digits = 200 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 200 ------ RESULTS ------ gamma(3,1) = 1.09904952586667653048446536830561011726877035116603294279005505745153738477369452931671324582148087286957303038581689179186455578275645530987690851527472072669361174955648269171470306826099824530106434081981983 gamma(3,2) = 0.0274722833689111758196693402380551660971342636852653818830593442520774886132746250570416948771319210390434313969691235602799503446953474368736664177538415148614699687781453296126577239537774928979018603473133345 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-211 accuracy (gamma(3,1), gamma(3,2)) = 3.215645320 E-308 acceleration level = 9 EK_mod3 computation time (output time included): 0 min, 0 sec, 102 millisec ****** END PROGRAM ******** ------- # digits = 300 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 300 ------ RESULTS ------ gamma(3,1) = 1.099049525866676530484465368305610117268770351166032942790055057451537384773694529316713245821480872869573030385816891791864555782756455309876908515274720726693611749556482691714703068260998245301064340819819832039525978238563670422486435373779457192437549648815886898920880473589894162571117827994298790725995 gamma(3,2) = 0.02747228336891117581966934023805516609713426368526538188305934425207748861327462505704169487713192103904343139696912356027995034469534743687366641775384151486146996877814532961265772395377749289790186034731332766921248857354481702765256333080783442664882922274326762145409414194907396552750465611386955694072389 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-327 accuracy (gamma(3,1), gamma(3,2)) = 3.215645320 E-308 acceleration level = 9 EK_mod3 computation time (output time included): 0 min, 0 sec, 248 millisec ****** END PROGRAM ******** ------- # digits = 400 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 400 ------ RESULTS ------ gamma(3,1) = 1.0990495258666765304844653683056101172687703511660329427900550574515373847736945293167132458214808728695730303858168917918645557827564553098769085152747207266936117495564826917147030682609982453010643408198198320395259782385636704224864353737794571924375496488158868989208804735898941625711178279942987907259987327515554875356395573114574020857358894709901204926345052259257697159501779842304770118084237552496 gamma(3,2) = 0.027472283368911175819669340238055166097134263685265381883059344252077488613274625057041694877131921039043431396969123560279950344695347436873666417753841514861469968778145329612657723953777492897901860347313327669212488573544817027652563330807834426648829222743267621454094141949073965527504656113869556940720030407239832386402373217348649278436919958191962855238630705358109607073916892745566420397065904432293 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-423 accuracy (gamma(3,1), gamma(3,2)) = 1.788762085 E-616 acceleration level = 10 EK_mod3 computation time (output time included): 0 min, 0 sec, 418 millisec ****** END PROGRAM ******** ------- # digits = 500 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 500 ------ RESULTS ------ gamma(3,1) = 1.09904952586667653048446536830561011726877035116603294279005505745153738477369452931671324582148087286957303038581689179186455578275645530987690851527472072669361174955648269171470306826099824530106434081981983203952597823856367042248643537377945719243754964881588689892088047358989416257111782799429879072599873275155548753563955731145740208573588947099012049263450522592576971595017798423047701180842375524961496540206749517948696455432104544487148193308875645752958650944616870034246828992517769008227240839 gamma(3,2) = 0.0274722833689111758196693402380551660971342636852653818830593442520774886132746250570416948771319210390434313969691235602799503446953474368736664177538415148614699687781453296126577239537774928979018603473133276692124885735448170276525633308078344266488292227432676214540941419490739655275046561138695569407200304072398323864023732173486492784369199581919628552386307053581096070739168927455664203970659044322931162584392097118968044631196847775970943686503340174472694245713322993828064132849903169743510338416 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-519 accuracy (gamma(3,1), gamma(3,2)) = 1.788762085 E-616 acceleration level = 10 EK_mod3 computation time (output time included): 0 min, 0 sec, 657 millisec ****** END PROGRAM ******** ------- # digits = 600 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 600 ------ RESULTS ------ gamma(3,1) = 1.099049525866676530484465368305610117268770351166032942790055057451537384773694529316713245821480872869573030385816891791864555782756455309876908515274720726693611749556482691714703068260998245301064340819819832039525978238563670422486435373779457192437549648815886898920880473589894162571117827994298790725998732751555487535639557311457402085735889470990120492634505225925769715950177984230477011808423755249614965402067495179486964554321045444871481933088756457529586509446168700342468289925177690082272408386335221485853318394949283858041267174572275127260156146490401981824604733106538920320933266775801560 gamma(3,2) = 0.02747228336891117581966934023805516609713426368526538188305934425207748861327462505704169487713192103904343139696912356027995034469534743687366641775384151486146996877814532961265772395377749289790186034731332766921248857354481702765256333080783442664882922274326762145409414194907396552750465611386955694072003040723983238640237321734864927843691995819196285523863070535810960707391689274556642039706590443229311625843920971189680446311968477759709436865033401744726942457133229938280641328499031697435103384159799270100977049874997366608757562697051064442625000708368891056728791957011602379920383457450679385 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-616 accuracy (gamma(3,1), gamma(3,2)) = 1.788762085 E-616 acceleration level = 10 EK_mod3 computation time (output time included): 0 min, 0 sec, 994 millisec ****** END PROGRAM ******** ------- # digits = 700 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 700 ------ RESULTS ------ gamma(3,1) = 1.0990495258666765304844653683056101172687703511660329427900550574515373847736945293167132458214808728695730303858168917918645557827564553098769085152747207266936117495564826917147030682609982453010643408198198320395259782385636704224864353737794571924375496488158868989208804735898941625711178279942987907259987327515554875356395573114574020857358894709901204926345052259257697159501779842304770118084237552496149654020674951794869645543210454448714819330887564575295865094461687003424682899251776900822724083863352214858533183949492838580412671745722751272601561464904019818246047331065389203209332667758015598078329718071539741738719705909267577135411883109780635770797066827893151451205003157291061187028884 gamma(3,2) = 0.027472283368911175819669340238055166097134263685265381883059344252077488613274625057041694877131921039043431396969123560279950344695347436873666417753841514861469968778145329612657723953777492897901860347313327669212488573544817027652563330807834426648829222743267621454094141949073965527504656113869556940720030407239832386402373217348649278436919958191962855238630705358109607073916892745566420397065904432293116258439209711896804463119684777597094368650334017447269424571332299382806413284990316974351033841597992701009770498749973666087575626970510644426250007083688910567287919570116023799203834574506793851793827612735511423687974109378439587401606069571709882905961449161192544415039434046955675298488627 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-712 accuracy (gamma(3,1), gamma(3,2)) = 5.535048887 E-1233 acceleration level = 11 EK_mod3 computation time (output time included): 0 min, 1 sec, 448 millisec ****** END PROGRAM ******** ------- # digits = 800 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 800 ------ RESULTS ------ gamma(3,1) = 1.09904952586667653048446536830561011726877035116603294279005505745153738477369452931671324582148087286957303038581689179186455578275645530987690851527472072669361174955648269171470306826099824530106434081981983203952597823856367042248643537377945719243754964881588689892088047358989416257111782799429879072599873275155548753563955731145740208573588947099012049263450522592576971595017798423047701180842375524961496540206749517948696455432104544487148193308875645752958650944616870034246828992517769008227240838633522148585331839494928385804126717457227512726015614649040198182460473310653892032093326677580155980783297180715397417387197059092675771354118831097806357707970668278931514512050031572910611870288834606927560689372551711523491737291117509963916847758335258185860136099922007790767761657102822296664 gamma(3,2) = 0.0274722833689111758196693402380551660971342636852653818830593442520774886132746250570416948771319210390434313969691235602799503446953474368736664177538415148614699687781453296126577239537774928979018603473133276692124885735448170276525633308078344266488292227432676214540941419490739655275046561138695569407200304072398323864023732173486492784369199581919628552386307053581096070739168927455664203970659044322931162584392097118968044631196847775970943686503340174472694245713322993828064132849903169743510338415979927010097704987499736660875756269705106444262500070836889105672879195701160237992038345745067938517938276127355114236879741093784395874016060695717098829059614491611925444150394340469556752984886509006689178626779119192587892448773998181298320452838384442240594188882596263342917708496665086662651 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-828 accuracy (gamma(3,1), gamma(3,2)) = 5.535048887 E-1233 acceleration level = 11 EK_mod3 computation time (output time included): 0 min, 2 sec, 60 millisec ****** END PROGRAM ******** ------- # digits = 900 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 900 ------ RESULTS ------ gamma(3,1) = 1.099049525866676530484465368305610117268770351166032942790055057451537384773694529316713245821480872869573030385816891791864555782756455309876908515274720726693611749556482691714703068260998245301064340819819832039525978238563670422486435373779457192437549648815886898920880473589894162571117827994298790725998732751555487535639557311457402085735889470990120492634505225925769715950177984230477011808423755249614965402067495179486964554321045444871481933088756457529586509446168700342468289925177690082272408386335221485853318394949283858041267174572275127260156146490401981824604733106538920320933266775801559807832971807153974173871970590926757713541188310978063577079706682789315145120500315729106118702888346069275606893725517115234917372911175099639168477583352581858601360999220077907677616571028222966644825559585540690962870871856473797012445252989462898304088872319876555811615667151012593391286343731 gamma(3,2) = 0.02747228336891117581966934023805516609713426368526538188305934425207748861327462505704169487713192103904343139696912356027995034469534743687366641775384151486146996877814532961265772395377749289790186034731332766921248857354481702765256333080783442664882922274326762145409414194907396552750465611386955694072003040723983238640237321734864927843691995819196285523863070535810960707391689274556642039706590443229311625843920971189680446311968477759709436865033401744726942457133229938280641328499031697435103384159799270100977049874997366608757562697051064442625000708368891056728791957011602379920383457450679385179382761273551142368797410937843958740160606957170988290596144916119254441503943404695567529848865090066891786267791191925878924487739981812983204528383844422405941888825962633429177084966650866626509544313542645298599456745883326072523424586649184830207183814962682491944479813138094744560057721210 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-924 accuracy (gamma(3,1), gamma(3,2)) = 5.535048887 E-1233 acceleration level = 11 EK_mod3 computation time (output time included): 0 min, 2 sec, 703 millisec ****** END PROGRAM ******** ------- # digits = 1000 ************ A. LANGUASCO ************* ********* COMPUTATION of EK constants mod 3 ********** WARNING: for large accuracy you MUST increase the pari stack size (parisizemax) !!!! Starting computation of EK constants mod 3 : ------ Requested precision = 1000 ------ RESULTS ------ gamma(3,1) = 1.0990495258666765304844653683056101172687703511660329427900550574515373847736945293167132458214808728695730303858168917918645557827564553098769085152747207266936117495564826917147030682609982453010643408198198320395259782385636704224864353737794571924375496488158868989208804735898941625711178279942987907259987327515554875356395573114574020857358894709901204926345052259257697159501779842304770118084237552496149654020674951794869645543210454448714819330887564575295865094461687003424682899251776900822724083863352214858533183949492838580412671745722751272601561464904019818246047331065389203209332667758015598078329718071539741738719705909267577135411883109780635770797066827893151451205003157291061187028883460692756068937255171152349173729111750996391684775833525818586013609992200779076776165710282229666448255595855406909628708718564737970124452529894628983040888723198765558116156671510125933912863437307769906114208206292755250199545713742060059548469540270182339227709881439707518409473989240985049935 gamma(3,2) = 0.027472283368911175819669340238055166097134263685265381883059344252077488613274625057041694877131921039043431396969123560279950344695347436873666417753841514861469968778145329612657723953777492897901860347313327669212488573544817027652563330807834426648829222743267621454094141949073965527504656113869556940720030407239832386402373217348649278436919958191962855238630705358109607073916892745566420397065904432293116258439209711896804463119684777597094368650334017447269424571332299382806413284990316974351033841597992701009770498749973666087575626970510644426250007083688910567287919570116023799203834574506793851793827612735511423687974109378439587401606069571709882905961449161192544415039434046955675298488650900668917862677911919258789244877399818129832045283838444224059418888259626334291770849666508666265095443135426452985994567458833260725234245866491848302071838149626824919444798131380947445600577212099309242310307910807971447760309169616435899929695535738862949859979744262751260056773672308897578408 verification: gamma(3,2) + gamma(3,1) - (gamma + log(3)/2) = 0.E-1020 accuracy (gamma(3,1), gamma(3,2)) = 5.535048887 E-1233 acceleration level = 11 EK_mod3 computation time (output time included): 0 min, 3 sec, 498 millisec ****** END PROGRAM ******** ------- ? ************/