05-23-2023, 05:06 PM
The code below gets a lower score every time I run it on my Numworks N110 with OS 20.4.0
The code is converted from a C program at:
https://www.thimet.de/CalcCollection/Cal...mance.html
BTW, the formula he gives for the index is for one loop only. To get the numbers he shows in his results table, the formula is
P=34 / T * LOOPS
Run 1
0.8809818999686783
Loops: 5000
Time: 6.045 seconds
Index: 28122.42
Run 2
0.8809818999686783
Loops: 5000
Time: 7.154 seconds
Index: 23762.93
Run 3
0.8809818999686783
Loops: 5000
Time: 7.520 seconds
Index: 22606.38
etc.
The code is converted from a C program at:
https://www.thimet.de/CalcCollection/Cal...mance.html
BTW, the formula he gives for the index is for one loop only. To get the numbers he shows in his results table, the formula is
P=34 / T * LOOPS
Code:
from math import *
from time import *
def thimet():
t=monotonic()
loops=5000
for i in range(loops):
r0=10
while r0>0:
x=r0
x+=1
x-=4.567E-4
x+=70
x-=69
x*=7
x/=11
r0-=1
x=log(x)
x=sin(x)
x=sqrt(x)
x=sqrt(x)
print(x)
t=monotonic()-t
print("Loops:",loops)
print("Time: {:.3f} seconds".format(t))
print("Index: {:.2f}".format(34/t*loops))
Run 1
0.8809818999686783
Loops: 5000
Time: 6.045 seconds
Index: 28122.42
Run 2
0.8809818999686783
Loops: 5000
Time: 7.154 seconds
Index: 23762.93
Run 3
0.8809818999686783
Loops: 5000
Time: 7.520 seconds
Index: 22606.38
etc.