Jacobi/Legendre/Kronecker

Niels Möller nisse at lysator.liu.se
Thu Dec 20 13:39:41 CET 2012


bodrato at mail.dm.unipi.it writes:

> Perhaps refining the condition is a better strategy.
> I propose to change (asize>1) into (asize>(alow<(blow>>16))).

Is that really right? To me it looks that it will reduce if alow and
blow are close (then the inner comparison is false, hence the test is
asize > 0, always true).

Furthermore, in the case that asize == 1 && bsize == 1, we can also have
alow < blow, and it makes sense to divide in that case as well (but with
a more complicated rule).

> PS: the constant 16, is the same used for a similar purpose in
> mpn/generic/gcd_1.c .

I think it would make sense to put the proposed optimization in the
analoguous place for jacobi, namely mpn/genereic/jacbase.c.

-- 
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