[mpir-devel] Re: Merging Robert Gerbicz' perfect power code

2009-06-21 Thread Robert Gerbicz
Another improvement? would be: use a balanced tree, this is similar to the already posted my binary_splitting routine, that solves it in a recursive way to compute the product of lots of numbers, but since here we need the whole tree (to get the remainders) we can't follow exactly this recursive so

[mpir-devel] Re: Merging Robert Gerbicz' perfect power code

2009-06-21 Thread Bill Hart
Thanks, now I understand. log(p)^2 is about 768 for p = 2^40, so q shouldn't be much bigger than about 2^50, which gives plenty of room. On a 32 bit machine I guess we can happily get to 2^24 bits as log(p)^2 is then about 8 bits. Given the memory usage of the algorithm this is not much of a lim

[mpir-devel] Re: Merging Robert Gerbicz' perfect power code

2009-06-21 Thread Robert Gerbicz
OK, I haven't known about that group, now I'm a member of that also. "I'm slightly confused. Isn't the first q of this form precisely q = 2p + 1? If so, it cannot be as large as your limit." See, we are searching for primes of the form q=2kp+1, if p is prime then it isn't sure that 2p+1 is also p

[mpir-devel] Re: Merging Robert Gerbicz' perfect power code

2009-06-21 Thread Bill Hart
Hi Robert, 2009/6/21 gerrob > > Bill, I don't see your post to me at google group, I think the address > was bad > to mpir list. So I post your last message also with my 3 answers. > And uploaded your new code perfpow.c at google group. We now have a group mpir-dev for discussing implementation