fprintf "table2", "\n"; fprintf "table2", "\\begin{table}\n"; fprintf "table2", "\\caption{Timings for $ \\Li n {(\\z-1)/\\pi} $.}\n"; fprintf "table2", "\\label{table2}\n"; fprintf "table2", "\\vskip-.7cm\n"; fprintf "table2", "$$\n"; fprintf "table2", "\\begin{array}{lrrrrrr}\n"; fprintf "table2", "\\hline\n"; fprintf "table2", "\\vphantom{b^{b^b}}\n"; fprintf "table2", "\\vphantom{p_{p_{p_p}}}\n"; fprintf "table2", "q(x) & n & p & e & f & N & \\text{Time}\\cr\n"; fprintf "table2", "\\hline\n"; fprintf "table2", "\\vphantom{b^{b^b}}\n"; load "lippapertablesdata"; for example in gothrough do print "==================================="; p:=example[1]; N:=example[2]; n:=example[3]; f:=example[4]; pol:=example[5]; print "p:", p; resfsize:=p^f; e:=Degree(pol); Ne:=e*N+1; // add 1 since we define precision using >, not >= // So the role of N in the paper is played by Ne since Magma does renormalize the valuation on F print "N:", N; print "Ne:", Ne; // // A basic function: mink:=function(c1,c2,c3) // This function returns, if c1,c2>0, the smallest integer k ge 2 such that c1*m-c2*Log(m)>c3 for all m ge k. k1:=Maximum(1,Floor(c2/c1));k2:=Ceiling(c2/c1); if Minimum(c1*k1-c2*Log(k1), c1*k2-c2*Log(k2)) gt c3 then return 2; else while c1*k1-c2*Log(k1) le c3 do; k1:=k1+Ceiling((c2*Log(k1)-c1*k1+c3)/c1); end while; return k1; end if; end function; // Now the things about power series. // First the M needed for Li_n around 0. M:=Maximum(0,Ceiling(Log(n*e/Log(p))/Log(p))); while p^(M+1)/e-(M+1)*n le N do M:=M+1; end while; print "M:", M; // // Next the set-up for the logarithm. // We don't use the sophisticated theoretical error for the logarithm but a more hands-on one from // the standard power series expansion around 1 and compute log(z) as log(z')/(e*(p^f-1)) where // z'=z^{e*(p^f-1)}/p^{v_p(z)*(p^f-1)}, which is in U_1. To log(z') we apply the standard power series method around 1. k1:=Maximum(1,Floor(e/Log(p)));k2:=Ceiling(e/Log(p)); V:=-Valuation(e,p)+Floor(Minimum(k1/e-Log(k1)/Log(p),k2/e-Log(k2)/Log(p))); logsl:=mink(1/e, 1/Log(p),Valuation(e,p) + Maximum(V, N+Valuation(Factorial(n),p)-n*V)); logQpprecision:=Valuation(e,p) + Floor(Log(logsl-1)/Log(p)) + Maximum(V, N+Valuation(Factorial(n),p)-n*V); Qpprecision:=N+n*M+1; if logQpprecision gt Qpprecision then printf "Increasing precision for log, from %o to %o.\n", Qpprecision, logQpprecision; Qpprecision:=logQpprecision; end if; print "Qpprecision:", Qpprecision; // // We can now create the field up to the required precision. // First the unramified extension, then a totally ramified extension Qp:=pAdicField(p,Qpprecision); Fprecision:=e*Qpprecision; print "Fprecision:", Fprecision; Funr:=ext; F:=ext; print "Fields have been created."; pp:=UniformizingElement(F); print "pp is a root of pol:", Evaluate(pol,pp); // For the log: Qpt:=PowerSeriesRing(Qp,logsl); print "Computed LOG"; // now create some elements: Funrz:=PolynomialRing(Funr); Tmgen:=HenselLift(z^(resfsize-1)-1, Funr!PrimitiveElement(ResidueClassField(IntegerRing(Funr))), Qpprecision); print "Computed Tmgen"; // // Now we can define the functions // The branch of the logarithm with Log(p)=0: Lizero:=function(n,z) answer:=0; if n ge 2 then for m in [0..M] do tslm:=Maximum(1,Floor(e*(N+m*n)/p^m)); answer:=answer + &+[ k mod p eq 0 select 0 else z^(k*p^m)/k^n : k in [1..tslm] ]/p^(m*n); end for; return answer+O(pp^Ne); else return "Value of n not allowed"; end if; end function; Liinf:=function(n,z) zp:=1-(F!z^e/p^Valuation(F!z))^(resfsize-1); return (-1)^(n-1)*Lizero(n,1/z) + &+[zp^k/Qp!k : k in [1..logsl-1]]^n/Factorial(n) + O(pp^Ne); end function; // Now about times testz:=(Tmgen-1)/pp; if Precision(F!testz) lt Maximum(N+n*M+Valuation(F!testz), 0) then print "testz is not known up to high enough a degree of precision"; end if; mytime:=Cputime(); A:=Liinf(n,testz); TIME:=Cputime(mytime); print "CPUtime:", TIME; fprintf "table2", "%o & %o & %o & %o & %o & %o & %o \\cr\n", pol, n, p, e, f, N, TIME; end for; print "==================================="; fprintf "table2", "\\hline\n"; fprintf "table2", "\\end{array}\n"; fprintf "table2", "$$\n"; fprintf "table2", "\\end{table}\n"; fprintf "table2", "\n";