![]() |
|
|
#210 |
|
"Mark"
Apr 2003
Between here and the
22·7·227 Posts |
I have a faster version of the mulmod for PPC that does not save/restore registers. It should be about 10%-15% faster. I'll investigate doing the same for expmod, but the gain would be much smaller.
|
|
|
|
|
|
#211 | ||
|
Mar 2003
New Zealand
13×89 Posts |
This version has a SSE2 powmod function, it runs about 7% faster on my P4/Celeron.
Quote:
Quote:
|
||
|
|
|
|
|
#212 |
|
Mar 2003
New Zealand
13×89 Posts |
This one has rogue's improved ppc64 mulmod function, and some small improvements to the SSE2 powmod function.
For those of you working on other bases, it is probably much faster to use sr5sieve compiled for the base in question instead of using srsieve. This is because there have been many improvements in sr5sieve that I haven't got around to adding to srsieve. You will still need to use srsieve for factors smaller than the largest k value, but once that is done use the srsieve -aC options to write the output as an ABCD file and create a checkpoint file, rename the ABCD file it to sr<base>data.txt, and add a range starting at zero to sr<base>work.txt. sr<base>sieve should then continue from the checkpoint file. I can compile a Windows or Linux binary for any base you need, or if you have GCC and make then you can do it yourself by changing the definition of BASE in sr5sieve.h, setting the ARCH variable in Makefile, running make, and renaming the resulting sr5sieve executable. |
|
|
|
|
|
#213 |
|
Mar 2003
New Zealand
48516 Posts |
srsieve 0.6.2 fixes a longstanding bug that could cause the list of sequences to be corrupted if two or more were removed from the sieve at the same time. In at least one case this resulted in a sequence being incorrectly removed. Thanks rogue for finding this bug.
This version also includes the improved ppc64 and x86-64 mulmod code. |
|
|
|
|
|
#214 |
|
Mar 2003
New Zealand
48516 Posts |
http://www.geocities.com/g_w_reynolds/sr1sieve/
This sieve is based on sr5sieve. It can only sieve one sequence k*b^n+/-1 at a time, but should be somewhat faster than srsieve or sr5sieve in this case. It might be useful for some of you who sieve one sequence separate from the distributed sieving effort. It works with NewPGen format files: sr5sieve -g 331882 200000 500000 will create a NewPGen format file called 331882.txt containing the sequence 331882*5^n-1 for 200000 < n < 500000. Then: sr1sieve -i 331882.txt -o 331882.new -f factors.txt -p 10e12 -P 11e12 will sieve this one sequence from 10 to 11 trillion, recording the new factors in factors.txt, and saving the updated sieve file to 331882.new. |
|
|
|
|
|
#215 |
|
Jun 2003
158210 Posts |
Did you get my PM? Did you understand the method I described? Any progress?
|
|
|
|
|
|
#216 | |
|
Mar 2003
New Zealand
22058 Posts |
Quote:
Implementing it seems like a lot of work, it is much more complicated than the existing algorithm. I am going back to school this year, but will be writing essays rather than thinking about maths, so I doubt I will be able to start making progress until next (southern) summer unless someone else can help with writing code. |
|
|
|
|
|
|
#217 | |
|
Jun 2003
2·7·113 Posts |
Quote:
http://math.scu.edu/~eschaefe/crylec.pdf If you still can't get it, I would wait for school to get over and then buy and read a good number theory book. Alternatively, I can write the code (time permitting), but you will first have to help me convert your program to Visual C++, so I can compile your program. I am not so sure about the Lib structure of gcc. Thanks! |
|
|
|
|
|
|
#218 | ||
|
Mar 2003
New Zealand
13×89 Posts |
Quote:
Quote:
However some of the library functions used are not in the standard C library, but are available on GNUish systems. getopt_long() is one I can think of. I don't think it will be too hard to find replacements for these, I'll have a look. Here is a description of the algorithm used by sr5sieve. In version 1.4.18, R={2,3,4,5,8} and so Q=120: Code:
[Init]
Let R={2,...} be a set of small prime powers
Let Q=lcm(R)
Input a list S of sequences k*b^n+c, where b is fixed and c is in {-1,+1}
For each s = k*b^n+c in S
Let T[s] be the list of subsequences (k*b^d)*(b^Q)^m+c, where 0 <= d < Q
Let N0,N1 be bounds N0 <= n <= N1 on all k*b^n+c in S
Let K be an upper bound k <= K on all k*b^n+c in S
Input P0,P1 satisfying K < P0 < P1
[Main loop]
For each prime p in P0 < p < P1
Let Z be an empty list of candidate subsequences
Let r be the greatest divisor of Q satisfying p = 1 (mod r)
Let X = (1/b)^((p-1)/r) (mod p)
For each sequence s = k*b^n+c in S
If -c*k or -c*k*b is a quadratic residue with respect to p
If (r < 3)
Append T[s] to Z
Else
[Check whether -c*k*b^d is an r-th power residue with respect to p]
Let Y = (-c*k)^((p-1)/r) (mod p)
For each subsequence t = (k*b^d)*(b^Q)^m+c in T[s]
If X=Y^d (mod p)
Append t to Z
If (|Z| > 0)
[Baby-steps giant-steps]
Let M0 = floor(N0/Q)
Let M1 = floor(N1/Q)
Let G = sqrt((M1-M0)/|Z|)
Let B = ceil((M1-M0)/G)
Let H be an empty hashtable
[Baby steps]
For each j in 0 <= j < B
Insert (j, (b^Q)^(j+M0) (mod p)) into H
For each subsequence z = (k*b^d)*(b^Q)^m+c in Z
Let A[z] = -c/(k*b^d) (mod p)
If (j, A[z]) is in H
Report that p is a factor of k*b^(Q*(M0+j)+d)+c
[Giant steps]
For each i in 0 < i < G
For each subsequence z = (k*b^d)*(b^Q)^m+c in Z
A[z] <-- A[z]*(1/b)^(Q*B) (mod p)
If (j, A[z]) is in H
Report that p is a factor of k*b^(Q*(M0+iB+j)+d)+c
Code:
If (r < 3)
Append T[s] to Z
Code:
If (r < 3)
If -c*k is a quadratic residue with respect to p
For each t = (k*b^d)*(b^Q)^m+c in T[s] such that d is even
Append t to Z
If -c*k*b is a quadratic residue with respect to p
For each t = (k*b^d)*(b^Q)^m+c in T[s] such that d is odd
Append t to Z
Last fiddled with by geoff on 2007-01-30 at 02:38 Reason: X=Y^d (mod p), not X=Y^d |
||
|
|
|
|
|
#219 |
|
Jun 2003
2×7×113 Posts |
Geoff when I try to compile your program using VC++, it says some of the
# include <...> files not found. I do not know what to do for them. I can post the errror messages I get, if you want. May be I am not using the correct source, could you post a link to the correct source. Thanks |
|
|
|
|
|
#220 | |
|
Mar 2003
New Zealand
13·89 Posts |
Quote:
I expect <getopt.h> is missing. Since command line options are optional for sr5sieve, to get it to compile you can just delete the whole while() loop at the top of main(). PM me with any other errors. |
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Very Prime Riesel and Sierpinski k | robert44444uk | Open Projects | 587 | 2016-11-13 15:26 |
| Sierpinski/ Riesel bases 6 to 18 | robert44444uk | Conjectures 'R Us | 139 | 2007-12-17 05:17 |
| Sierpinski/Riesel Base 10 | rogue | Conjectures 'R Us | 11 | 2007-12-17 05:08 |
| Sierpinski / Riesel - Base 23 | michaf | Conjectures 'R Us | 2 | 2007-12-17 05:04 |
| Sierpinski / Riesel - Base 22 | michaf | Conjectures 'R Us | 49 | 2007-12-17 05:03 |