Jacobi/Legendre/Kronecker

Niels Möller nisse at lysator.liu.se
Mon Dec 17 16:53:52 CET 2012


Zimmermann Paul <Paul.Zimmermann at 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, which forces to convert A to unsigned long
>
> 2) use mpz_ui_kronecker, which forces to convert P to unsigned long
>
> 3) use mpz_legendre, which forces to convert both A and P to unsigned long

I think all three should end up in mpn_jacobi_base, where most of he time should
be spent.

I haven't thought about the interface issues, I guess public functions
with single limb (or unsigned long) inputs would make sense for both
jacobi and gcd.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list