Bill Allombert on Tue, 06 Jun 2023 23:38:18 +0200


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

Re: Abnormous memory use for gaussian gcd()?


On Tue, Jun 06, 2023 at 09:36:21PM +0200, hermann@stamm-wilbrandt.de wrote:
> So thanks for fixing gcd() and for the master branch git pointers.
> 
> But I have to thank the most for your halfgcd() tip.
> I used gcd(p, sqrtm1+I) to determine (unique) sum of squares for prime p.
> halfgcd(sqrtm1, p) does compute something different than gcd().
> But it allows to determine sum of squares as well.
> In 87ms(!!!) yesterday for 388342-digit prime:
> https://pari.math.u-bordeaux.fr/archives/pari-users-2306/msg00011.html
> https://github.com/Hermann-SW/RSA_numbers_factored/blob/main/pari/388342.halfgcd.gp
> 
> That is so cool, with your gcd() fix halgcd() became even faster!

Indeed, the master branch includes several changes to speed up halfgcd.
However they predate the change to gcd which is unrelated.

But what I do not quite understand is how do you get the squareroots.
If you need to compute them, you can as well use qfbcornacchia directly.
(once you have a solution a^2+b^2=p, you can recover the square root
with a/b mod p).

Cheers,
Bill