<notice> gCAS2 is finishing up its transition to a new parser. I still am finding some expressions that don't work (less crashing, more errors reported, thankfully). The library contains z80 optimized functions as well as C ones.

The first section here is of me writing gCAS version 1. it was a standalone program that got the CAS push for my OS. After i wrote it, i noticed that the way i made the nodes was going to be very unoptimized for algorithms. So, i rewrote it from scratch as gCAS2. it runs on GlassOS and on linux (not maintained unless needed). For GlassOS, it comes in two parts: libgcas2.so and gCAS2. The library contains the cas backend and can be used by any program. gCAS2 is a graphical frontend to be used to interface with it to do interactive math.

Congrats to Graph3DP for using gCAS2 as its math backend Very Happy

<old>Well, I began writing a CAS this morning. I had read very little on the topic. Regardless of this setback, I already have a library that can parse input, create a listing of it, and finally make a node tree. I have algorithms written, but I haven't used them yet (to solve the tree and get an answer).

Here is a screenshot of the library parsing a function.


This runs nicely on
No comments other than wooo, you have an EOS, such as it is. Smile
It can handle stuff, 2x+x*(x-3) = x^2-x (with alg.s)

It handles variables specially and has special algorithms for expanding (distributing), simplifying stuff, powers, etc.. Functions will be done later on. It allows externally defined variables, so everything looks good for the future.

(A calc library in under 12 hours o_O)
Heh, day 2 and mCAS is working much better. It is solving stuff better, yet it is still lacking powers, functions, and parentheses. I am handling variables much better as I can now store values to them (just numbers for now, later it will be anything that you want) and delete them. Here is the latest build working with base powers and variables:


(The tree dump line is a recursive printout of the assembled node tree)

Current size for x86: 22k
Memory usage is still very low Smile
KermMartian wrote:
No comments other than wooo, you have an EOS, such as it is. Smile
Careful there, EOS or Equation Operating System is trademarked by TI for their z80 calcs. Razz
TheStorm wrote:
KermMartian wrote:
No comments other than wooo, you have an EOS, such as it is. Smile
Careful there, EOS or Equation Operating System is trademarked by TI for their z80 calcs. Razz
I think APD is trademarked, too.
They are AFAIK -_- Hence the little (R)

I am working on some random function research, so I may get to it later today... maybe some more alg's for evaluating stuffs

<edit>

Ok, now parenthesis work! Please look at the tree dump lines to see how the logic flow is changed


(Watch the change in paren. placement in the tree)

Next are functions which simply need me to handle creating the node and upwards. Parsing them are already supported.

Also, I hope that I will compile this for the TI84 in 24 hours just to see is run just as well as on linux. Now, this will never run with TIOS since I need ~7kb of ram (without optimizing anything so far and ONLY when I stress it).. Wink
Yay, mCAS runs on a TI84!!! Enjoy typing in fun expressions and see it spit out answers. It has no error checking when parsing what you type, so if you try to break it, it will break. Anywho, here's an unofficial post of GlassOS (unsigned of course):

https://cloud.ahelper.me/pub/glassos/GlassOS.8xu
Congrats, I'll have to give it a try on Wabbit at some point. Smile
I have the above version running on my calc. I hope it doesn't die at school! (pull battery, hold [del], put back in) works at resetting the OS. There is still no on feature, so it sucks the batteries @15mHz mode since I am too lazy to slow it down in getc functions and such...

Also, if you run it and are confused on how to type in it, look here: http://glassos.sourceforge.net/keymap.html
To start mCAS, hit [F1] to open up the menu and hit run->mCAS. To quit, type in

Code:
>>quit
or
Code:
>>exit
Seems pretty nice. However I would maybe tell Critor about this project because of its name, since he already used the name mCAS for a CAS program intended to be used with the regular TI-Nspire models. (To save money)

http://ti.bank.free.fr/index.php?mod=archives&ac=voir&id=1884

Although it should be fine, it might be best to ask him permission if you can use the same name too.
ah, nice catch there. I can always change around the name... I originally wanted gCAS (glassCAS), but I started writing it on a computer, so it was dubbed minimalistic CAS. I should change it back...
Very nice! Good luck using it in school tomorrow. Smile
one should always bring > 1 calculators to school, preferably including a 68k somewhere...

<edit>

Here's mCAS running on a TI84...



<edit>

Well, running it for a day did expose an odd error... It seems like the parenthesis aren't splitting right (I need to see it with debug output). Typing in
Code:
(5!/(3!*(5-3)!)*3*3
gives a random answer, but putting the *3*3 in front gives the right answer... Seems like floating point alg. failures since I get negative numbers :-S Other than that, I realized how much I need a scrolling list widget for the GUI and that putchar needs scrolling, not flipping. When trying to crash it, it just pukes on the screen, but it didn't stop it... Other than that, solid. I need to enable the X variable button because hitting alpha-x-alpha+2 takes a little too long... Also the getc needs to allow holding down the modifier keys as a 'temp hold'. Should be that hard to do...

Anyways, a great way to find areas that need fixing
That's looking great! I have my own personal way of evaluating expressions that is very memory efficient, and just requires the modification of the expression string. If you're interested, i can write up some information about this method.
Good work!

I wrote a little expression evaluator which can be found here if you're looking for inspiration, not that I think you'd need it. Smile
Thanks,

I will rewrite gCAS's node layout to be less memory-intensive. This should make the code overall smaller since I will have to manipulate stuff less (no pointers to structs in a struct, just a struct with the variables in it).

I was trying to get distributing working, but just made a huge memory leak somewhere even though my code should work (again, I need to restructure stuff)

As for functions... There will be two kinds that I will make (optimized). The first one is a 1-2 parameter node function, such as sin(, cos(, sqrt(, etc. These can be put anywhere in the evaluation string (I will parse them). The second will be one line functions (In TIOS, think like disp vs. tan), but I don't know of anything just yet...

Lastly, I badly need a listwidget (for GlassOS to draw the scrollback) and an updated textbox so that entering things will be less painful (like hitting tan( will actually type out tan( in the textbox).

Fun stuff for a z80, considering that the IEEE math functions aren't that far off... i found them to be precise within 3~4 digits. That shouldn't be a big issue for right now...
I notice a distinct lack of note about the size of gCAS; I hesitate to ask, but I must. How many KB is gCAS? Smile
Sorry about leaving that out...

First, note that gCAS has a lot of unused PC-side functions included, nor is it optimized at all

The current gCAS size is: 15881 bytes

Some of the space was wasted on me not linking IEEE math functions, others on debug functions, and the rest on bad code (filthy switch() blocks). Expect the size of this to go way down later this week when I rewrite the node system.
And hence why I like to glare at SDCC. Smile No problem with regards to leaving that out, I didn't think it was intentional. Best of luck with your optimizations! Feature-wise, it supports the four arithmetic functions, factorial, and parentheses?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page 1, 2, 3 ... 10, 11, 12  Next
» View previous topic :: View next topic  
Page 1 of 12
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement