PC-1211, PC-1250, etc. TVM
|
06-07-2024, 02:30 AM
(This post was last modified: 06-08-2024 08:10 PM by robve.)
Post: #29
|
|||
|
|||
RE: PC-1211, PC-1250, etc. TVM
(06-06-2024 12:27 AM)Albert Chan Wrote: If you have good EXP, LN, you can build accurate EXPM1 LNP1 Like this cryptic line to compute L=LN(1+J) and S=(1+J)^-N and R=S-1: Code: 40 J=.01*I,K=1+J*B,C=0,L=1+J,L=LN L-(L-1-J)/L,S=-N*L,R=EXP S,R=R-1-(LN R-S)*R,S=R+1 : RETURN Replace line 40 to 43 with the above line. With Dieters formulas there are a few minor changes for the more extreme examples, while the other examples and the 27 TVM problems I tested remain unaffected: 2) comp FV => -900 (which is closer to -1000 and the same result as TI BA, but is a tricky one) 4) comp FV=5527.782902 (tiny bit better in the very last digit +/- 3) comp I%=1.902587522E-05 (slightly better in the last 2 digits) 5) comp FV=5260.382453 (slightly better in the last 2 digits) comp I%=3.170988253E-07 (somewhat worse, but in both cases only first 5 digits are precise and this result just differs by more) 6) comp I%=3.1248997E-06 (somewhat worse, but in both cases only the first 3 digits are precise and this result just differs by more) It is a bit mixed pro/cons perhaps, but I do like the improved FV accuracy. EDIT: I should mention that SHARP PC round to 10 digits when storing values in variables. But internally 12 digits are used. This matters when calculating EXPM1 and LNP1. EDIT 2: do not use this method to compute EXPM1 and LNP1, because for larger negative S we get R=0 and LN(R) stops with an error. - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)