AminetAminet
Search:
84451 packages online
About
Recent
Browse
Search
Upload
Setup
Services

misc/math/aYaSieve.lha

Mirror:Random
Showing:generic
No screenshot available
Short:Sieve of Eratosthenes prime test
Author:madmax at uni-paderborn.de (Dirk Held)
Uploader:madmax uni-paderborn de (Dirk Held)
Type:misc/math
Version:2.01
Replaces:misc/math/aYaSieve
Architecture:m68k-amigaos
Date:1997-11-18
Download:http://aminet.net/misc/math/aYaSieve.lha - View contents
Readme:http://aminet.net/misc/math/aYaSieve.readme
Downloads:4839

                             AndYetAnotherSieve
                             ~~~~~~~~~~~~~~~~~~

                    (the fastest prime-sieve at this time)
                          (at least on the Amiga)

On  my system (A4k40+FPU+MMU,25 MHz, 16 MB RAM) it tests primes upto

240.000.000 in about 106.4 seconds ! (+ 9.2 counting)
100.000.000 in about  41.1 seconds,  (+ 3.9    "    )
 10.000.000 in about   3.5 seconds,  (+ 0.4    "    )
  1.000.000 in about   0.3 seconds,  (+ 0.04   "    )

This Version isn´t faster, or has more features than the previous Version. I
just merged the two Versions (68000/680x0) into one Soure and removed by the
way a stupid bug in the 680x0-Version ...-(

well..i could save about 6%, but the Size of the Program would be about 38 KB...
More 3% are possible with a Program-size of 540 KB.....;-)

The time cost is about O(n*1.35) = O(n), this means, if the Programm calcs to a
10 times higher Number, the Program needs 13.5 times longer. The Runtime seems
to be slightly superlinear. The Program needs about Number DIV 16 Bytes Memory.

Usage:

aYaSieve NUMBER/N,DISPLAY/S,TEST/S,LEN=LINELEN/K/N,HELP/S,FROM/K/N,DUMP/K/F

        HELP        prints Usage
        NUMBER      to test 2..Number for primality (Number < 2^31)
        DISPLAY     all Primes are printed
        TEST        enter Numbers to factorize
        LEN  <num>  Linewidth
        FROM <num>  prints Primes starting with n
        DUMP <file> saves the BitField to file, if NUMBER was given, or
                    loads it from the file, if no number was given.

aYaSieve isn´t completely written in *pure* Amiga Modula-II anymore. 
I used the builtin Assembler where appropriate.
"Amiga Modula-2 Compiler 68881, 4.301d, 19.06.94, © AMSoft"
Marcel Timmermans Cyclone-Compiler should do, too (with some slightly
modifications of the Import-List and the Compiler-Options).

This Program runs on every Amiga with Kick 2.0
(aYaSieve.000 for the 68000 and aYaSieve.020 for the 68020/30/40/60)

The Source is included now.

It is strictly ALLOWED to produce any aYaSieve-like program without
my permission :). (But who really cares about it ? Proggis like these are`n
usefull to factorise LARGE numbers (i.e. 100 or more digits), so why bother.
Try KillPrime on Aminet instead (Hi Brice:).

                          *IMPORTANT*

If you have questions drop me a mail.

Hellos and Greetings going out to:

    - Brice Allenbrand, he forced me, to work even harder....(puuh)

    - Bill J. Phillips (he tested my Program (Version 1.1) on his A3000/60
      its about 3 times faster then.

    - Larry Deering, for the inspiration he gave me, with his BlackKeySieve,
      which he programmed on his urgh mhmm gnaagnagna .... PeeCee. It may be
      even faster than mine (8-(. Although i can´t test or believe it yet,
      because i haven´t the Source to port it to the Amiga, nor do i have a
      C-Version of my Proggi, to port it to other Platforms (yet).

    - everyone, who´s able to code a at least 3% faster Version of
      Eratothenes´s Sieve (according to Big-o Notation)

    - those guys, which prefer a REAL 32 Bit (or even 64 (SGI-O^2...)) Maschine,

Aetschi-Baetschis and Buuhs going out to:

     - nobody


Contents of misc/math/aYaSieve.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[generic]                 4384    7456  58.8% -lh5- d338 Nov 17  1997 ayasieve/aYaSieve.000
[generic]                 4207    6632  63.4% -lh5- 1f28 Nov 17  1997 ayasieve/aYaSieve.020
[generic]                 8480   42451  20.0% -lh5- b606 Nov 17  1997 ayasieve/aYaSieve.Mod
[generic]                 1770    3435  51.5% -lh5- 886d Nov 17  1997 ayasieve/aYaSieve.ReadMe
[generic]                  441    1389  31.7% -lh5- 3765 Nov 17  1997 ayasieve/Init.Mod
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total         5 files   19282   61363  31.4%            Nov 18  1997

Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>