Post Reply 
Summation based benchmark for calculators
08-12-2021, 08:00 AM
Post: #227
RE: Summation based benchmark for calculators
ThetaCalc, an RPN calculator app running on iOS which can be programmed in JavaScript, produced the following result for n = 1000000 on an iPhone 12:

HP museum benchmark (n = 1000000)
Sum = 1395612.1587253837
Time = 0.189 seconds

I don't know, however, whether the app fits into one of the given categories.

Here is the program:

Code:
function benchmark(n) {
  let s = 0;
  for (let i = 1; i <= n; i++) {
    s += Math.pow(
      Math.exp(
        Math.sin(
          Math.atan(i))), 1/3);
  }
  return s;
}

const n = 1000000;
startTimer();
let s = benchmark(n);
stopTimer();
println(`HP museum benchmark (n = ${n})`);
println(`Sum = ${s}`);
printlnElapsed();
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Summation based benchmark for calculators - Felix Stehli - 08-12-2021 08:00 AM



User(s) browsing this thread: 35 Guest(s)