PC-1211, PC-1250, etc. TVM
|
06-01-2024, 01:07 PM
Post: #8
|
|||
|
|||
RE: PC-1211, PC-1250, etc. TVM
(05-31-2024 10:39 PM)Albert Chan Wrote: Instead of NPV = 0, solve NPMT = 0 for rate may be better. Nice. This seems to work better. Do you have a reference to an article or implementation? (05-31-2024 10:39 PM)Albert Chan Wrote: 60 DISP 100*I,Y @ IF V/I+I/V<>2 THEN 50 The termination test V/I+I/V<>2 may not be accurate when solving for NPV=0 or for NPMT=0. For example, solving NPV=0 in 10 digits BCD precision for the TVM example gives I=4.753367173 and previous guess V=4.753337033 because V/I=.9999936592 and I/V=1.000006341 sum to 2.000000000 with 10 digits. Solving for NPMT=0 gives I=4.753367191 and V=4.753366979, with I being very close though. But when I try 1+V/I<>2 I get the exact rate I% when solving for NPV=0 or for NPMT=0. Also with 10-V/I<>9 or the similar 9+V/I<>10 to shift out irrelevant last digit to mitigate rounding errors. Or ABS((V-I)/I)<1E-9 which checks for a specified relative error 1E-9. Or check if |Y|<E for Y with error E but this won't terminate when we desire a reasonable E=1E-9 or even E=1E-8 to solve for Y=NPV=0 with 10 digits BCD evaluation (i.e. on a decent calc). Now, the test set is too small to make sweeping conclusions. It just illustrates that the termination criterium is important to obtain some level of accuracy while avoiding non-termination. Bisection terminates, which might be a better but slower alternative. - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)