Author Topic: A symbolic library for the Nspire non-CAS  (Read 20189 times)

0 Members and 3 Guests are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A symbolic library for the Nspire non-CAS
« Reply #15 on: April 14, 2010, 12:20:29 pm »
Maybe most Omnimaga people don't know either or totally forgot? :O

Altough I agree a bit with Builderboy lol. Sometimes we buy a calc but end up using it more often for games than school. :P

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #16 on: April 14, 2010, 12:40:01 pm »
I was going to write a CAS in C for the Nspire, but I couldn't find any input or output functions :(

Offline theUnnamed

  • LV3 Member (Next: 100)
  • ***
  • Posts: 63
  • Rating: +3/-3
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #17 on: April 14, 2010, 04:14:08 pm »
I was going to write a CAS in C for the Nspire, but I couldn't find any input or output functions :(

That sucks you would definitely get better performance out of a CAS in C hell you wouldn't even need to write it you would just need to build a lisp interpreter and front end for Maxima.  And lisp is easy interpretation.
« Last Edit: April 17, 2010, 10:41:47 pm by theUnnamed »

Offline theUnnamed

  • LV3 Member (Next: 100)
  • ***
  • Posts: 63
  • Rating: +3/-3
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #18 on: April 17, 2010, 10:47:22 pm »
I'm proud to report that my optimization efforts are going well even though I don't understand how half the code works but then again my current optimization is much like peephole optimization and function in-lining thous far but it seems to have had some inpack thous far I'm going to upload a copy for people to play with tomorrow. please make sure I didn't break anything.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A symbolic library for the Nspire non-CAS
« Reply #19 on: April 17, 2010, 10:53:23 pm »
mhmm could you rephrase the second part of your sentence starting on the word "peephole", especially the "thous", "in-lining" and "inpack" parts? I am confused at what you mean x.x

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #20 on: April 17, 2010, 11:41:26 pm »
thous = thus and inpack = impact, maybe?
I believe there are some places where I calculate the same thing several times over (basically, I want the numerator and denominator of a rational expression, so I simplify it 3 times). I think that's a good place to start optimizing if you want big speedup for relatively little work.

Offline Silver Shadow

  • Beta Tester
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +27/-7
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #21 on: April 18, 2010, 04:10:02 am »
@Eeems: it's déjà-vu not deja'vou. :P
Former Coder of Tomorrow


Offline tensuke

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 16
  • Rating: +0/-0
  • Crab Nicholson
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #22 on: April 18, 2010, 06:09:56 pm »
A CAS in C would be nice for those of us stuck on 1.1 :P

Offline theUnnamed

  • LV3 Member (Next: 100)
  • ***
  • Posts: 63
  • Rating: +3/-3
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #23 on: April 18, 2010, 06:55:18 pm »
I actually don't fully understand how the library works yet but think there are better places to start like for example gutting parsing engine and rewriting it, refracting the way operators are handled and reducing excessive function calls. additionally I can make rather significant gains using matrix and list math for many where they are neglected for loops.  As I have said thus far I have only really done compiler like optimizations (and replacing the bubble sorts with something respectable) meaning I've reduced obviously redundant operations, remove excessive variables and copying, and operator strength reduction.





here's the promised working copy
« Last Edit: April 18, 2010, 06:59:13 pm by DJ Omnimaga »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A symbolic library for the Nspire non-CAS
« Reply #24 on: April 18, 2010, 06:59:37 pm »
I also merged your double-post. :P

Offline theUnnamed

  • LV3 Member (Next: 100)
  • ***
  • Posts: 63
  • Rating: +3/-3
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #25 on: April 25, 2010, 01:41:00 am »
I'm really embarrassed the library I posted doesn't work It just explodes anyway heres a working version of the library.
and good news I think I've figured out why the differentiation function is so slow and am working to fix it I think It will be a very small modification to the pf2tree function or the pf2tree function and it will be crazy much faster. I forget which at the moment. still happy day.  :)
« Last Edit: May 02, 2010, 06:59:34 pm by theUnnamed »

Offline theUnnamed

  • LV3 Member (Next: 100)
  • ***
  • Posts: 63
  • Rating: +3/-3
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #26 on: May 02, 2010, 07:18:37 pm »
unfortunately I was wrong as to why the differentiation function is slow it turns out that it's because the algebraic reduction portion that it is slow.  This posses a significant challenge to optimize. although I'm working hard to figure out this portion of the library but progress is slow and i have unfortunately some how broke something in it and I don't know what so that has set me back almost a week. :( I'm going to have to start doing nightly backups.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A symbolic library for the Nspire non-CAS
« Reply #27 on: May 02, 2010, 07:25:55 pm »
sorry to hear x.x

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #28 on: May 02, 2010, 09:16:58 pm »
I think you can greatly increase the speed of the differentiator by writing a modified algebraic simplifier that returns the numerator and denominator in a list. Right now I calculate every expression twice to get the numerator and denominator.

Offline theUnnamed

  • LV3 Member (Next: 100)
  • ***
  • Posts: 63
  • Rating: +3/-3
    • View Profile
Re: A symbolic library for the Nspire non-CAS
« Reply #29 on: May 02, 2010, 09:23:54 pm »
Where would I find this problem.