Looking for TVM formulas

04042014, 10:12 PM
(This post was last modified: 04042014 10:13 PM by Dave Britten.)
Post: #23




RE: Looking for TVM formulas
(04042014 09:44 PM)Jeff_Kearns Wrote:(04042014 02:07 PM)Dave Britten Wrote: Program size is currently 478 steps, and I figure there will be another 150200 when all that is implemented. TVM solver, mostly. The TI95 has lots of RAM to work with, for a keystroke programmable calculator (about 8KB), and the default partitioning gives you about 1000 steps/bytes of work RAM to use for coding. Programs can be saved/loaded/executed from the file partition, which defaults to about 5KB (5000 steps or so). There are also instructions to save ranges of registers into the file memory for later retrieval. With default settings, you get 125 storage registers, all addressible directly or indirectly (any register can be used for indirection). I think it's also possible to shrink file space to zero, and rely on an 8/32 KB expansion module for your file storage, but you'd have to be working with some enormous programs to need that. Off the top of my head, these are the routines in the program so far: 1. Main menu  Allows accessing the TVM menu, or selecting Begin/End modes. Amort will be accessible from here when I implement it. 2. TVM menu  Shows the 5 TVM variables, and allows storing a value into each, or requesting solutions. The 95 allows testing for the INV prefix key being used to modify a soft key, so each of the five soft key handlers checks for it, calls one of five "solve" routines if needed, then puts the display value into the selected variable. 3. Five "solve" routines  Three of these are direct solutions (PV, PMT, FV), and the other two prepare... 4. ...The numeric solver  A straight port of the HP 20S solver, with a couple changes specific to this progra. It chokes on overflows trying to solve for n or i% in the Susan example, so I probably ought to replace it. Works okay for 'typical' problems, but isn't particularly fast, as it's lacking any initial guess logic (just starts at 1). 5. ln(1+x)  Uses numeric methods discussed in this thread. 6. e^x  1  Ditto. 7. (1 + i%)^n  Uses the ln(1 + x) routine for greater accuracy. Needed by all of the solution equations. 8. ((1 + i%)^n)  1  Also uses e^x  1, and again needed by the solutions. 9. i% Routine  Returns i% / 100 for calculations. Needs to have some of the repeat calls optimized away. 10. Begin/End Routine  Returns 1 or 0 if Begin or End is selected, respectively. 11. Solver equation  TVM equation with one side solved for zero, for use with numeric solver routine. So, the (somewhat) redundant direct solutions, menu handlers, math utility routines, and included numeric solver explain the size. Also, the TI needs something like three bytes (steps) for goto, gosub, STO, RCL, comparison tests, and other instructions that require an argument, to allow for the full three or four digits used in the addresses. Any functions prefixed with INV will also use another byte for the prefix. 

« Next Oldest  Next Newest »

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