![]() |
|
|
#133 | |
|
Nov 2003
22×5×373 Posts |
Quote:
The sample number is 11^223 + 9^223. The factor bases both have 1.8 million primes [Bound ~ 29 million]. Both sides use 2LP with LPB = 735 million. Total time to process 100501 : 7.653997 Total sieve time = 3.383201 Int line: 0.291134 Alg line: 0.255823 Int vector: 1.416120 Alg vector: 1.420123 Total resieve time = 0.966726 Int resieve: 0.645097 Alg resieve: 0.321629 Trial Int time: 0.038185 Trial Alg time: 0.899352 Find startpts time: 1.231500 Alg scan time: 0.413940 Lattice reduce time: 0.000000 QS/Squfof time: 0.485843 Prepare regions time: 0.137046 Inverse time = 0.421117 Prime Test time = 0.141093 Meaning: The "100501" means that the 100501'st prime in the factor base in being used as the special Q. I line sieve the smallest primes; those that are guaranteed to take several hits in along a single line within the lattice. The output gives the time to run the line sieve for both sides, the vector sieve for both sides, the time to do the resieve, the time to find the starting points in the lattice for this special q, the time to scan the lattice for potential smooth values after sieving, the time running QS to split the cofactors, the time to compute the boundaries of the sieve region for all of the primes, the time spent computing modular inverses during initialization and the time spent prime testing cofactors before they get split by QS. Total time to run this special Q: 7.6 seconds Here is the ouput count for special Q from 100001 to 100003: 100503 260 0 12 9 10 13 51 49 56 60 This shows the last q processed, the total relations, the FF, the FP, PF, PPF, FPP, PP QPP PPQ PPPP where e.g. FPP means the left side was fully factored, the right side had 2 LP, QPP means the left side had 1 LP, the rhs had 2LP etc. |
|
|
|
|
|
|
#134 | |
|
Nov 2003
22×5×373 Posts |
Quote:
|
|
|
|
|
|
|
#135 | |
|
"Ben"
Feb 2007
22×3×293 Posts |
Quote:
Resieving is also vectorized. Actually most of the sieve steps are vectorized. I've always wondered how much of the vectorization I've developed is transferrable to NFS. I've never had time to understand nfs well enough to find out. |
|
|
|
|
|
|
#136 |
|
Sep 2009
22·523 Posts |
|
|
|
|
|
|
#137 |
|
Tribal Bullet
Oct 2004
3·1,181 Posts |
Roll-up of links to relevant code:
Batch factoring in Msieve (this works pretty nicely but hasn't been tried on truly large problems) My modifications to Bob's NFS siever (uses 3 large primes, uses GGNFS relation output, uses optimized SIQS, includes MSVC project file, includes general cleanup). Note that the modifications are not enough to allow sieving for large problems, the statically sized arrays of things are not big enough to hold tons of sieve reports and I got a crash the one time I tested it. You will need GMP or MPIR for the new code. There are many sources for inline assembler, Msieve includes a fair amount of it and we have several experts here who can help. Brian Gladman maintains the MSVC projects that allow many of our factoring libraries and applications to compile in Visual Studio. You will need a fairly recent version of the tools though. |
|
|
|
|
|
#138 | |
|
Nov 2003
22·5·373 Posts |
Quote:
one (bad) bug. clockticks.c needs to save & restore the eax & edx registers. The given code does not. |
|
|
|
|
|
|
#139 | |
|
"Robert Gerbicz"
Oct 2005
Hungary
2×743 Posts |
Quote:
Say you know H,H1 and you want to get the prime divisors set of N2: Code:
N the prime divisors sets: H / \ / \ N1 N2 H1 H2 so H-H1 is in H2 that means that you need to consider only H1 instead of the larger H, when you want to get the prime set of N2, which makes the algorithm faster. Of course if you get G, then H2=G union (H-H1) [here this is a disjoint union!]. |
|
|
|
|
|
|
#140 | |
|
Tribal Bullet
Oct 2004
3×1,181 Posts |
Quote:
Robert, upon reflection I use Bernstein's batch GCD and not his batch factoring algorithm, as a preprocessing step to reject most relations before trying to use expensive methods to compute their largest few factors. The code can efficiently find the 1-2% of relations whose unfactored part has alll factors less than a large bound, allowing QS variants to effectively run 100x faster. But of course there's a limit to how large that bound can be, which controls the size of the input batch. Last fiddled with by jasonp on 2019-07-14 at 13:43 |
|
|
|
|
|
|
#141 | |
|
Nov 2003
22×5×373 Posts |
Quote:
I know which lattice points have norms that are potentially smooth by the value of the accumulated logarithm. I therefore know (approximately) how large the cofactor will be after removal of the factor base primes. I only split cofactors that have a chance to be the product of two primes, each larger than the largest factor in the factor base and smaller than the large prime limit. One can, of course, extend this to 3 primes. Sometimes after I divide out the FB primes the cofactor IS a little too big to bother to try splitting it, but this is rare. What does your batch GCD code add to this procedure? How does it make it faster? Doesn't Bernstein's method require having ALL prime factors known in advance? There are a LOT of large primes (larger than the factor base) that need to be known. [e.g. for 31 bit large primes it needs another ~ 1/2Gbyte of storage] This is a lot of storage. Doesn't it need to multiply all of the candidates together? That is going to be a very large integer, requiring yet more space......With a sieve area of ~200M and a 2% potential success rate, that is 4 million norms, each with ~4-5 limbs..... another 100Mbytes or so. NFS is already strained for space. When using SIQS or squfof with 3 primes, does your extension apply SIQS directly to the 96-bit (or so) cofactor or does it try to pull out one of the primes first? If so, how? And the storage problem only gets worse with 3LP. I plan to completely re-write my sieve code. I will reuse portions of it of course. BTW, two simple optimizations that I should have done years ago: When computing the sieve start points, one must compute a modular inverse for each prime. [There is no 'SI' variant for NFS]. However, when computing 1/a, 1/b, 1/c mod q it is faster to compute 1/(abc) then multiply by bc, ac, and ab. etc A single precision multiplication is much faster than a mod inverse! [It is clear brain damage that I did not put this in the original code] Similarly, when dividing out known factor base primes that divide a given norm one can compute N/(a*b) rather than N/a followed by (N/a)/b. provided ab fits in a single uint64. [again, more brain damage] The biggest impact that I foresee will come from eliminating the sieve boundary computations in my current code , going to a linear array to store lattice points, and improving the bucket management. If you look at the sample output that I gave my code spends only 6% of the time running QS and less than 2% checking primality of cofactors. While my cofactor splitting can be improved, the payoff will be less than a 4% improvement even if speed doubles. BTW, bsquared's ECM code looks awesome, but I will need to port the gcc assembler to MASM, which means learning the gcc syntax. I run windoze on my home PC for a variety of reasons. |
|
|
|
|
|
|
#142 | |
|
Nov 2003
746010 Posts |
Quote:
BTW, is mpir.lib available for 64 bit windoze? I may switch to MPIR from my current 32-bit MP code, or I may port my 32 bit MP code to 64 bits. This will come AFTER the other work. |
|
|
|
|
|
|
#143 | |
|
Nov 2003
22·5·373 Posts |
Quote:
I prefer not to spend the big $$ to buy a newer VS compiler. I have looked at Brian's github repository. I see a lot of updated files, but no obvious download of a Windows .lib file. Do I need to download the entire source and compile it? Do I need to download GMP first? |
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Factoring Mersenne numbers | paulunderwood | Miscellaneous Math | 18 | 2017-08-27 14:56 |
| Factoring Big Numbers In c# | ShridharRasal | Factoring | 10 | 2008-03-20 17:17 |
| Question about factoring code | Peter Nelson | Software | 9 | 2005-03-30 18:28 |
| Factoring Fermat Numbers | Axel Fox | Software | 14 | 2003-07-04 18:57 |
| Questions about SSE2 code and Factoring | Joe O | Software | 2 | 2002-09-13 23:39 |