Post Reply 
Assorted WP-34S beginner questions
07-21-2014, 11:22 AM
Post: #20
RE: Assorted WP-34S beginner questions
There isn't an internal road map. I really should write one in due course. Others have figured out how to navigate the code base with some success, often the more complicated areas than the numeric code. Thus, there is hope of understanding Smile


Square root, log, exponential and the basic arithmetic are in trunk/decNumber/decNumber.c

Pretty much all the rest of the real functions are in trunk/decn.c This includes the trig and hyperbolic functions. Search for decNumberSin and follow the code from there.


The 34S uses a Taylor series (MacLaurin actually) expansion for the trig functions after a range reduction step. The range reduction is exact for degrees and gradians but not for radians (although it should still be correctly rounded to the internal precision).


The 31S trig code is the slightly more advanced of the two because the 31S has spare flash and the 34S doesn't. This code is in branches/wp31s/decn.c Here the range reduction is followed by an octant reduction which reduces the argument to a small value. This avoids a degenerate case for cosine and provides certainty for things like \(cos(\frac{\pi}{2} + x) = - cos(\frac{\pi}{2} - x)\).


- Pauli
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Code Reading for Dummies - sa-penguin - 07-21-2014, 10:08 AM
RE: Assorted WP-34S beginner questions - Paul Dale - 07-21-2014 11:22 AM



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