primesieve for Mac OS X 3.6

primesieve for Mac OS X 3.6

License:Freeware

Size:6.2 MB

Date Added:28 November, 2012

Author: Kim Walisch

Category: Multimedia & Graphics  >  CAD


Advertisement

   


primesieve uses the segmented sieve of Eratosthenes with wheel factorization, this algorithm has a complexity of operations and uses space.

Segmentation is currently the best known practical improvement to the sieve of Eratosthenes. Instead of sieving the interval [2, n] at once one subdivides the sieve interval into a number of equal sized segments that are then sieved consecutively. Segmentation drops the memory requirement of the sieve of Eratosthenes from to . The segment size is usually chosen to fit into the CPU's fast L1 or L2 cache memory which significantly speeds up sieving. A segmented version of the sieve of Eratosthenes was first published by Singleton in 1969 [1], Bays and Hudson in [2] describe the algorithm in more detail.

Wheel factorization is used to skip multiples of small primes. If a kth wheel is added to the sieve of Eratosthenes then only those multiples are crossed off that are coprime to the first k primes, i.e. multiples that are divisible by any of the first k primes are skipped. The 1st wheel considers only odd numbers, the 2nd wheel (modulo 6) skips multiples of 2 and 3, the 3rd wheel (modulo 30) skips multiples of 2, 3, 5 and so on. Pritchard has shown in [3] that the running time of the sieve of Eratosthenes can be reduced by a factor of if the wheel size is but for cache reasons the sieve of Eratosthenes usually performs best with a modulo 30 or 210 wheel. Sorenson explains wheels in [4].

Additionally primesieve uses Tom+is Oliveira e Silva's cache-friendly bucket list algorithm if needed [5]. This algorithm is relatively new it has been devised by Tom+is Oliveira e Silva in 2001 in order to speed up the segmented sieve of Eratosthenes for prime numbers past 32 bits. The idea is to store the sieving primes into lists of buckets with each list being associated with a segment. A list of sieving primes related to a specific segment contains only those primes that have multiple occurrence(s) in that segment. Whilst sieving a segment only the primes of the related list are used for sieving and each prime is reassigned to the list responsible for its next multiple when processed. The benefit of this approach is that it is now possible to use segments (i.e. sieve arrays) smaller than without deteriorating efficiency, this is important as only small segments that fit into the CPU's L1 or L2 cache provide fast memory access.

primesieve is written entirely in C++ and does not depend on external libraries [6], it compiles with every standard compliant C++ compiler. Its speed is mainly due to the segmentation of the sieve of Eratosthenes which prevents cache misses when crossing off multiples in the sieve array and the use of a bit array instead of the more widely used byte (boolean) array. These are the optimizations I use in my implementation:

Uses a bit array with 30 numbers per byte for sieving
Pre-sieves multiples of small primes ? 19
Starts crossing off multiples at the square
Uses a modolo 210 wheel that skips multiples of 2, 3, 5 and 7
Uses specialized algorithms for small, medium and big sieving primes
Processes multiple sieving primes per loop iteration to increase instruction-level parallelism
Parallelized (multi-threaded) using OpenMP
To browse the latest primesieve source code online visit the 'Source' tab.
Release notes: New Release
TE Built with Intel C++ Compiler 12.1 (Composer XE 2011)
TE Minor speed up for small sieving primes ~ 5%
[ primesieve for Mac OS X full changelog ]

Systems: Mac OS X

Tags: Eratosthenes sieve   prime number sieve   filter prime number   Eratosthenes   prime number   sieve  

Reviews of primesieve for Mac OS X

- required fields
     


More Downloads of Kim Walisch

1. primesieve x64 3.6 primesieve x64 uses the segmented sieve of Eratosthenes with wheel factorization, this algorithm has a complexity of operations and uses space. Segmentation is currently the best known practical improvement to the sieve of... DetailsDownload  - Screenshot

2. primesieve for Linux 3.6 primesieve uses the segmented sieve of Eratosthenes with wheel factorization, this algorithm has a complexity of operations and uses space. Segmentation is currently the best known practical improvement to the sieve of Eratosthenes.... DetailsDownload  - Screenshot

Related Downloads

1. primesieve for Linux 3.6 primesieve uses the segmented sieve of Eratosthenes with wheel factorization, this algorithm has a complexity of operations and uses space. Segmentation is currently the best known practical improvement to the sieve of Eratosthenes. Instead of... DetailsDownload  - Screenshot

Tags: Eratosthenes sieve   prime number sieve   filter prime number   Eratosthenes   prime number  

2. Mathematics Suite 1.0.0 3 Maths Applications for 1 Price: Factor Calculator, Prime Number Calculator, and Primality Tester All applications feature: Dream Tarequency no-frills style as described by Download.com editor,Recommended on The Math Forum @ Drexel (University)... DetailsDownload 

Tags: prime number calculator   single click   prime numbers   prime number   number calculator  

3. Fssplit 2.10 This program breaks down the number of prime factors. The maximum length of the folding number is 17 characters. Unfolding of numbers into prime factors are commonly used in cryptography, among others, the various types of security breaches. An... DetailsDownload  - Screenshot

Tags: prime number   prime factor   break down number   prime   factor  

4. Prime95 27.9 B 1 Prime95 is a program designed to be used to find Mersenne Prime numbers. Mersenne numbers can be proved composite (not prime) by either finding a factor or by running a Lucas-Lehmer primality test. Prime numbers have long fascinated amateur and... DetailsDownload  - Screenshot

Tags: prime number   mersenne prime   find prime   mersenne   prime  

5. EpiFire for Mac OS X 2.73 EpiFire is a small, easy to use, handy application specially designed to help you simulate epidemics on contact networks. Now, you can make use of this accessible and useful tool to perform the epidemic simulations you want. DetailsDownload 

Tags: simulate epidemics   epidemics simulation   contact networks analysis   Simulate   simulation   analysis  

6. primesieve for Linux 3.6 primesieve uses the segmented sieve of Eratosthenes with wheel factorization, this algorithm has a complexity of operations and uses space. Segmentation is currently the best known practical improvement to the sieve of Eratosthenes. Instead of... DetailsDownload  - Screenshot

Tags: Eratosthenes sieve   prime number sieve   filter prime number   Eratosthenes   prime number   sieve  

Popular Downloads

1. Mini CAD Viewer 2.9.1 Mini CAD Viewer is a compact free CAD viewer.It is designed to be easy to use, even for those with no prior CAD experience. It allows you to move and zoom in/out drawing view at will. It carries "thumbnail" view, which allows users... DetailsDownload  - Screenshot

Tags: Cad Viewer   autocad Viewer   dwg viewer   dxf viewer  

2. Additional AutoCAD Fields - AutoField 2.1 AutoCAD Fields can be inserted in any kind of text (except tolerances) in AutoCAD, including text in table cells, attributes, and attribute definitions. AutoField adds many efficient fields to AutoCAD. You can import a specific cell of the Excel... DetailsDownload 

3. My Home Designer v6.0 English My Home Designer (MHD6.0) enables everybody to do 3D home design and decoration. With MHD, you can build your own 3D house, install doors and windows, layout furniture, try different color schemes, and save your work to share ideas with friends.... DetailsDownload  - Screenshot

Tags: home designer   3d   mhd   furniture   design   layout   home   find   designer   wwwyfcadcom  

4. MiniMagics Free Stl Viewer 2.0 As a free .STL viewer, you can share MiniMagics with your sales force, customers and the people on the shop floor. You'll be amazed how easy and efficient project communication becomes with MiniMagics. Just load an .STL, make annotations and... DetailsDownload  - Screenshot

Tags: stl viewer   Stl Viewer Free   Stl File Viewer   Stl File   Stl Import  

Top Software

New Software

Top Search

Latest Reviews