Jacobi/Legendre/Kronecker
Torbjorn Granlund
tg at gmplib.org
Mon Dec 17 21:18:13 CET 2012
nisse at lysator.liu.se (Niels Möller) writes:
I don't have the time to investigate carefully right now, but some
comments:
The functions mpz_kronecker_ui and mpz_ui_kronecker have not been
updated in years. They call mpn_jacobi_base to do the main work.
mpn_jacobi_base is implemented in a couple of different ways, one new
and several older. Tuning should select the fastest one, via
JACOBI_BASE_METHOD, with 4 being the new and usually faster code.
mpz_jacobi and mpz_legendre are aliases for the same function. That has
been completely rewritten in 5.1, calling the new mpn_jacobi_n function
for larger operands, and mpn_jacobi_base directly if the smaller operand
fits in a limb. 20% difference for single-limb operands definitely is
disturbing, I don't see what that might come from.
I'd suggest that we hold the release until at least the weekend, to see
if some of us have time and inspiration to fix this.
Speed regressions are never fun. Small operands are the most important
ones, of course.
--
Torbjörn
More information about the gmp-devel
mailing list