Post Reply 
2023 RPN HHC Programming Contest
10-09-2023, 04:27 AM
Post: #40
RE: 2023 RPN HHC Programming Contest
My best:
Code:
01 LBL "HHC"
02 PI
03 INT
04 ATAN
05 INT      # 71 on stack here
06 PI
07 x^2
08 FRAC
09 ATAN
10 INT      # 41 on stack here
11 .END.

I think this is equal to the previous best.


I found one other approach for the first half 71, but I don't consider it as pure since it relies on a zero on the stack:
Code:

ACOS ->DEG SQRT INT

I did find two equal length alternative solutions for the second half 41:
Code:

PI PI ->POL INT - 
PI ->H 10^x SQRT INT

Since I was using my 11c for this, I did locate a neat solution for 41, but not suitable for the 41, because it requires gamma:
Code:

PI LOG x! ATAN INT

On the 11c there is a single step shorter solution available but, sadly, also not available on the 41 due to the use of an hyperbolic function. The first step is quite malleable, there being multiple alternatives to get 1 on the stack: x!, 10^x or EXP are equally good.
Code:

COS ASINH ATAN INT


I didn't properly investigate deriving 41 from 71 or viceversa but the best I could manage wasn't shorter. For example (with 71 on the stack and the prior value in last x):
Code:

LASTx SIN x^2 ATAN INT

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


Messages In This Thread
2023 RPN HHC Programming Contest - Gene - 10-07-2023, 01:00 PM
RE: 2023 RPN HHC Programming Contest - Paul Dale - 10-09-2023 04:27 AM



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