Post Reply 
(71B) calculate interest rate
12-20-2019, 10:10 PM
Post: #3
RE: (71B) calculate interest rate
(12-20-2019 08:36 PM)Joe Horn Wrote:  Wouldn't using the HP-71's built-in EXPM1 and LOGP1 functions be even more accurate?

Thanks! I don't know HP71B had both expm1 and logp1 built-in. The revised code is much shorter.

Code:
10 INPUT "n, fv, pv, pmt ? ";N,F,P,M
20 DEF FNF(I) @ Y=F+P+(M/I+P)*EXPM1(N*LOGP1(I)) @ DISP I,Y @ FNF=Y @ END DEF
30 I1=-(M*N+P+F)/(N*((N-1)/2*M+P))
40 I2=.9*I1
50 DISP FNROOT(I1,I2,FNF(FVAR))

>RUN
n, fv, pv, pmt ? 168, 10925.76, 0, -45
4.79863130882E-3     -655.6829061
5.33181256535E-3     -1255.8749515
4.21615468581E-3     -41.4514876
4.17684617474E-3     -1.4838737
4.17538677149E-3     -.0035171
4.17538330417E-3     -.0000003
4.17538330387E-3     0
4.17538330387E-3

FYI, 1st column is interest rate, 2nd column is error in FV (thus function named FNF)
Example, I=0.479863%, calculated FV=11581.44, under-estimated true FV by -$655.68

Playing emulator interactively, this is unexpected ...

>FNROOT(I1, .5*I1, FNF(FVAR))
MATH ERR:Kybd FN in FNROOT/INTEGRAL
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (71B) calculate interest rate - Albert Chan - 12-20-2019 10:10 PM



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