Post Reply 
Numworks Calculator Comparison
09-12-2023, 04:19 AM (This post was last modified: 09-20-2023 11:37 AM by toml_12953.)
Post: #1
Numworks Calculator Comparison
Here's a comparison of the three Numworks models and one TI model. Note that the N0110 is slightly slower than the N0100 but the N0120 is clearly faster than either one of them.
All the benchmarks except Thimet come from this page:
http://www.wiki4hp.com/doku.php?id=start&do=index

Thimet comes from this page:
https://www.thimet.de/CalcCollection/Cal...mance.html

For the Addloop benchmark, I found that, once a program is interrupted, you can't print the values of its variables. Thus, I had to find a way to automatically stop the program after one minute.
I tried to do this but increase the number of calculations as little as possible. After all this benchmark is just supposed to show a single increment operation with no other ops.
If anyone has a less impactful way of doing this, I'd certainly like to know about it!

Here are the results:
https://www.dropbox.com/scl/fi/o04ytqvw3...ljmz&raw=1

Here are the programs used:

Addloop:
Code:
from time import *
def addloop():
  s=0
  t=monotonic()+60
  while monotonic()<=t:
    s +=1
  print("Count:",s)

Fourops:
Code:
from math import *
from time import *
def fourops(n=10000):
  t = monotonic()
  sum = 0
  b = 0; c = 0
  for a in range(1,n+1):
    b = a
    c = a
    sum += sqrt(b*c)/a
  print(sum)
  t = monotonic() - t 
  print("Time: {0:.3f} seconds".format(t))

Nqueens:
Code:
from time import *
def nqueens(n=100):
  t0 = monotonic()
  for i in range(n):
    a = [0] * 9
    r = 8
    s = 0
    x = 0
    y = 0
    t = 0
    while True:
      x += 1
      a[x] = r
      while True:
        s += 1
        y = x
        while y>1:
          y -= 1
          t = a[x]-a[y]
          if t==0 or x-y==abs(t):
            y=0
            a[x] -= 1
            while a[x]==0:
              x -= 1
              a[x] -= 1
        if y==1:
          break;
      if x==r:
        break;
  print(s)
  t0=(monotonic()-t0)/n
  print("Time: {0:.3f} seconds".format(t0))

Savage:
Code:
from math import *
from time import *
def savage():
  t=monotonic()
  a=1
  for i in range(1,2500):
    a=tan(atan(exp(log(sqrt(a*a)))))+1
  print(a)
  t=monotonic()-t
  print("Time: {0:.3f} seconds".format(t))

Extended Savage:
Code:
from math import *
from time import *
def savexten(n=10000):
  t = monotonic()  
  globalSum = 0
  sum = 1
  for k in range(1,n):
    sum += tan(atan(exp(log(sqrt(sum*sum)))))
  globalSum += abs((k+1)-sum)

  print(globalSum)
  t = monotonic()-t
  print("n =",n)
  print("Time: {0:.3f} seconds".format(t))

Summation:
Code:
from math import *
from time import *
def summation():
  t=monotonic()
  s=0
  for x in range(1,1001):
    s+=(exp(sin(atan(x))))**(1/3)
  print(s)
  t=monotonic()-t
  print("Time: {0:.3f} seconds".format(t))

Thimet:
Code:
from math import *
from time import *
def thimet(loops=10000):
  t=monotonic()
  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))

Naive Primes:
Code:
from time import *
def naiveprms(n=1000):
  t = monotonic()
  for k in range(3, n+1):
    for j in range(2, k):
      if k % j == 0:
        break
  t = monotonic()-t
  print("Time: {0:.3f} seconds".format(t))

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
09-13-2023, 12:14 AM
Post: #2
RE: Numworks Calculator Comparison
Thank you Tom for this comparison. Nice to have more MicroPython results in the list, because it is much more efficient than the standard languages.
I assume that the difference on the TI-84 Plus CE is much bigger than other calculators.

Calculator Benchmark
Find all posts by this user
Quote this message in a reply
09-13-2023, 04:43 AM
Post: #3
RE: Numworks Calculator Comparison
(09-13-2023 12:14 AM)xerxes Wrote:  Thank you Tom for this comparison. Nice to have more MicroPython results in the list, because it is much more efficient than the standard languages.
I assume that the difference on the TI-84 Plus CE is much bigger than other calculators.

You're quite welcome! I've added one more test, Naive Primes to the set.

If anyone cares to extend the table with other calculators, please feel free!

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
09-15-2023, 11:02 AM
Post: #4
RE: Numworks Calculator Comparison
I've added times for the TI-84 Plus CE Python to the spreadsheet. The times are slower than I would've thought.

https://www.dropbox.com/scl/fi/o04ytqvw3...mljmz&dl=0

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
09-16-2023, 03:04 AM (This post was last modified: 09-16-2023 05:33 AM by xerxes.)
Post: #5
RE: Numworks Calculator Comparison
(09-15-2023 11:02 AM)toml_12953 Wrote:  I've added times for the TI-84 Plus CE Python to the spreadsheet. The times are slower than I would've thought.

Yes, it's indeed slower than I would have expected. I found this on Wikipedia:
"The Python implementation is extremely slow compared to NumWorks and HP calculators due to the use of an ARM coprocessor running CircuitPython, which communicates to the calculator via 115200 baud UART serial."

Calculator Benchmark
Find all posts by this user
Quote this message in a reply
09-22-2023, 06:40 AM
Post: #6
RE: Numworks Calculator Comparison
(09-16-2023 03:04 AM)xerxes Wrote:  use of an ARM coprocessor running CircuitPython, which communicates to the calculator

So my idea was not so silly in 2020...

[Image: 126842101_189502709369061_10727645895874...QRi8WiNAEo]
Find all posts by this user
Quote this message in a reply
09-22-2023, 07:26 PM (This post was last modified: 09-22-2023 07:26 PM by toml_12953.)
Post: #7
RE: Numworks Calculator Comparison
(09-22-2023 06:40 AM)Csaba Tizedes Wrote:  
(09-16-2023 03:04 AM)xerxes Wrote:  use of an ARM coprocessor running CircuitPython, which communicates to the calculator

So my idea was not so silly in 2020...

You were ahead of your time! So what are you working on now that will be commercially available in 2026? Big Grin

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
09-23-2023, 05:10 PM
Post: #8
RE: Numworks Calculator Comparison
(09-22-2023 07:26 PM)toml_12953 Wrote:  
(09-22-2023 06:40 AM)Csaba Tizedes Wrote:  So my idea was not so silly in 2020...

You were ahead of your time! So what are you working on now that will be commercially available in 2026? Big Grin


I'm an ENTJ. My mission to open your eyes and able to show your future. If you can't open your eyes, thats not my fault. Smile

Csaba
Find all posts by this user
Quote this message in a reply
09-23-2023, 08:41 PM
Post: #9
RE: Numworks Calculator Comparison
(09-12-2023 04:19 AM)toml_12953 Wrote:  Here are the results:
https://www.dropbox.com/scl/fi/o04ytqvw3...ljmz&raw=1
Here are the programs used:

I could not resist, of course, to show the results of the G2. Minor changes where necessary, as the Python on Prime doesn't have a time module. Thus replace "from time import *" by:

import hpprime as hp
def monotonic():return hp.eval('time')

Results for:
Fourops : 0.059 s
nqueens : 0.013 s
savexten : 0.104
savage : 0.035
summation : 0.18
naiveprms : 0112
thimet : 0.654

For addloop I had to choose a different approach as the repetitive call to the PPL-function "time" is extremely time(sic!) consuming. Therefor I let it add 1 until 6,000,000 reached. Time for that 4.439 s. To compare with the other results: (6,000,000/4.439) *60 ~ 81,099,346

Günter
Find all posts by this user
Quote this message in a reply
09-24-2023, 01:57 PM
Post: #10
RE: Numworks Calculator Comparison
(09-23-2023 08:41 PM)Guenter Schink Wrote:  
(09-12-2023 04:19 AM)toml_12953 Wrote:  Here are the results:
https://www.dropbox.com/scl/fi/o04ytqvw3...ljmz&raw=1
Here are the programs used:

I could not resist, of course, to show the results of the G2. Minor changes where necessary, as the Python on Prime doesn't have a time module. Thus replace "from time import *" by:

import hpprime as hp
def monotonic():return hp.eval('time')

Results for:
Fourops : 0.059 s
nqueens : 0.013 s
savexten : 0.104
savage : 0.035
summation : 0.18
naiveprms : 0112
thimet : 0.654

For addloop I had to choose a different approach as the repetitive call to the PPL-function "time" is extremely time(sic!) consuming. Therefor I let it add 1 until 6,000,000 reached. Time for that 4.439 s. To compare with the other results: (6,000,000/4.439) *60 ~ 81,099,346

Günter

Great! Thanks. I can't get to the link, though.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
09-24-2023, 07:22 PM (This post was last modified: 09-24-2023 07:27 PM by Guenter Schink.)
Post: #11
RE: Numworks Calculator Comparison
I copied the link from your first post. It still works there, not here - why? shrug

Günter

edit:
the copied link obviously got corrupted
Original link: "https://www.dropbox.com/scl/fi/o04ytqvw31dfxjc2d36fv/Numworks-Spreadsheet.png?rlkey=ywoafghsgzspa0wh4on7mljmz&raw=1"

Copied link: "https://www.dropbox.com/scl/fi/o04ytqvw3...ljmz&raw=1https://www.dropbox.com/scl/fi/o04ytqvw3...ljmz&raw=1"
Find all posts by this user
Quote this message in a reply
09-24-2023, 07:53 PM
Post: #12
RE: Numworks Calculator Comparison
(09-24-2023 07:22 PM)Guenter Schink Wrote:  I copied the link from your first post. It still works there, not here - why? shrug

Günter

edit:
the copied link obviously got corrupted
Original link: "https://www.dropbox.com/scl/fi/o04ytqvw31dfxjc2d36fv/Numworks-Spreadsheet.png?rlkey=ywoafghsgzspa0wh4on7mljmz&raw=1"

Copied link: "https://www.dropbox.com/scl/fi/o04ytqvw3...ljmz&raw=1https://www.dropbox.com/scl/fi/o04ytqvw3...ljmz&raw=1"

Because urls can be extremely long, the myBB Forum software shortens it where it is displayed in an original post, but preserves the actual full-length link internally. You can see the ellipsis in the middle of the link (o04ytqvw3...ljmz&raw=) where it was shortened.

When you quote some text, the text is quoted verbatim (i.e. the shortened string exactly as displayed) and the entire, full-length url is not preserved .

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
09-24-2023, 08:03 PM
Post: #13
RE: Numworks Calculator Comparison
Thanks for the explanation Bob

Günter
Find all posts by this user
Quote this message in a reply
Post Reply 




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