Books about CAS

10262019, 01:38 PM
(This post was last modified: 02122020 02:09 AM by compsystems.)
Post: #1




Books about CAS
CAS0: Doing Mathematics with Scientific WorkPlace & Scientific Notebook Version 6
https://s3uswest2.amazonaws.com/macki...ath60.pdf CAS1: Computer Algebra and Symbolic Computation: Mathematical Methods https://www.ukma.edu.ua/~yubod/teach/com...i.org).pdf CAS2: COMPUTER ALGEBRA AND SYMBOLIC COMPUTATION: ELEMENTARY ALGORITHMS https://epdf.pub/computeralgebraandsy...ithms.html College Algebra & Trigonometry with examples on TI calculator https://www.amazon.com//es/JulieMiller...lie+Miller What other books do you know about CAS ?, please add links. Thank you 

12022019, 07:10 AM
Post: #2




RE: Books about CAS
There is also Computer Algebra with SymbolicC++, which according to the description gives a stepbystep guide to implementing a CAS in C++.
Everything will be alright in the end. If it's not alright, then it's not the end. 

01102020, 09:55 PM
Post: #3




RE: Books about CAS
(10262019 01:38 PM)compsystems Wrote: CAS0: Doing Mathematics with Scientific WorkPlace & Scientific Notebook Version 6 I also have these two books, which I read a long time ago : A cursory search of my bookcases didn't reveal "Computer Algebra and Symbolic Computation: Mathematical Methods" which I also own and read a while ago  it's lost somewhere in my piles of notes and books Regards, Jomnathan Aeternitas modo est. Longa non est, paene nil. 

01122020, 06:26 AM
(This post was last modified: 01132020 08:58 AM by Nad.)
Post: #4




RE: Books about CAS
Hello,
Did you ever implement the algorithms in software? I am wondering how large a CAS is in MB. Of course it would depend on the number of features. I have the development board used by the creator of this open source calculator, which has 16MB flash. I'm looking at adding some "simple" CAS functions. A good place to start is arbitrary precision big integer storage and arithmetic. There's a lot on the web, e.g. this Everything will be alright in the end. If it's not alright, then it's not the end. 

01142020, 08:56 PM
Post: #5




RE: Books about CAS
(01122020 06:26 AM)Nad Wrote: Hello, I have *dozens* of halftomostly finished projects. Whether I'll ever release them to the public depends on how my pathological perfectionism judges them for public consumption Quote: I am wondering how large a CAS is in MB. Of course it would depend on the number In my experience, the parser, the abstractsyntaxtree to intermediate representation code generator, and the term rewriting rules and system take up the most space and effort. Everything else is implemented with special purpose functions, which are optional. I'd say around 20KiB to 50KiB at a minimum in Saturn assembly and SystemRPL. Quote:I have the development board used by the creator of this open source calculator, which has 16MB flash. Looks like a neat project Quote:I'm looking at adding some "simple" CAS functions. A good place to start is arbitrary precision big integer storage and arithmetic. There's a lot on the web, e.g. this If it's possible, you might want to use an ARM Cortex M4 embedded CPU for your calculator, as one can then use the embedded versions of the GNU MultiPrecision ( aka "Bignum" ) library, without having to start from scratch See the following link : https://singletonresearch.com/2017/07/11...cortexm4/ Regards, Jonathan Aeternitas modo est. Longa non est, paene nil. 

01182020, 11:03 PM
Post: #6




RE: Books about CAS
Hello Jonathan,
(01142020 08:56 PM)Jonathan Busby Wrote: If it's possible, you might want to use an ARM Cortex M4 embedded CPU for your calculator, as one can then use the embedded versions of the GNU MultiPrecision ( aka "Bignum" ) library, without having to start from scratch See the following link : https://singletonresearch.com/2017/07/11...cortexm4/ Thanks, that's an impressive library, and appears to be well documented. It would be cool to use it on the higher performance Cortex M7. If I can get something simple to work, e.g. addition function (page 33 in pdf manual) "void mpz_add (mpz t rop, const mpz t op1, const mpz t op2)" then I should be able to add the rest over time Everything will be alright in the end. If it's not alright, then it's not the end. 

01192020, 04:38 PM
Post: #7




RE: Books about CAS
(01182020 11:03 PM)Nad Wrote: Hello Jonathan, Yeah It's an easy to use library and it's *very* fast If you're confused as how to get your code working, then I'll give a short explanation :
Hope this helps Regards, Jonathan Aeternitas modo est. Longa non est, paene nil. 

01222020, 03:00 AM
Post: #8




RE: Books about CAS
I love this forum so much  grateful to everyone here.


01222020, 03:05 AM
Post: #9




RE: Books about CAS
Computing Handbook, 3rd Edition
Edited by Teofilo Gonzalez and Jorge Diaz Herrera Editor In Chief Allen Tucker CRC Press https://www.pdfdrive.com/computinghandb...66057.html 

01232020, 04:29 PM
Post: #10




RE: Books about CAS
(01222020 03:05 AM)Eddie W. Shore Wrote: Computing Handbook, 3rd Edition That looks to be a very interesting book  thanks for the info Regards, Jonathan Aeternitas modo est. Longa non est, paene nil. 

01232020, 09:51 PM
Post: #11




RE: Books about CAS
(01232020 04:29 PM)Jonathan Busby Wrote:(01222020 03:05 AM)Eddie W. Shore Wrote: Computing Handbook, 3rd Edition 1 + Thanks for sharing this Eddie. It's a huge book, and relatively recent (2014), both unexpected for a free resource. Bob Prosperi 

01242020, 12:13 AM
(This post was last modified: 01242020 02:37 AM by Nad.)
Post: #12




RE: Books about CAS
Hello!
Yes thanks Eddie, and thank you Jonathan for the tips on implementing Bignum. I will need help to get started, but should be O.K. once I've implemented a few functions I'll report on how I'm going. The prototype is up and running (from Dan's webpage, my setup is the same): 11 GPIO pins are used by the display but only 16 GPIO pins could be found on the development board (even though the i.MX RT1010 mcu has 44 GPIO pins, according to the datasheet), leaving only 5 pins for the keypad (it needs 14). So an Arduino was used to scan the keypad and send the number of the key pressed to the mcu, which works nicely. The 500 MHz CortexM7 core in the i.MX RT1010 is fast  the Mandelbrot set with 250 iterations per pixel is drawn in under 3 seconds  and the 480x320 display shows some nice detail: A big challenge is to go from the prototype to a hand held version. There are a number of small form factor boards that could perhaps be used, such as the Teensy 4.0, which features an even more powerful member of the i.MX RT family running at 600 MHz. Everything will be alright in the end. If it's not alright, then it's not the end. 

01242020, 03:53 PM
Post: #13




RE: Books about CAS
(01242020 12:13 AM)Nad Wrote: Hello! You're welcome and awesome work! Regards, Jonathan Aeternitas modo est. Longa non est, paene nil. 

01312020, 06:44 AM
(This post was last modified: 01312020 06:47 AM by Nad.)
Post: #14




RE: Books about CAS
Hello!
Thanks, it's a pretty exciting project Looking through the Bignum source code I'm not sure if assembly code for the inner loops has been written for the CortexM family. There are generic C functions that aren't as fast  this is perhaps what the CortexM4 implementation mentioned above is using. For this reason I may go with my original plan of writing my own mixed C/assembly routines for multipleprecision integers and rationals. Hopefully it won't be too difficult. I will first do addition, followed by multiplication, then GCD. Subtraction and division then follow pretty easily. I'll need to brush up on GNU syntax assembly, as the MCUXpresso IDE uses the GNU ARM toolchain. But before that I need to determine the data types to use. A rational can be represented by a struct consisting of 2 multiple precision integers, which is what I think Bignum does. Structs and creating new data types is new territory for me. Here is an overview of the steps I'll take to add two multipleprecision integers: 1) Choose precision. Bignum calls the words "limbs' and I'll use the same terminology. Start with say 4 limbs to make debugging easier (i.e. four 32bit words) and create new data type "mpz" (as in Bignum). Convert string entered by user to value and use malloc() to push onto stack. Same for second argument. 2) Pressing "+" calls assembly routine to add with carry corresponding words, then use free() to remove second argument from stack and write sum to memory occupied by first argument. 3) Convert result to string for display. The only way I know to do that is to subtract multiples of powers of 10, keeping count as you go, until you reach zero. I'll try this in a simulator and report back. Dan said he is aiming to upload the opensource firmware to GitHub by March so hopefully I'll have something to try on the real thing soon Nad P.S. Talking about data types and memory representation, how are things like "x", pi, sqrt(2), "x^3 +y" etc. stored in memory in a CAS? Everything will be alright in the end. If it's not alright, then it's not the end. 

01312020, 06:39 PM
(This post was last modified: 01312020 07:16 PM by Jonathan Busby.)
Post: #15




RE: Books about CAS
(01312020 06:44 AM)Nad Wrote: P.S. Talking about data types and memory representation, how are things like "x", pi, sqrt(2), "x^3 +y" etc. stored in memory in a CAS? Usually, the CAS has some internal representation for algebraic expressions that's easy to convert to a string. The internal representation could be the AST ( Abstract Syntax Tree ) or something derived from it. In this format it's easy to manipulate the expressions for the purposes of eg. term rewriting and it's also possible to quickly evaluate the expression, assuming all free variables in the expression have been instantiated. In the case of the 48, the CAS has a stack based, RPN, "metaobject" intermediate representation for symbolic expressions when the CAS needs to transform or manipulate the expression. Such expressions are stored as symbolic objects in another "intermediate representation" which are essentially the same as any other composite object such as lists or secondaries, and, with xEVAL, they're also executable. The symbolic object can contain a mix of variables, functions, and constants etc. basically any RPL word that makes sense in a symbolic. If the CAS needs the value of the symbolic, then EVALing it is quite quick since it can be directly executed like a secondary, assuming that all free variables are bound. In terms of term rewriting and other functions, IIRC, I think that the stack based, RPN, metaobject representation is used. Regards, Jonathan NOTE #1 : The technical definition of a SysRPL metaobject is essentially an RPL composite object that has been serialized onto the stack via =INNERCOMP, where the first element on the stack is a system binary integer which indicates the number of objects that have been pushed to the stack. Aeternitas modo est. Longa non est, paene nil. 

01312020, 07:52 PM
Post: #16




RE: Books about CAS
(01312020 06:44 AM)Nad Wrote: Hello! It's actually using the full blown GMP library AFAIK Quote:For this reason I may go with my original plan of writing my own mixed C/assembly routines for multipleprecision integers and rationals. Hopefully it won't be too difficult. It won't be easy You'll need to use advanced methods suich as Karatsuba multiplication and / or FFT based multiplication if you want to operate on **extremely huge** numbers Quote: I will first do addition, followed by multiplication, then GCD. Subtraction and division then follow pretty easily. I'll need to brush up on GNU syntax assembly, as the MCUXpresso IDE uses the GNU ARM toolchain. Well, the GNU GMP library uses pairs of mpz_t integers to represent rationals, but, the numbers must be "canonicalized" so that the numerator and denominator don't share any factors and the denominator is positive You'll need to implement a GCD function first so you can prevent the integers representing the rational from becoming very large too quickly From the GMP manual : Code: Rational numbers are stored in objects of type mpq_t. Quote:But before that I need to determine the data types to use. A rational can be represented by a struct consisting of 2 multiple precision integers, which is what I think Bignum does. Yep Quote:3) Convert result to string for display. The only way I know to do that is to subtract multiples of powers of 10, keeping count as you go, until you reach zero. Well, one usually just uses a "modulo and divide loop" eg . : Code: loop: The above algorithm is naïve though, and much faster algorithms can be used. See eg. here . Regards, Jonathan Aeternitas modo est. Longa non est, paene nil. 

02012020, 05:20 AM
(This post was last modified: 02012020 05:40 AM by Nad.)
Post: #17




RE: Books about CAS
Hello Jonathan,
Thanks for the replies. I'll definitely need to pick your brain when I start thinking about code for implementing some CAS functionality Aren't / and % for the C integer types? I don't think those functions can be used for converting multipleprecision integers (in binary) to strings. EDIT: I think I get it now, you must have meant division and remainder functions for mpz's. I'll have another look at the documentation for Bignum to see if there is info on the conversion algorithms used. Nad Everything will be alright in the end. If it's not alright, then it's not the end. 

02012020, 03:51 PM
Post: #18




RE: Books about CAS
(02012020 05:20 AM)Nad Wrote: EDIT: I think I get it now, you must have meant division and remainder functions for mpz's. I'll have another look at the documentation for Bignum to see if there is info on the conversion algorithms used. Yep It was just pseudocode For the mpz_t data type in the GMP library you'd need to use the, eg. mpz_cdiv_q() , and the mpz_mod() functions Regards, Jonathan Aeternitas modo est. Longa non est, paene nil. 

02092020, 05:24 AM
Post: #19




RE: Books about CAS
Hello,
I've written assembly routines for string to mpz conversion as well as addition/subtraction of 100 digit mpz's (I set LIMB to 11 so mpz_max = 2^(11 x 32) > 10^100). I had some difficulties with malloc() so for the 100level stack I'm using a 100x11 array, and everything is working nicely. The next step is multiplication, division and GCD of mpz's. Then I'll expand to rationals and finish my Bignum implementation with a function to display mpq's (later I can add exponentiation). I picked this book up in a secondhand book store the other day. It's a nice introduction to the algorithms and concepts used in a CAS. There is also a video on it: The author suggests implementing polynomials after Bignum. I think I'll try univariate polynomial addition/subtraction soon Everything will be alright in the end. If it's not alright, then it's not the end. 

05012020, 02:42 AM
(This post was last modified: 05122020 02:29 AM by F73P.)
Post: #20




RE: Books about CAS
(02092020 05:24 AM)Nad Wrote: ...for the 100level stack I'm using a 100x11 array... I would avoid using a fixedlength array representation for the following reasons: 1) The size of numbers is limited by the number of limbs 2) A considerable amount of memory is wasted storing highorder 0's 3) Processor time is wasted performing arithmetic operations on highorder 0's Even storing the polynomial x^2 + 5x + 6 will waste large amounts of memory since the coefficients and exponents are stored as rationals. E.g. using 11 limbs would require 6 x 22 = 132 limbs = 528 bytes for a 32bit processor. A better approach is to use dynamic array representation, as described by the creators of Maple in the book "Algorithms for Computer Algebra". This method is also used in Mathematica. Since the integers in this example are small, only two words are required for each  one to store the length of the integer in limbs and the other the value of the limb. So the polynomial now requires only 6 x 4 = 24 words = 96 bytes. 

« Next Oldest  Next Newest »

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