HOW IT WORKS a) description a1) file EKmain.c: (C program) input: an odd prime q (it is checked that q is prime and odd) output: file primroot.res: first line q; second line g, a primitive root mod q a2) file m_precT.c: main file which calls precT.c (routine produced by gp2c which computes -T(g^k/q) input: file primroot.res x,y integers such that 0<=x mainEK.gp.c /usr/bin/gcc -c -o mainEK.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" mainEK.gp.c /usr/bin/gcc EKmain.c mainEK.gp.o -g -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" -L/usr/local/lib -lpari -o EKmain.exe gp2c -pmy_ -g -W preclngamma.gp > preclngamma.gp.c /usr/bin/gcc -c -o preclngamma.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" preclngamma.gp.c /usr/bin/gcc m_preclngamma.c preclngamma.gp.o -g -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" -L/usr/local/lib -lpari -o m_preclngamma.exe gp2c -pmy_ -g -W precpsi.gp > precpsi.gp.c /usr/bin/gcc -c -o precpsi.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" precpsi.gp.c /usr/bin/gcc m_precpsi.c precpsi.gp.o -g -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" -L/usr/local/lib -lpari -o m_precpsi.exe gp2c -pmy_ -g -W precT.gp > precT.gp.c /usr/bin/gcc -c -o precT.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" precT.gp.c /usr/bin/gcc m_precT.c precT.gp.o -g -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" -L/usr/local/lib -lpari -o m_precT.exe gp2c -pmy_ -g -W precS.gp > precS.gp.c /usr/bin/gcc -c -o precS.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" precS.gp.c /usr/bin/gcc m_precS.c precS.gp.o -g -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" -L/usr/local/lib -lpari -o m_precS.exe OPTIPLEX ./compila-optiplex-precomp.sh gp2c -pmy_ -g -W preclngamma.gp > preclngamma.gp.c /usr/bin/gcc -c -o preclngamma.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" preclngamma.gp.c /usr/bin/gcc m_preclngamma.c preclngamma.gp.o -g -O3 -Wall -Wno-unused-result -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\"-lgmp -L/usr/local/lib -lpari -o m_preclngamma.exe gp2c -pmy_ -g -W preclngamma.gp > preclngamma.gp.c /usr/bin/gcc -c -o preclngamma.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" preclngamma.gp.c /usr/bin/gcc m_preclngamma.c preclngamma.gp.o -g -O3 -Wall -Wno-unused-result -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\"-lgmp -L/usr/local/lib -lpari -o m_preclngamma.exe gp2c -pmy_ -g -W precpsi.gp > precpsi.gp.c /usr/bin/gcc -c -o precpsi.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" precpsi.gp.c /usr/bin/gcc m_precpsi.c precpsi.gp.o -g -O3 -Wall -Wno-unused-result -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\"-lgmp -L/usr/local/lib -lpari -o m_precpsi.exe gp2c -pmy_ -g -W precT.gp > precT.gp.c /usr/bin/gcc -c -o precT.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" precT.gp.c /usr/bin/gcc m_precT.c precT.gp.o -g -O3 -Wall -Wno-unused-result -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\"-lgmp -L/usr/local/lib -lpari -o m_precT.exe gp2c -pmy_ -g -W precS.gp > precS.gp.c /usr/bin/gcc -c -o precS.gp.o -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\" precS.gp.c /usr/bin/gcc m_precS.c precS.gp.o -g -O3 -Wall -Wno-unused-result -fno-strict-aliasing -fomit-frame-pointer -fPIC -I\"/usr/local/include\"-lgmp -L/usr/local/lib -lpari -o m_precS.exe b) run the main program ./EKmain.exe give it an odd prime; the output is the file primroot.res whics contatins a q in the firs line and g a primitive root mod q, in the second line c) run the precomputation programs to get psi, lngamma, T, S values; if needed split the computation in intervals using ./lancia.sh (chmod 755 ./lancia.sh to being able to execute it) EXAMPLE: ./lancia.sh ./m_preclngamma.exe START FINISH STEP means that ./m_preclngamma.exe is executed running with exponents starting from START to FINISH using intervals of length STEP to have the whole exponent range put START=0, END= q-2, STEP q-1 EXAMPLE q=30011 languasco@OptiPlex-3050:~/Desktop/EK/for_precomputations$ ./lancia.sh ./m_preclngamma.exe 0 30009 30010 PRG=./m_preclngamma.exe, BEGIN=0, END=30009, STEP=30010 x = y = Precomputation lngamma-values for q = 30011 and saving on file Precomputation time (I/O included): 0 min, 0 sec, 854 millisec languasco@OptiPlex-3050:~/Desktop/EK/for_precomputations$ ./lancia.sh ./m_precpsi.exe 0 30009 30010 PRG=./m_precpsi.exe, BEGIN=0, END=30009, STEP=30010 x = y = Precomputation psi-values for q = 30011 and saving on file Precomputation time (I/O included): 0 min, 0 sec, 509 millisec languasco@OptiPlex-3050:~/Desktop/EK/for_precomputations$ ./lancia.sh ./m_precT.exe 0 30009 10000 PRG=./m_precT.exe, BEGIN=0, END=30009, STEP=10000 x = y = Precomputation T-values for q = 30011 and saving on file Precomputation time (I/O included): 1 min, 4 sec, 696 millisec x = y = Precomputation T-values for q = 30011 and saving on file Precomputation time (I/O included): 1 min, 4 sec, 889 millisec x = y = Precomputation T-values for q = 30011 and saving on file Precomputation time (I/O included): 1 min, 4 sec, 790 millisec x = y = Precomputation T-values for q = 30011 and saving on file Precomputation time (I/O included): 0 min, 0 sec, 65 millisec EXAMPLE q=10007 air:for_precomputations languasc$ ./lancia.sh ./m_preclngamma.exe 0 10005 10006 PRG=./m_preclngamma.exe, BEGIN=0, END=10005, STEP=10006 x = y = Precomputation lngamma-values for q = 10007 and saving on file Precomputation time (I/O included): 0 min, 0 sec, 436 millisec air:for_precomputations languasc$ ./lancia.sh ./m_precpsi.exe 0 10005 10006 PRG=./m_precpsi.exe, BEGIN=0, END=10005, STEP=10006 x = y = Precomputation psi-values for q = 10007 and saving on file Precomputation time (I/O included): 0 min, 0 sec, 259 millisec air:for_precomputations languasc$ ./lancia.sh ./m_precS.exe 0 10005 10006 PRG=./m_precS.exe, BEGIN=0, END=10005, STEP=10006 x = y = Precomputation S-values for q = 10007 and saving on file Precomputation time (I/O included): 1 min, 36 sec, 325 millisec air:for_precomputations languasc$ ./lancia.sh ./m_precT.exe 0 10005 10006 PRG=./m_precT.exe, BEGIN=0, END=10005, STEP=10006 x = y = Precomputation T-values for q = 10007 and saving on file Precomputation time (I/O included): 1 min, 23 sec, 284 millisec languasco@OptiPlex-3050:~/Desktop/EK/for_precomputations$ ./lancia.sh ./m_precS.exe 0 30009 10000 PRG=./m_precS.exe, BEGIN=0, END=30009, STEP=10000 x = y = Precomputation S-values for q = 30011 and saving on file Precomputation time (I/O included): 1 min, 18 sec, 177 millisec x = y = Precomputation S-values for q = 30011 and saving on file Precomputation time (I/O included): 1 min, 18 sec, 64 millisec x = y = Precomputation S-values for q = 30011 and saving on file Precomputation time (I/O included): 1 min, 18 sec, 84 millisec x = y = Precomputation S-values for q = 30011 and saving on file Precomputation time (I/O included): 0 min, 0 sec, 76 millisec e) gluing precomputation result files *** ATTENTION *** FIRST DELETE OLD PRECOMPUTATION RESULTS **** - the files precomp_T--*-*.res has to be glued together getting precomp_T.res (which contains the complete sequence, i.e. for x=0 and y=q-2) - the files precomp_S--*-*.res has to be glued together getting precomp_S.res (which contains the complete sequence, i.e. for x=0 and y=q-2) - the files precomp_psi--*-*.res has to be glued together getting precomp_psi.res (which contains the complete sequence, i.e. for x=0 and y=q-2) - the files precomp_logGamma--*-*.res has to be glued together getting precomp_logGamma.res (which contains the complete sequence, i.e. for x=0 and y=q-2) using echo namefile-*.res to check we have them all using cat namefile-*.res > namefile.res to glue them EXAMPLE: air:for_precomputations languasc$ cat precomp_logGamma--*-*.res >precomp_logGamma.res air:for_precomputations languasc$ cat precomp_T--*-*.res >precomp_T.res air:for_precomputations languasc$ cat precomp_S--*-*.res >precomp_S.res air:for_precomputations languasc$ cat precomp_psi--*-*.res >precomp_psi.res f) FINAL FFT computations using the programs (fftw need to be installed) c1) EK-T-fftw-real.c: use the fftw library (double precision) for real sequences input: files primroot.res, precomp_T.res, precomp_psi.res output: EK(q) c2) EK-T-fftwl-real.c: use the fftw library (long double precision) for real sequences input: files primroot.res, precomp_T.res, precomp_psi.res output: EK(q) c3) EK-S-fftw-real.c: use the fftw library (double precision) for real sequences input: files primroot.res, precomp_S.res, precomp_logGamma.res output: EK(q)^+, EK(q) c4) EK-S-fftwl-real.c: use the fftw library (long double precision) for real sequences input: files primroot.res, precomp_S.res, precomp_logGamma.re output: EK(q)^+, EK(q) compiling instructions: MAC (fftw installed using homebrew) ./compila-mac-fft.sh clang -o EK-S-fftw.exe -lfftw3 EK-S-fftw-real.c using double precision clang -o EK-S-fftwl.exe -lfftw3l EK-S-fftwl-real.c using long double precision clang -o EK-T-fftw.exe -lfftw3 EK-T-fftw-real.c using double precision clang -o EK-T-fftwl.exe -lfftw3l EK-T-fftwl-real.c using long double precision OPTIPLEX (fftw installed using apt-get) ./compila-optiplex-fft.sh gcc -o EK-S-fftw.exe EK-S-fftw-real.c -L /usr/lib/x86_64-linux-gnu/ -l fftw3 -lm using double precision gcc -o EK-S-fftwl.exe EK-S-fftwl-real.c -L /usr/lib/x86_64-linux-gnu/ -l fftw3l -lm using long double precision gcc -o EK-T-fftw.exe EK-T-fftw-real.c -L /usr/lib/x86_64-linux-gnu/ -l fftw3 -lm using double precision gcc -o EK-T-fftwl.exe EK-T-fftwl-real.c -L /usr/lib/x86_64-linux-gnu/ -lfftw3l -lm using long double precision EXAMPLE languasco@OptiPlex-3050:~/Desktop/EK/for_fftw$ ./EK-T-fftw.exe ********** A. LANGUASCO *********** Computation of the Euler-Kronecker constan with the T function. [double precision] Acquiring q from file: q = 30011 Acquiring precomputed values for T(a/q). Done Acquiring precomputed values for psi(a/q). Done EK(30011) = 10.333080 FFT - computation time (I/O excluded): 0.000000 min. 0.000000 sec. 1.432000 millisec. ********** END PROGRAM *********** languasco@OptiPlex-3050:~/Desktop/EK/for_fftw$ ./EK-T-fftwl.exe ********** A. LANGUASCO *********** Computation of the Euler-Kronecker constan with the T function. [long double precision] Acquiring q from file: q = 30011 Acquiring precomputed values for T(a/q). Done Acquiring precomputed values for psi(a/q). Done EK(30011) = 10.333080 FFT - computation time (I/O excluded): 0.000000 min. 0.000000 sec. 4.355000 millisec. ********** END PROGRAM *********** languasco@OptiPlex-3050:~/Desktop/EK/for_fftw$ ./EK-S-fftwl.exe ********** A. LANGUASCO *********** Computation of the Euler-Kronecker constant with the S function. [long double precision] Acquiring q from file: q = 30011 Acquiring precomputed values for S(a/q). Done Acquiring precomputed values for log(gamma(a/q)). Done Building the sequence g^k%q. Done EK(30011)^+ = 11.012704 EK(30011) = 10.333080 FFT - computation time (I/O excluded): 0.000000 min. 0.000000 sec. 6.573000 millisec. ********** END PROGRAM *********** languasco@OptiPlex-3050:~/Desktop/EK/for_fftw$ ./EK-S-fftw.exe ********** A. LANGUASCO *********** Computation of the Euler-Kronecker constant with the S function. [double precision] Acquiring q from file: q = 30011 Acquiring precomputed values for S(a/q). Done Acquiring precomputed values for log(gamma(a/q)). Done Building the sequence g^k%q. Done EK(30011)^+ = 11.012704 EK(30011) = 10.333080 FFT - computation time (I/O excluded): 0.000000 min. 0.000000 sec. 2.180000 millisec. ********** END PROGRAM ***********