/* Copyright (C) 2019 Alessandro Languasco */ /**************** A. LANGUASCO ******************** ************* COMPUTATION OF THE max_chi |L(1,chi)| MOD q(PRIME) *******/ /************************* Building the S approach ****************/ \\ Global variables: global(log_gamma_matrix); global(ak_matrix); global(tab); \\global variable used to initialise sumnum global(phir); global(phirhalf); global(pir); global(defaultprecision); /************* COMPUTATION OF THE min_chi |L(1,chi)| MOD q(PRIME) ******* ************* FOR r1<=q<=r2 ************* ************* Using the loggamma-function ********************/ {minL_logGamma(r1,r2,defaultprecision)=local(minutes, millisec, seconds, rows, columns, elaptimefinalcomp, elaptimeprecomp, M, Lvalue, evenresult,oddresult, qminusone, qminustwo, correctionLvalue, logtwopi, qminusonehalf, qminusonehalfminusone, twoPi, twoPiI, u, conjv, chi, aux, numer, i ); \\ minutes,millisec,seconds: used just to compute the elapsed computation time; local variables \\ defaultprecision: used to fix the precision used in the computations; global variable print("************ A. LANGUASCO *************"); print("********* COMPUTATION OF THE MIN |L(1,chi)|**********"); print("******* FOR q IN ONE INTERVAL ********"); print("********* with the logGamma-FUNCTION **********"); \\ precision setting default(realprecision,defaultprecision); r1=nextprime(r1); r2=precprime(r2); if (r1>r2, print("error: no odd primes in this interval. END PROGRAM");return); if (r1 < 3, r1=3); print("Interval=[",r1,",",r2,"]"); phir=r2-1; phirhalf=phir/2; pir=primepi(r2)-primepi(r1)+1; gettime(); print("Performing precomputations of log(Gamma(a/q)"); print(" for this interval"); precomplogGamma(r1,r2); elaptimeprecomp=gettime(); twoPi=2*Pi; logtwopi=log(twoPi); twoPiI=twoPi*I; MinLfile = fileopen("minL-values.tex", "w"); i=0; gettime(); print("Starting computation of min_q"); forprime(q=r1,r2, i+=1; qminusone=q-1; qminustwo=qminusone-1; qminusonehalf=qminusone/2; qminusonehalfminusone=qminusonehalf-1; correctionLvalue= 2/sqrt(q); u=twoPiI/qminusone; M=10^(10000);Lvalue=0; \\ even characters for (m=1, qminusonehalfminusone, numer=0; aux=0; \\ v=exp(u*2*m); \\ j=2m+1; j-1 even (j odd) means an even character conjv= exp(-u*2*m); \\ conjugate of v chi=1; \\ k=0 ; chi = v^0 for (k=0,qminustwo, \\chi=v^(-k) built via subsequent products aux += chi * log_gamma_matrix[i,k+1]; \\log(gamma(g^k%q/q)) chi= chi * conjv; ); Lvalue=abs(correctionLvalue*aux); if (Lvalue