Author Topic: PROGRAM: Polynomial Math Utility  (Read 8505 times)

0 Members and 2 Guests are viewing this topic.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: PROGRAM: Polynomial Math Utility
« Reply #15 on: December 08, 2012, 07:26:47 am »
Would you make the program have some hook then and call at some function on the homescreen (like symbolic)? That would be epic! :D
That would be hard for a basic program to install hooks :P

Great program anyway :D
I have a request though. Instead of doing "operand 1", "operand 2", "operation", couldn't it just input the calculation then look for an operation sign and guess alone what the operation is and what are the operands ?
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: PROGRAM: Polynomial Math Utility
« Reply #16 on: December 08, 2012, 07:34:06 am »
Wow, that would actually be cool if you managed to make a way to parse a function like that. It would be rather tough, though XD

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: PROGRAM: Polynomial Math Utility
« Reply #17 on: December 08, 2012, 07:52:39 am »
Well in ugly basic (it's been a while since I last programmed with that :P) it can be done like that:

ClrHome
Input Str1
For(A,1,length(Str1))
If sub(Str1,A,1)="+"
Then
sub(Str1,1,A-1)->Str2
sub(Str1,A+1,length(Str1)-A)->Str3
End
End
Disp Str2
Disp Str3
Pause

Of course, this code only supports "+" but "*" and "-" can easily be added ;)
Here is a screenshot below to show what that code produces
The problem I see with "+" is that there are a lot of "+" already in the two operands so the program could not see the difference between those and the operator one :P
But anyway, that would be great for * and / :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: PROGRAM: Polynomial Math Utility
« Reply #18 on: December 08, 2012, 07:57:31 am »
Yes, but I was thinking of nested stuff like ((x+1)(x+2)(x+3)+1)/(x^2+1)

Also, to optimise your code:
Code: [Select]
ClrHome
Input Str1
InString(Str1,"+→A
sub(Str1,1,A-1->Str2
sub(Str1,A+1,length(Str1)-A->Str3
Disp Str2
Pause Str3
:D

hmmm...
* Xeda112358 ponders

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: PROGRAM: Polynomial Math Utility
« Reply #19 on: December 08, 2012, 12:53:51 pm »
Would you make the program have some hook then and call at some function on the homescreen (like symbolic)? That would be epic! :D
That would be hard for a basic program to install hooks :P

Thanks. Better yet, I'm trying to design an asm version. Can someone help me out with routines for all 4 operations... multiplying, adding, dividing, and subtracting 16.8 fixed point numbers...?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: PROGRAM: Polynomial Math Utility
« Reply #20 on: December 08, 2012, 01:04:41 pm »
Would you make the program have some hook then and call at some function on the homescreen (like symbolic)? That would be epic! :D
That would be hard for a basic program to install hooks :P

Thanks. Better yet, I'm trying to design an asm version. Can someone help me out with routines for all 4 operations... multiplying, adding, dividing, and subtracting 16.8 fixed point numbers...?
Ah yeah, sorry, didn't see that one -.-°
Then, a hook would be great :D

Yes, but I was thinking of nested stuff like ((x+1)(x+2)(x+3)+1)/(x^2+1)

Also, to optimise your code:
Code: [Select]
ClrHome
Input Str1
InString(Str1,"+→A
sub(Str1,1,A-1->Str2
sub(Str1,A+1,length(Str1)-A->Str3
Disp Str2
Pause Str3
:D

hmmm...
* Xeda112358 ponders
Yeah, I knew it could be optimized, I really never code in Basic :P
But nested stuff would be pretty hard in Basic since it has to keep trace of everything O.O
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: PROGRAM: Polynomial Math Utility
« Reply #21 on: December 09, 2012, 09:08:30 am »
Guys I think I am done with the TI-Basic version. There will be no further updates, beyond bug-fixes. My goal is to get an assembly version up and running, and to phase out the TI-Basic version.

On the assembly version:

- It will indeed be hook activated!
- It will support polynomial addition, subtraction, multiplication, and division, as well as integrals and derivates. It will also support solving equations with multiple variables in terms of any one variable. It will also support solving systems of equations for all variables, and solving equations with a single variable for that variable.
- In effect, my goal is to create a symbol interpreter for the TI-83+/84+.

I know this is a massive undertaking, and I don't have all the time in the world, so any assembly programmers with spare time who want to jump in on some stuff and help that would be great.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: PROGRAM: Polynomial Math Utility
« Reply #22 on: December 09, 2012, 09:20:53 am »
So it will be like Symbolic, but maybe more stuff?

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: PROGRAM: Polynomial Math Utility
« Reply #23 on: December 09, 2012, 09:29:26 am »
In a way. What features does Symbolic have?

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: PROGRAM: Polynomial Math Utility
« Reply #24 on: December 09, 2012, 09:30:36 am »
Hmm, I can't remember, but I know it can find derivatives and do some symbolic math among other things.

EDIT: If you are going to make a symbolic parser, you will probably need some arbitrary precision routines, or you can just use the OSes FP routines.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: PROGRAM: Polynomial Math Utility
« Reply #25 on: December 09, 2012, 01:07:13 pm »
Yeah. I'm thinking 16.8 Fixed Point.

Anyway, this project is being made universal. If you are a Z80 assembly programmer with some spare time, hop over to the link below (Google Docs), check out what is needed and write a routine or two, post it into the google doc, then add your name or screen name to the very bottom of the document, along with what routines you should be credited for. I'll be working on it regularly myself as well, time providing.

Also, I seem to have lost my resources on the appropriate headers for a TI Application file, so someone can edit that in to the Doc as well.

When it is done, we can publish this as a community project, rather than a project done by a single author. That allows us to make it a large, feature-dynamic project, very quickly. This will be cross posted to cemetech as well.

Link to Google Doc:
https://docs.google.com/document/d/1R5MgUPEO1muFVD_8rArb5MsTiMA5M7KATDqquwZ3wKE/edit

For a better description, head over to http://www.cemetech.net/forum/viewtopic.php?p=196685#196685
« Last Edit: December 09, 2012, 01:23:15 pm by ACagliano »

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: PROGRAM: Polynomial Math Utility
« Reply #26 on: December 09, 2012, 04:41:43 pm »
In a way. What features does Symbolic have?
csc, sec, arcscs, arcsec, cot, arccot, csch, sech, coth, arcscsh, arcsech, arccoth, deriving, simplifiing, strtonum.
That's about it i think, but IMO symbolic anyways needs a remake as it is slow, no nice token hook and it makes graph3 crach :P

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: PROGRAM: Polynomial Math Utility
« Reply #27 on: December 09, 2012, 04:57:24 pm »
Well, my hope is to not need to use tokens at all. If you use the proper invocation string at the beginning of the input, it is automatic.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: PROGRAM: Polynomial Math Utility
« Reply #28 on: December 09, 2012, 04:58:41 pm »
i mean that it looks the the end user as if he has new commands on his calc like csc(

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: PROGRAM: Polynomial Math Utility
« Reply #29 on: December 30, 2012, 03:25:58 am »
So, have you made any more progress on this awesome project?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!