Post Reply 
New Casio fx-9860 GIII model
10-05-2020, 12:25 PM
Post: #46
RE: New Casio fx-9860 GIII model
(10-04-2020 04:53 PM)grsbanks Wrote:  Has anyone else noticed how damn fast this thing is using python?

I ran some benchmarks on this thing using both the built-in Casio Basic language and Python.

First, I get it to calculate \(\sum_{k=1}^n \sqrt[3]{e^{sin(atan(k))}} \) (a function with no intrinsic value other than it gets the calculator to chew through a bunch of transcendental functions) for various values of \(n\).

Using the built-in \(\sum \) function it gets through this in roughly (because timed with a stopwatch) 25 seconds for \(n=10^3\) or 220 seconds for \(n=10^4\). Using a Casio Basic program it does it in about 16 seconds for \(n=10^3\), 164 seconds for \(n=10^4\) or 1650 seconds for \(n=10^5\). Using a python program it does it in only 2 seconds for \(n=10^3\), 18 seconds for \(n=10^4\) or 184 seconds for \(n=10^5\). That's 10× faster than using Casio Basic, BUT with what appears to be greatly reduced precision.

Another test I do is to get a machine to solve the "N Queens" problem, not just for the first layout it finds but for all layouts. The kind of results I get are

Casio basic: 6×6 board 32 seconds, 7×7 board 139 seconds, 8×8 board 670 seconds
Python: 6×6 board 1 second, 7×7 board 3 seconds, 8×8 board 15 seconds, 9×9 board 76 seconds

Here, manipulating integers instead of floating point numbers, it's over 40× faster.

Would you post the exact program you used to test? For a valid benchmark, the same program should be used on all the tested calculators (or as close as possible). Here's the nqueens program I used:

Code:
def nqueens():
  r=8
  a=[0 for i in range(0,r+1)]
  s=0
  x=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)

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
New Casio fx-9860 GIII model - Coco - 01-09-2020, 04:34 PM
RE: New Casio fx-9860 GIII model - Hlib - 01-09-2020, 08:02 PM
RE: New Casio fx-9860 GIII model - Coco - 02-02-2020, 04:15 PM
RE: New Casio fx-9860 GIII model - lrdheat - 03-06-2020, 03:22 PM
RE: New Casio fx-9860 GIII model - Dands - 03-08-2020, 04:07 AM
RE: New Casio fx-9860 GIII model - klesl - 03-08-2020, 12:25 PM
RE: New Casio fx-9860 GIII model - lrdheat - 03-10-2020, 05:51 PM
RE: New Casio fx-9860 GIII model - klesl - 05-14-2020, 04:30 PM
RE: New Casio fx-9860 GIII model - toml_12953 - 10-05-2020 12:25 PM
RE: New Casio fx-9860 GIII model - lrdheat - 10-04-2020, 11:34 PM
RE: New Casio fx-9860 GIII model - pier4r - 10-06-2020, 08:26 PM
RE: New Casio fx-9860 GIII model - vaklaff - 10-11-2020, 06:29 PM
RE: New Casio fx-9860 GIII model - lrdheat - 10-15-2020, 03:43 PM
RE: New Casio fx-9860 GIII model - lrdheat - 10-18-2020, 11:26 PM
RE: New Casio fx-9860 GIII model - Druzyek - 10-21-2020, 12:47 AM
RE: New Casio fx-9860 GIII model - DiTBho - 01-01-2021, 01:25 PM
RE: New Casio fx-9860 GIII model - critor - 01-01-2021, 08:37 PM
RE: New Casio fx-9860 GIII model - robve - 01-16-2022, 03:30 PM
RE: New Casio fx-9860 GIII model - critor - 01-19-2022, 08:36 PM
RE: New Casio fx-9860 GIII model - robve - 01-21-2022, 03:28 PM



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