This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
benchmarks:four_op_and_accuracy [2013/09/13 15:49] pier4r |
benchmarks:four_op_and_accuracy [2013/09/13 15:52] (current) pier4r |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Calc bench: Four operators (FO) ====== | ||
+ | **The idea** \\ | ||
+ | There are a lot of benchmarks for calculators and computers, but so far the popular ones are: | ||
+ | * [[benchmarks: | ||
+ | * [[benchmarks: | ||
+ | * [[benchmarks: | ||
+ | * [[benchmarks: | ||
+ | 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 " | ||
+ | |||
+ | 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)/ | ||
+ | } | ||
+ | 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|/ | ||
+ | |||
+ | **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' | ||
+ | 1' | ||
+ | |||
+ | 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" | ||
+ | </ | ||
+ | |||
+ | ===== Speed section ===== | ||
+ | |||
+ | ==== Physical calculators ==== | ||
+ | |||
+ | === n is 100 === | ||
+ | - HP 50g userRPL | ||
+ | * 1.06 @75mhz | ||
+ | * Res: 5050 | ||
+ | * code: ((< | ||
+ | << | ||
+ | @n | ||
+ | 0 @sum | ||
+ | \-> | ||
+ | n | ||
+ | sum | ||
+ | << | ||
+ | PUSH | ||
+ | -105 SF | ||
+ | |||
+ | 1 n | ||
+ | FOR a | ||
+ | a DUP * @a^2 | ||
+ | \v/ @sqrt(a^2) | ||
+ | ' | ||
+ | NEXT | ||
+ | sum | ||
+ | |||
+ | POP | ||
+ | >> | ||
+ | >> | ||
+ | < | ||
+ | |||
+ | === n is 1'000 === | ||
+ | - HP 50g userRPL | ||
+ | * 10.01 @75mhz | ||
+ | * Res: 500500 | ||
+ | * same of entry with n=100 | ||
+ | |||
+ | === n is 10'000 === | ||
+ | - HP 50g userRPL | ||
+ | * 102.093 @75mhz | ||
+ | * Res: 50005000 | ||
+ | * same of entry with n=100 | ||
+ | |||
+ | === n is 100' | ||
+ | |||
+ | === n is 1' | ||
+ | |||
+ | ==== Emulators on mobile/ | ||
+ | |||
+ | === n is 100 === | ||
+ | |||
+ | === n is 1'000 === | ||
+ | |||
+ | === n is 10'000 === | ||
+ | |||
+ | === n is 100' |