Post Reply 
New Casio fx-9860 GIII model
10-04-2020, 07:26 PM
Post: #41
RE: New Casio fx-9860 GIII model
(10-04-2020 04:53 PM)grsbanks Wrote:  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.

Does the Python program use single-precision floats, and if so does the Casio implementation of Python have doubles?
Find all posts by this user
Quote this message in a reply
10-04-2020, 08:45 PM
Post: #42
RE: New Casio fx-9860 GIII model
It should also be noted that KhiCAS is now available on the Casio Fx-9750GIII (thank you Parisse!) giving it a CAS that is similar to the one in the HP Prime (same Xcas engine). This makes the Casio Fx-9750GIII the lowest priced currently produced graphing calculator with Micro Python and CAS capabilities. Very impressive for under US$42 new.
https://www.cemetech.net/forum/viewtopic...783#286192
Find all posts by this user
Quote this message in a reply
10-04-2020, 11:34 PM
Post: #43
RE: New Casio fx-9860 GIII model
When I tried the KhiCAS on Parrisse’s site... on the graphing application, it was surprisingly fast, but, upon inspection, appeared to use much fewer sampling points it it’s plot. Perhaps there is a way to use a denser setting for the graphing...
Find all posts by this user
Quote this message in a reply
10-05-2020, 07:30 AM
Post: #44
RE: New Casio fx-9860 GIII model
(10-04-2020 07:26 PM)John Keith Wrote:  Does the Python program use single-precision floats, and if so does the Casio implementation of Python have doubles?

That I don't know. I only looked at Python for the first time this weekend so that I could run these tests so I wouldn't really know where to look. This said, the manual makes no mention of single or double precision and it _is_ a pretty stripped down version of Python, so I wouldn't be surprised if it doesn't "do" double precision.

There are only 10 types of people in this world. Those who understand binary and those who don't.
Find all posts by this user
Quote this message in a reply
10-05-2020, 10:57 AM
Post: #45
RE: New Casio fx-9860 GIII model
Python uses binary floats, rather than the BCD that is presumably used in all the other modes, so that could contribute to the speed. Not sure if the CPU has any floating point instructions included.
Visit this user's website Find all posts by this user
Quote this message in a reply
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
10-05-2020, 04:13 PM
Post: #47
RE: New Casio fx-9860 GIII model
(10-05-2020 12:25 PM)toml_12953 Wrote:  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:

Sure. FWIW I think yours stops at the first solution found. Mine starts by asking what size board you want to work with and then finds all the solutions (92 in the case of an 8×8 board)

Code:
n=0
while n<1 or n>10:
    n = int(input("n= (1 to 10) "))

sol = [ 0 ] * n

nodes=0
solutions=0
row=0
col=0

# Keep on doing this until we try and go "back" beyond the first row
while row >= 0:
    
    # Keep on while we're in the range 0..n-1 for the column
    while col < n:
    
        # increment the count of nodes examined
        nodes += 1

        # Find out if this space is safe.
        safe=True
        if row > 0:
            for testrow in range(row):
                # If there's something in the same column or on the same diagonal then we're not safe
                if sol[testrow]==col or abs(sol[testrow]-col)==(row-testrow):
                    safe=False
                    break
        
        if safe:
            # Mark the space as taken
            sol[row] = col
            # Are we on the final row?
            if row==(n-1):
                # Yes, then we have a solution
                solutions += 1;
                # print(sol)
            else:
                # If not then try solving as of col 0 in the next row
                col=0;
                row += 1
                continue
                
        # move to the next column
        col += 1
        
        # end while col < n

    # Nothing more in this column so we need to go back to the previous row
    row -= 1;
    # ...and try on the next column
    if row >= 0:
        col=sol[row]+1
    
    #end while row >= 0

print()
print(n,"×",n," board")
print(solutions, "solutions")
print(nodes, "nodes tested")

There are only 10 types of people in this world. Those who understand binary and those who don't.
Find all posts by this user
Quote this message in a reply
10-05-2020, 06:02 PM
Post: #48
RE: New Casio fx-9860 GIII model
(10-04-2020 07:26 PM)John Keith Wrote:  
(10-04-2020 04:53 PM)grsbanks Wrote:  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.

Does the Python program use single-precision floats, and if so does the Casio implementation of Python have doubles?

I would be surprised if Casio picked single-precision float for its Python implementation.
With only 7 digits precision (and greatly reduced exponent range), that is just asking for user complaints.

More likely, what appeared to be reduced precision is just default display format of numbers.

To get a good reference of what is expected, I simplified the formula:

Σ (e^sin(atan(x)))^(1/3) = Σ e^(x/(sqrt(9*x*x+9))

All terms about the same size, approaching e^(1/3) ≈ 1.39561 when x is big
To reduce errors, break up the sum to its integer and fractional parts.

Code:
expm1 = require'mathx'.expm1

function sum(n) -- sum of e^sin(atan(x)))^(1/3), x = 1 to n
    local s = 0
    for x=1, n do
       s = s + expm1(x/(sqrt(9*x*x+9)))
       if s >= 0.5 then n=n+1; s=s-1 end
    end
    if s < 0 then n=n-1; s=s+1 end
    return n, s
end

lua> sum(1e3)
1395       0.34628774342325536
lua> sum(1e4)
13955      0.8579042915289953
lua> sum(1e5)
139560     0.9761411065516028

Binary math tends to be more accurate, because of smaller accumulated rounding errors.
Find all posts by this user
Quote this message in a reply
10-05-2020, 10:08 PM
Post: #49
RE: New Casio fx-9860 GIII model
(10-04-2020 07:26 PM)John Keith Wrote:  
(10-04-2020 04:53 PM)grsbanks Wrote:  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.

Does the Python program use single-precision floats, and if so does the Casio implementation of Python have doubles?

Assuming it's the same implementation as on the fx-CG50, it's using IEEE754 double precision:

Code:
>>>1+1e-15-1
1.110223024625157e-15
>>>1+1e-16-1
0.0
>>>

— Ian Abbott
Find all posts by this user
Quote this message in a reply
10-05-2020, 10:27 PM (This post was last modified: 10-05-2020 10:30 PM by ijabbott.)
Post: #50
RE: New Casio fx-9860 GIII model
(10-04-2020 08:45 PM)Steve Simpkin Wrote:  It should also be noted that KhiCAS is now available on the Casio Fx-9750GIII (thank you Parisse!) giving it a CAS that is similar to the one in the HP Prime (same Xcas engine). This makes the Casio Fx-9750GIII the lowest priced currently produced graphing calculator with Micro Python and CAS capabilities. Very impressive for under US$42 new.
https://www.cemetech.net/forum/viewtopic...783#286192

It's more than twice that price here in the UK (for the more-or-less equivalent fx-9860GIII model), and more than 70% of the price of an fx-CG50, so not quite the bargain it is in the USA!

— Ian Abbott
Find all posts by this user
Quote this message in a reply
10-06-2020, 08:26 PM
Post: #51
RE: New Casio fx-9860 GIII model
the cg50 with micropython got around 57 seconds for 100k

https://www.hpmuseum.org/forum/thread-97...#pid103448

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
10-11-2020, 05:45 PM
Post: #52
RE: New Casio fx-9860 GIII model
In the United States, the fx-9860GIII is named the fx-9750GIII, both in black and white.
Visit this user's website Find all posts by this user
Quote this message in a reply
10-11-2020, 06:29 PM
Post: #53
RE: New Casio fx-9860 GIII model
(10-11-2020 05:45 PM)Eddie W. Shore Wrote:  In the United States, the fx-9860GIII is named the fx-9750GIII, both in black and white.

In my country (Czechia) Casio sells both the lines (9750G and 9860G). 9860G is positioned higher - higher price, more capabilities. For example compatibility with Data Logger (https://edu.casio.com/support/datalogger/en/) seems to be one of the differences.

Disclaimer: No personal experience, just glanced at local web pages...
Find all posts by this user
Quote this message in a reply
10-11-2020, 10:08 PM (This post was last modified: 10-11-2020 11:43 PM by Steve Simpkin.)
Post: #54
RE: New Casio fx-9860 GIII model
(10-11-2020 06:29 PM)vaklaff Wrote:  
(10-11-2020 05:45 PM)Eddie W. Shore Wrote:  In the United States, the fx-9860GIII is named the fx-9750GIII, both in black and white.

In my country (Czechia) Casio sells both the lines (9750G and 9860G). 9860G is positioned higher - higher price, more capabilities. For example compatibility with Data Logger (https://edu.casio.com/support/datalogger/en/) seems to be one of the differences.

Disclaimer: No personal experience, just glanced at local web pages...

That was true of the previous generation models (fx-9860GII and fx-9750GII) where the fx-9750GII lacked a number of features. With those models, the fx-9750GII lacked the following features that were present in the fx-9860GII:
* Flash memory
* Vector calculations
* eActivity
* Spreadsheet
* Natural textbook display (Math Input/Output Mode)
* Examination Mode
* E-CON3 Data Logger (9750GII had E-CON2)
* Scientific constants & Periodic Table (Physium)
* Geometry Application

Theses functions were all added to the new fx-9750GIII along with Python. There is virtually no difference between the fx-9860GIII and fx-9750GIII models now. They both now support USB Mass Storage mode as well.

As I mentioned previously, KhiCAS is now available on the Casio Fx-9750GIII (thank you Parisse!) giving it a CAS that is similar to the one in the HP Prime (same Xcas engine).

The Fx-9750GIII currently sells for under US$42 in the U.S. It seems the equivalent fx-9860GIII is priced much higher in Europe. I suspect its low price in the U.S is to help compete against the permanently entrenched TI-84 Plus which sells for almost 3 times as much in the U.S.
Find all posts by this user
Quote this message in a reply
10-12-2020, 06:59 AM
Post: #55
RE: New Casio fx-9860 GIII model
(10-11-2020 10:08 PM)Steve Simpkin Wrote:  The Fx-9750GIII currently sells for under US$42 in the U.S. It seems the equivalent fx-9860GIII is priced much higher in Europe. I suspect its low price in the U.S is to help compete against the permanently entrenched TI-84 Plus which sells for almost 3 times as much in the U.S.

The fx-9860GIII sells in the UK for prices ranging from £70 ($90) to about £100 ($130) depending on where you look. I have not yet seen an fx-9750GIII over here but that's to be expected if, unlike the fx-9750GII, that model only targets North America.

The low price in the US probably is an attempt to dethrone the TI-84 Plus. Over here, it's Casio that has a stronghold on the education market, not TI, so they see no reason to price the unit more attractively.

There are only 10 types of people in this world. Those who understand binary and those who don't.
Find all posts by this user
Quote this message in a reply
10-13-2020, 11:39 AM
Post: #56
RE: New Casio fx-9860 GIII model
(10-04-2020 07:26 PM)John Keith Wrote:  
(10-04-2020 04:53 PM)grsbanks Wrote:  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.

Does the Python program use single-precision floats, and if so does the Casio implementation of Python have doubles?

The CG-50 model does. I don't know about the others although I would figure they used the same Python across calculators.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
10-15-2020, 03:43 PM
Post: #57
RE: New Casio fx-9860 GIII model
Is there a difference in available functions on the 7500 giii/9800 giii vs the fx-CG50? The previous CASIO’s (including the fx-CG50) seem to have difficulties in integrations that involve a range that includes an undefined/infinite value. The TI 36X Pro does better in this regard. Has this been solved in the iii series?
Find all posts by this user
Quote this message in a reply
10-16-2020, 08:22 PM (This post was last modified: 10-17-2020 11:34 AM by Csaba Tizedes.)
Post: #58
RE: New Casio fx-9860 GIII model
Just one question: it can numerically differentiate only by variable 'x' or by any?

EDIT:

Yes, as I guess before: there is no any update in the software. What CASIO want with this OS? For educational purposes, the CASIO is failed. I can't understand, how the CASIO think that their calculators will be used in education?! Eg. in the high school how do you want to perform a local extremum find on a plane without differentiation by any variable (at least x AND y)?

Nonsense.
Useless.
Waste of money.

Csaba

   
Find all posts by this user
Quote this message in a reply
10-18-2020, 11:26 PM
Post: #59
RE: New Casio fx-9860 GIII model
A neat thing about the TI 36X Pro is that one has max and a min capability to apply...one, for example could integrate from point A to point B, Max((f(x),g(x))).
Find all posts by this user
Quote this message in a reply
10-21-2020, 12:47 AM
Post: #60
RE: New Casio fx-9860 GIII model
My fx-9750GIII came in the mail today, and it's really impressive! The Python implementation seems to work really well. The manual says the editor can only handle files with up to 150 lines, though it can execute files larger than that. This is kind of annoying but not a dealbreaker. The latest OS update adds the casioplot module so you can use graphics from Python. I also read that the calculator uses the same processor as the Prizm, so it runs at 58MHz instead of 29MHz like the g and gii models. The spreadsheet mode and e-activity mode, which seems to be like a Jupyter notebook, are also really neat. They probably aren't news to most people but this is the first new Casio I've gotten since the AFX 2.0+ Smile

One thing I have not figured out is how to open a text file from Python. The "open" command is supported but returns "NoneType" since I'm probably missing the path for the file I'm trying to open. Anyone know how to do it?

Another thing that would be interesting is inlining assembly, which MicroPython supports with a decorator: 10. Inline assembler. The calculator recognizes @micropython as a decorator, but I couldn't get it to recognize .asm or .asm_sh4. With a limit of 150 lines, you couldn't write much assembly, but it might be enough to jump into a library written in C and designed to be called from Python.
Find all posts by this user
Quote this message in a reply
Post Reply 




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