Click here to Skip to main content
15,906,645 members

Comments by Member 15338211 (Top 5 by date)

Member 15338211 30-Aug-21 8:41am View    
Nice articles! I'm using a bitfield of odd numbers as a moving sieve for prime generation. I didn't think of a compression using a wheel as you did before, but it might be considerably slower due to all the branches.
Member 15338211 28-Aug-21 7:34am View    
Yes, public library under MIT license. There is quite a lot of number-theoretic algorithms that are not to be found implemented efficiently anywhere (with currently available libraries being at least 8x slower than possible). I'm implementing it with usage of assembly and compiler intrinsics for different platforms. I try to avoid allocations whenever possible, so that it can be used on embedded systems without global allocators too.
Member 15338211 28-Aug-21 5:47am View    
Modified Pollard's Rho algorithm with GCD skipping, Brent's cycle finding and Montgomery multiplication + Miller-Rabin deterministic prime 5-test with precomputed magic tables for all 64-bit base 2 SPRP pseudoprimes.
Member 15338211 27-Aug-21 12:20pm View    
@armagedescu I'm aware of that. Still, I want my function to be constexpr. I don't have any problems with implementing it, I just can't decide on the API. The library is not just for me - but for general use, that's why API is important. I strive for it to be safe, easy and intuitive to use.
Member 15338211 27-Aug-21 12:01pm View    
Note: *different* prime factors. Accepting some kind of output_iterator is one of the possibilities - but it requires more from the user of the library, making the call to the function possibly unsafe. What I ask here, is returning the result as 136B stack object something very problematic in any possible context? Should the object be compressed, or values returned in other ways? (And no, I'm not using basic factorization algorithms, so found factors won't be in order by default).