Bill Allombert on Mon, 05 Jun 2023 21:51:51 +0200


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

Re: Abnormous memory use for gaussian gcd()?


On Mon, Jun 05, 2023 at 07:40:10PM +0200, hermann@stamm-wilbrandt.de wrote:
> Thank you,
> 
> that made it work:
> 
> $ gp < 36401.gp
> ...
> 0322528922710200176909512750979384713015800665694494304[+++]
>   ***   last result computed in 1min, 41,244 ms.
> Goodbye!
> $
> 
> I don't understand the difference yet, this is whole script 36401.gp without
> word wrapping:

The difference is that
gp 36401.gp reads 36401.gp as a single command, so ## does not work.
gp < 36401.gp reads each line as a different command.

Under GP you can do either

read("36401.gp")   reads 36401.gp as a single command
\r 36401.gp        reads each lines as a different command.

Now, why the gcd is very slow ? I do not know, but this is a bit artificial
way to do this computation.
You could do
qfbcornacchia(1,p)

((or if you want to reuse sqrtm1:
[M,V]=halfgcd(sqrtm1,p);
V[2]+I*M[2,1]
which is very fast but quite specific to this case.
))

I do not know what is the right way to compute this GCD.

Cheers,
Bill.