Post Reply 
Summation based benchmark for calculators
04-22-2021, 06:33 PM (This post was last modified: 04-30-2021 09:41 PM by Guenter Schink.)
Post: #221
RE: Summation based benchmark for calculators
I think we have new champion -- by quite a margin

Prime G2 Beta 2.1.14549 using Python
Code:
#PYTHON name
from math import *
import sys
import hpprime
t=hpprime.eval("time")
c=int(sys.argv[0])
print()
print("Exponent = ",c)
print("Iterations = ", 10**c)
a=0
for i in range(1, 10**c+1):
    a=a+pow((e**(sin(atan(i)))),1/3) 
print("Time (sec) = ",round(hpprime.eval("time")-t,4))
print("Sum = ",a)
#end
Export sums(c)
Begin
  PYTHON(name, c);
End;

From the Home screen invoke this Python program with sums(?)

where "?" question mark has to be replaced by the exponent which denotes the magnitude
  • 3 for 1000
  • 4 for 10 000
  • 5 for 100 000
  • 6 for 1 000 000

Output will be the exponent, the resulting number, the time and the sum. E.g.
3
1000
0.036 sec
1395.3462877433426


Code:
Results:
3       1 000  0.036 sec     1395.3462877433426
4      10 000  0.159 sec    13955.857904429155
5     100 000  1.425 sec   139560.9761410521
6   1 000 000 14.046 sec  1395612.158725383

I think that's quite impressive specifically when compared with the values for native PPL.

Günter

Edit: put the timing into the Python code rather than using TEVAL
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Summation based benchmark for calculators - Guenter Schink - 04-22-2021 06:33 PM



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