The following warnings occurred:
Warning [2] Undefined array key 68077 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 68084 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 68086 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 68086 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





Accurate TVM for HP42S



#2

An accurate TVM equation written as a program for the HP42S Solver.

n   number of periods
i interest rate
PMT periodic payment
PV present value
FV future value
B/E BEGIN/END
Solve equation:
PMT*(i1-1)*(1/i+p)+PV*i1+FV=0

where (i1-1) = e1^(n*ln1(i))
and i1 = e^(n*ln1(i))
and ln1(x) = ln(1+x)
and e1(x) = e^x-1
p=0 for END, p=1 for BEGIN


The use of ln1+x and e^x-1 prevents the loss of significant digits for small values of i. Consider these extreme examples for accuracy checking:

Example 1:
n=63
i=0.00000161
PV=0
PMT=-1,000,000
END Mode (set B/E=0 in Solver)
Solving for FV:

HP 42S: 63,000,031.4434 (correct is 63,000,031.4433)

Example 2:

n=31536000
i=10/n
PV=0
PMT=-0.01
END Mode
Solving for FV:

HP 42S: 331,667.006689 (correct is 331,667.006691)


You might compare these results using the "normal" TVM equation, found in many manuals ;)

E.g. using the TVM equation in the 42S manual, we get
62,921,744.4422 and 311,565.594018 respectively.


The program:

00 {91-Byte Prgm }
01 LBL "TVM"
02 MVAR "N"
03 MVAR "I%"
04 MVAR "PV"
05 MVAR "PMT"
06 MVAR "FV"
07 MVAR "B/E"
08 RCL "I%"
09 100
10 /
11 LN1+X
12 RCL* "N"
13 E^X-1
14 RCL* "PMT"
15 RCL "I%"
16 100
17 /
18 1/X
19 RCL+ "B/E"
20 *
21 RCL "PV"
22 RCL "I%"
23 100
24 /
25 LN1+X
26 RCL* "N"
27 E^X
28 *
29 +
30 RCL+ "FV"
31 END


Edited: 23 Jan 2005, 12:13 p.m.


#3

hi tommi,

yes indeed. that is a good way to tackle the problem. i wrote a page on this problem (also with the same test case)

http://www.voidware.com/tvm.htm

there's some stuff about how to fix it when you dont have the ln1 and exp1 functions (see the 15c case). also solving for `i' is interesting. checkout the references at the end too.

cheers,


#4

Yes, the second test case is well-known. Also known as "A Penny for your Thoughts", see Mathematics Written in Sand

The first test case is from Hewlett-Packard Journal, October 1977.

In fact, while lnx+1 and e^x-1 are useful indeed, even better would be the super accurate

((1+i)^n-1)/i

found in many HP financial calculators. At least in HP-37E, n can also be fractional, while HP-12C only works with INT(n), of much less use. Don't know how other HP financial calculators behave in this respect.

Cheers!


Edited: 23 Jan 2005, 5:02 p.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  TVM again ;-) fhub 17 4,756 09-02-2013, 11:03 AM
Last Post: fhub
  wp34s (Why it's so accurate) Barry Mead 22 5,250 08-05-2013, 08:51 AM
Last Post: fhub
  TVM WP34s trouble Jim P 4 1,723 06-28-2013, 07:31 AM
Last Post: fhub
  TVM-Solver for the PC fhub 14 3,876 12-26-2012, 03:24 PM
Last Post: fhub
  [WP34s] New TVM-solver version fhub 43 10,574 12-26-2012, 06:12 AM
Last Post: fhub
  [WP34s et al.] Solving the TVM equation for the interest rate Dieter 24 5,790 12-01-2012, 05:53 AM
Last Post: Paul Dale
  12c TVM problems where N is less than 1? James 29 7,296 11-25-2012, 11:50 AM
Last Post: Werner
  HP42S John Mosand 5 2,400 07-22-2012, 03:13 AM
Last Post: Les Koller
  HP42S graphics Han 2 1,509 07-20-2012, 12:23 AM
Last Post: Raymond Del Tondo
  HP42s ROM aurelio 18 8,340 06-26-2012, 09:36 AM
Last Post: Thomas Klemm

Forum Jump: