Bill Allombert on Sat, 15 Jul 2023 11:13:20 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Why is "lift(Mod(qnr, n)^(n\4))" 16% slower than C libgmp "powm(r, qnr, n/4, n)" ?


On Sat, Jul 15, 2023 at 01:05:08AM +0200, hermann@stamm-wilbrandt.de wrote:
> Since Pari/GP user guide proposes in section 1.2 to use gmp kernel, you
> might want to upstream your base 2 powm() enhancements to gmplib?

Sure, but for some other prime numbers, it seems to be slower than GMP,
hence my enquiry.

For example, could you try 

p=fibonacci(148091); Mod(2,p)^((p-1)/4)
and
p=fibonacci(148091); Mod(3,p)^((p-1)/4)

but more importantly, we do not do anything clever.

So I suspect the bit pattern of the exponent to be relevant.

Cheers,
Bill