[mpir-devel] crt codes

2009-11-15 Thread gerrob
Read on http://gmplib.org/tasks.html that you/gmp needs an implementation for Chinese Remainder Theorem, on googlegroup I've uploaded two codes that solves it: mpz_crt_coprime works for pairwise coprime modulus, and mpz_crt works in general. One timing: crt_coprime solves the x==i mod prime(i) fo

[mpir-devel] new nextprime code

2009-11-14 Thread gerrob
I've uploaded a new code on google group. It is using remainder tree to speedup the sieving, and now it is sieving up to about log2(n)^2. It means a speedup by a factor of two for large "random" input (here random means that nextprime(n) isn't very close to n). For totally random inputs it is fast

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

2009-06-21 Thread 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. I've attached a first attempt at an mpn version of Robert Gerbicz' fast perfect power test code,

[mpir-devel] Fast factorial code for large n value

2009-06-19 Thread gerrob
Hi! For factorial routine today I've written a fast solution that is faster for large n than gmp/mpir's currently code, if n is about 1 million or larger. For n=10^6: my code takes 1.7 sec., gmp's code: 2.3 sec. For n=10^7: my code takes 27 sec., gmp's code 45 sec. For my code see the google gr

[mpir-devel] Fast wagstaff2.c code

2009-06-11 Thread gerrob
Hi! I've uploaded a new code (wagstaff2.c) in google groups to test Wagstaff numbers by Anton Vrba's conjecture. It's faster than wagstaff.c from Jeff Gilchrist because I'm using bitshift+bitmask instead of the expensive divisions. For example for q=83339 it took me 127 sec. while the old code t

[mpir-devel] Re: Fast computation of binomial coefficients

2009-04-27 Thread gerrob
On ápr. 27, 03:22, Bill Hart wrote: > Did you receive any feedback > on the code from them? As I remember at the same time there were 4 codes from 3 peoples to speed up the computation of binomial coefficients. What hasn't been done is to choose the best one from 5 codes (including original) fo

[mpir-devel] Fast computation of binomial coefficients

2009-04-26 Thread gerrob
Hi! I've uploaded two codes on the google group, computation of binomial coefficients in a much faster way than the currently used in mpir/gmp, using binary splitting (the idea is similar if we would use product tree). In gmp there are two functions for this: mpz_bin_ui and mpz_bin_uiui. Note tha

[mpir-devel] Re: Speedup the perfect power test

2009-04-23 Thread gerrob
I've made some changes to the code. There are some new ideas speeding up the algorithm for very large/ critical input, but now I don't see any further possible improvements. See the new code at google group, newperfpow2.c The old code is still there. --~--~-~--~~~---~-

[mpir-devel] Speedup the perfect power test

2009-04-22 Thread gerrob
Hi! I've written a much faster code than the currently used in gmp/mpir. Million of bits numbers can be tested in about 1 sec, but slower by a factor of 2 up to about 1000 bits numbers on my pc. Tested a lot, it should be good. You can use it for whatever you want. I've sent it to Torbjorn Granlu