Bill Allombert on Thu, 15 Jun 2023 19:00:19 +0200


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

Re: 388342-digit largest known twin prime: faster sum of squares or sqrt(-1) (mod p) ?


On Mon, Jun 12, 2023 at 03:08:46PM +0200, hermann@stamm-wilbrandt.de wrote:
> Any thoughts on speeding up "powm()" or "Mod(sqnr^(p/4), p)"?
> Or another way to compute sqrtm1 other than slower "lift(sqrt(Mod(-1, p)))"
> to compute sqrt1, 

With best known algorithms, compute square roots is fundamentally harder than computing
halfgcd. halfgcd can be done for the cost O(n*log(n)^2) while sqrt cost is O(n^2*log(n))
for a n-bit prime.
That means this is n/(c*log(n)) time harder for some constant c.

Note that with best algorithm, ggcd can also be done in O(n*log(n)^2) but it should still
be about 3 time slower than halfgcd.

> or even slower "qfbcornacchia(1, p)" 

It is easy to fix qfbcornacchia, it just need to use the right formula for the
square root...

Cheers,
Bill