Post Reply 
HP-42S (Free42, DM-42) mini-challenge – Wallis Product
07-13-2020, 03:32 AM
Post: #27
RE: HP-42S (Free42, DM-42) mini-challenge – Wallis Product
(07-05-2020 03:52 AM)Werner Wrote:  It can be simplified a lot:

Code:
00 { 27-Byte Prgm }
01▸LBL "WP"
02 ENTER
03 STO+ ST Y
04 COMB
05 4
06 LASTX
07 Y↑X
08 LASTX
09 X<> ST Z
10 ÷
11 X↑2
12 X<>Y
13 0.5
14 +
15 ÷
16 END

Yes, it can. If by simplified you don’t mean a lesser byte count, of course.

Code:


00 { 29-Byte Prgm }
01▸LBL "WP"
02 N!
03 STO× ST X
04 0.5
05 RCL+ ST L
06 GAMMA
07 1
08 RCL+ ST L
09 GAMMA
10 ×
11 ÷
12 PI
13 ×
14 END

Limits are 114 and 1166 on the 42S and Free42, respectively. These can be increased to 252 and 2123 at the cost of a couple of steps and three bytes:

Code:


00 { 32-Byte Prgm }
01▸LBL "WP"
02 N!
03 RCL ST X
04 0.5
05 RCL+ ST L
06 GAMMA
07 STO÷ ST Y
08 R↓
09 1
10 RCL+ ST L
11 GAMMA
12 ÷
13 ×
14 PI
15 ×
16 END

Regards,

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP-42S (Free42, DM-42) mini-challenge – Wallis Product - Gerson W. Barbosa - 07-13-2020 03:32 AM



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