On 2/17/2025 12:52 PM, Franz Marx wrote:
Hello all friends of Open Rexx!
I wrote a Rexx-Program to calculate Primes to use for benchmarking
1. Object Rexx Version`s performance
2. Operation System`s performance
3. the Hardware performance
My Rexx-Program works really simple (I'm not a mathematician)
There are a couple of versions of a prime number generating program here
<https://rosettacode.org/wiki/Sieve_of_Eratosthenes#ooRexx> that might
interest you. The second one is optimized a bit over the first which is
a more strictly correct solution of the stated problem. In any case, 1)
the highest number to check is an argument as opposed to your program
which finds the first N primes and 2) all of the primes are listed(!)
which is clearly NOT desirable in a benchmark program. For what its worth.
1. if i want to evaluate e.g. the first 4 million primes,
i create a STEM-Table for 4 million numbers
2. in the first 2 Prime-Table-positions number 2 and 3 are preset
3. beginning with 2nd Prime-Table-position i evaluate in a
Do-Loop by 2 to find out our next possible prime-number,
because it must be an odd number.
4. if next possible prime gives a division-remainder of 0
with any of the primes before, it is not a prime and
we have to add 2 to the last evaluating number
5. we can shorten evaluating the new number,
if the square of any prime before in our table is higher
than our new number to test, than it must be a new prime
Perhaps there is some interest in benchmarking your systems.
Yours sincerely
Franz J. Marx
Bahngasse 19
2391 Kaltenleutgeben
Austria
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel
--
Gil Barmwater
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel