The idea
There are a lot of benchmarks for calculators and computers, but so far the popular ones are:
Nquees tests mainly memory and addition-subtraction operators. The savage one is more complex and math related, but the results are scattered everywhere (Feel free to gather them and do a wiki page about it! Oh, we have already done that) plus it accounts “only” the accuracy 2) so we don't have execution times. The summation test is really simple as well the find primes, even if the latter involves more operators. Moreover a test should be simple, else the userbase won't do it. (See the poor middle square method test )
So, why do we not do a simple benchmark involving the four operations (plus one, the square root) to check both the speed on simple operations and the accuracy? About accuracy, read below.
The pseudocode
input: given an n ---- sum = 0; b = 0; c = 0; for a:=1 to n do { //to avoid optimizations by smarter compilers //trick them with new variables b:= a; c:= a; sum:= sum + squareRoot(b*c)/a; //it's a sum+1 from the simbolic point of view. } print sum
What do we check?
Both times of execution, for a given n, and accuracy (the result should be: n itself) in terms of relative error |result-n|/n. Some arguments on the Savage benchmark has shown that the accuracy measure is not so reliable, so we don't check that (anyway, just report the result).
How to report the results
A result is composed by the following list - the device used plus the language used, eventual overclock, eventual custom firmware and so on. - time elapsed for a given n in seconds (see below) - the result printed - the code used. N options: 100 1000 10'000 for fast implementations 100'000 1'000'000 if the calculator is too slow, or limited, to compute a given n, then report "for n the computation takes too much time". Conversely, if the calculator is too fast to compute a given n, then report "for n the computation takes too little time, i skipped it"