PackageDescription: FactorialPrimeSwingContest


Factorial Prime Swing Contest

Last published: April 28, 2019 by 'nice'

Defines 1 Classes
Extends 6 Classes


This is Nicolas Cellier answer to Paul Bauman factorial contest.
It is using a divide and conquer prime swing algorithm.
See comment of class FactorialPrimeSwing.

The benchmark on my mac mini is:

| t0 t1 |
ObjectMemory garbageCollect.
t0 := Time millisecondsToRun: [1 to: 3000 do: [:i | i factorial]].
ObjectMemory garbageCollect.
t1 := Time millisecondsToRun: [1 to: 3000 do: [:i | i primeSwingFactorial]].
^Array with: t0 with: t1 with: 1 - (t1 / t0) * -100.0

#(41372 4952 -88.0306)
#(40174 4858 -87.9076)
#(41288 4926 -88.0692)