Post Reply 
Programming Exercise (HP-15C, 15C LE - and others)
03-30-2014, 12:07 AM
Post: #63
RE: Programming Exercise (HP-15C, 15C LE - and others)
(03-28-2014 03:18 AM)bkn42 Wrote:  I implemented the two term version of this on my "HP55".
Here is the code (sorry its not in location/keycode form but you get the idea):
Code:

  1 -
  STO 0
  0
  STO 1
08:  X<>Y
  ENTER
  ENTER
  *
  +
  1/x
  STO + 1
  2
  STO - 0
  RCL 0
  0
  X<=Y 0 8
  RCL 1
  GTO 0 0
R0 holds the current iteration and R1 is the series sum.

For N=100, it took about 82sec to finish. Based on this it would take about 2.25hours for N=10000.

The following is a direct conversion of the HP-15C program to calculate pi in the beginning of this thread, so it's rather long: 49 steps, all the programming memory space of the HP-55!

Code:

01 ENTER
02 STO  
03 0
04 STO
05 + 
06 0
07 4
08 STO 
09 1
10 *
11 1/x
12 +
13 1/x
14 STO 
15 2
16 CLx
17 ENTER
18 ENTER
19 Rv
20 Rv
21 1
22 STO
23 -
24 0
25 Rv
26 RCL
27 1
28 CHS
29 STO 
30 1
31 RCL 
32 0
33 /
34 +
35 1
36 STO
37 - 
38 0
39 Rv
40 RCL
41 0
42 2 
43 f
44 x<=y 19
45 Rv
46 Rv
47 RCL
48 2
49 +

66 R/S --> 3.141592654 (2 m 37 s)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming Exercise (HP-15C, 15C LE - and others) - Gerson W. Barbosa - 03-30-2014 12:07 AM



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