Re: Jacobi/Legendre/Kronecker

2012-12-20 Thread bodrato
Ciao Niels, ciao Paul! Il Lun, 17 Dicembre 2012 9:07 pm, Niels Möller ha scritto: Zimmermann Paul paul.zimmerm...@loria.fr writes: frite% gcc -I$GMP/include -O2 -g e.c $GMP/lib/libgmp.a frite% ./a.out GMP: header 5.0.5, library 5.0.5 mpz_jacobi: 408ms frite% gcc -I/tmp/include -O2 -g

Re: Jacobi/Legendre/Kronecker

2012-12-18 Thread Torbjorn Granlund
ni...@lysator.liu.se (Niels Möller) writes: Zimmermann Paul paul.zimmerm...@loria.fr writes: I'm glad you asked (on the AMD processor): frite% gcc -I$GMP/include -O2 -g e.c $GMP/lib/libgmp.a frite% ./a.out GMP: header 5.0.5, library 5.0.5 mpz_jacobi: 408ms

Jacobi/Legendre/Kronecker

2012-12-17 Thread Zimmermann Paul
Hi, I wonder why there are some ui/si variants for mpz_kronecker, but not for the simpler functions mpz_jacobi and mpz_legendre. Assume one wants to compute the Legendre symbol (A/P) for P an unsigned long (and A too). What is more efficient? 1) use mpz_kronecker_ui, which forces to

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Niels Möller
Zimmermann Paul paul.zimmerm...@loria.fr writes: I wonder why there are some ui/si variants for mpz_kronecker, but not for the simpler functions mpz_jacobi and mpz_legendre. Ah, and one other comment. In GMP, mpz_kronecker, mpz_jacobi and mpz_legendre are all different names for the same

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Zimmermann Paul
Niels, From: ni...@lysator.liu.se (Niels Möller) Date: Mon, 17 Dec 2012 16:53:52 +0100 Zimmermann Paul paul.zimmerm...@loria.fr writes: Assume one wants to compute the Legendre symbol (A/P) for P an unsigned long (and A too). What is more efficient? 1) use mpz_kronecker_ui,

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Niels Möller
Zimmermann Paul paul.zimmerm...@loria.fr writes: by the way, here are some timings on a 2.27Ghz Intel Xeon L5640 with GMP 5.0.5: Note that large parts of the jacobi code is replaced in the imminent 5.1 release. So it might be interesting to benchmark also the latest code. Regards, /Niels --

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Zimmermann Paul
Niels, Note that large parts of the jacobi code is replaced in the imminent 5.1 release. So it might be interesting to benchmark also the latest code. I'm glad you asked (on the AMD processor): frite% gcc -I$GMP/include -O2 -g e.c $GMP/lib/libgmp.a frite% ./a.out GMP: header 5.0.5,

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Niels Möller
Zimmermann Paul paul.zimmerm...@loria.fr writes: this is strange, since from the documentation mpz_jacobi(A,15) should work but mpz_legendre(A,15) should be undefined. If no check is done at all, I do not see why there are 3 different functions. To me, it would make sense to have only

Re: Jacobi/Legendre/Kronecker

2012-12-17 Thread Niels Möller
Zimmermann Paul paul.zimmerm...@loria.fr writes: I'm glad you asked (on the AMD processor): frite% gcc -I$GMP/include -O2 -g e.c $GMP/lib/libgmp.a frite% ./a.out GMP: header 5.0.5, library 5.0.5 mpz_jacobi: 408ms mpz_legendre: 412ms mpz_kronecker_ui: 240ms mpz_ui_kronecker: