[Shootout-list] Ackermann

Einar Karttunen ekarttun@cs.helsinki.fi
Sat, 18 Jun 2005 11:58:38 +0300


John Skaller <skaller@users.sourceforge.net> writes:
> We need |S| to be larger than an array which can
> practically fit into memory. We know in advance
> that we can easily fit a 65K * 65K array into
> a large machine, that is, it isn't that hard
> to have enough virtual memory to support 32 bits
> of indexing.

Is there any compiler in the shootout which does this? 
As for most realworld apps this behaviour is not desirable as
automatic... 

> So the solution has to be to throw out ackermann.

Please no. Ackerman is a simple test easy to implement in any language.
It works by using a simple rule "don't try to cheat". 
Is that really too hard?

> For a math function:
>
> (a) use floating point, or

One can precompute for interesting floating point values too ;)
Like precompute answer for all floating point numbers representable as a
string shorter than X ;)

Also many programmers couldn't care less about FP performance. In my
real application I don't have any performance critical FP code, but have 
many times integer code which is performance critical.

> (b) have a minimum of 3 integer parameters
>
> This prevents the test being abused by simply
> precomputing an array.

One of the good sides of the shootout was to use simple problems for the
benchmarking. Simple problems by nature can be precomputed. I think that 
enforcing "don't precompute it" is simpler than using more complex
problems. 

- Einar Karttunen