HP41 RPN program solution sought  test problem

10272021, 08:03 PM
Post: #1




HP41 RPN program solution sought  test problem
What's the best (shortest meant here) way you can devise to program a solution to this problem in HP41 RPN?
Enter an angle in degrees mode and press A to return the answer. So start with LBL A and evaluate: Equation T = ... What can you come up with ? Gene 

10272021, 09:05 PM
Post: #2




RE: HP41 RPN program solution sought  test problem
I hope this is not completely stupid, but I'll try (without testing):
lbl A xeq deg sto 01 sqrt 1 + sto 02 sin 2,5 * sto 03 pi / rcl 02 cos rcl 01 sin / + rcl 03 / My calculators  former: CBM PR100, HP41CV, HP11C, HP28S  current: HP48G(+), HP35S, Prime, DM41X, DM42 

10272021, 09:19 PM
(This post was last modified: 10272021 09:20 PM by Gerson W. Barbosa.)
Post: #3




RE: HP41 RPN program solution sought  test problem
Assuming angle mode is DEG:
Code:


10282021, 06:33 AM
Post: #4




RE: HP41 RPN program solution sought  test problem
I can shave off one byte:
Code: 01 LBL A Cheers, Werner 

10282021, 08:39 AM
Post: #5




RE: HP41 RPN program solution sought  test problem
(10272021 08:03 PM)Gene Wrote: What's the best (shortest meant here) way you can devise to program a solution to this problem in HP41 RPN?First I draw it in my preferred graphical calculator https://www.desmos.com/calculator/pop31xijnj?lang=de And in the time I was drawing (took 5min), smarter ones has give to you some solutions. I was not quick enough ;) HP71 & Multimod, HP41CV/CX & Nov64d, PILBOX, HPILPRINTER 82162A, RS232 HPIL interface, Debian11 64bitsPC w/ pyILPER, V41R9F & EMU71 

10292021, 05:27 PM
Post: #6




RE: HP41 RPN program solution sought  test problem
Great job Werner!
I was curious and comparing it to an algebraic (AOS) version. That was 39 steps/bytes. 

10312021, 12:58 PM
(This post was last modified: 10312021 01:04 PM by C.Ret.)
Post: #7




RE: HP41 RPN program solution sought  test problem
(10282021 08:39 AM)floppy Wrote: First I draw it in my preferred graphical calculator https://www.desmos.com/calculator/pop31xijnj?lang=de Nice plotter, except that it is missing the important fact that x have to be in degrees (not radians nor Bogenmaßen). (10292021 05:27 PM)Gene Wrote: I was curious and comparing it to an algebraic (AOS) version. That was 39 steps/bytes. Let's have a try. Assuming that the complicated function can be simplify as W.Barbosa and Werner have done: \( f(x)=\frac{\frac{2.5\times sin(\sqrt{x}+1)}{\pi}+\frac{cos(\sqrt{x}+1)}{sin(x)}}{2.5\times sin(\sqrt{x}+1)}=\frac{1}{\pi}+\frac{.4}{sin(x)\times tan(\sqrt{x}+1)} \) And using a blue TI57 LCD using certified AOS technology: STO0 .4 ÷ ( RCL0 sin × ( 1 + RCL0 √x ) tan ) + ∏ 1/x = R/S RST The last too steps are optional but useful in program; so this function can be recorded using 22 steps (or bytes) in LRN mode. 

10312021, 05:43 PM
Post: #8




RE: HP41 RPN program solution sought  test problem
(10312021 12:58 PM)C.Ret Wrote: And using a blue TI57 LCD using certified AOS technology: Perhaps you can save one byte by eliminating the parentheses: STO0 √x + 1 = tan × RCL0 sin × 2.5 = 1/x + ∏ 1/x = R/S RST 

10312021, 08:54 PM
(This post was last modified: 10312021 09:08 PM by C.Ret.)
Post: #9




RE: HP41 RPN program solution sought  test problem
(10312021 05:43 PM)Gerson W. Barbosa Wrote: Perhaps you can save one byte by eliminating the parentheses: Good suggestion : STO0 √x + 1 = tan × RCL0 sin ÷ .4 = 1/x + ∏ 1/x = R/S RST (one Werner's step spare here) STO0 √x + 1 = tan 1/x EXC0 sin STO÷0 .4 STO×0 ∏ 1/x STO+0 RCL0 R/S RST (two more steps spare , but, is this still AOS logic ?) 

10312021, 09:17 PM
Post: #10




RE: HP41 RPN program solution sought  test problem
If it can be keyed on a TI57 or TI58C, then we will call it AOS. :)
Gene 

« Next Oldest  Next Newest »

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