HP Forums
HP 38G: Old Programme - What Does It Do? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: HP 38G: Old Programme - What Does It Do? (/thread-4062.html)



HP 38G: Old Programme - What Does It Do? - Gerald H - 06-03-2015 12:43 PM

I found one of my old programmes recently & can't work out what it does.

Input is a real via Ans, output is a list of 3 integers in Ans, positive or negative.

Can anyone say what the programme is for?

MAX(ABS(Ans),2)►N:
DO
ROUND(N*(RANDOM,RANDOM),0):
{RE(Ans)^6,RE(Ans)^4,RE(Ans)^3,RE(Ans)^2,RE(Ans),
IM(Ans)^6,IM(Ans)^4,IM(Ans)^3,IM(Ans)^2,IM(Ans)}:
IFTE(RANDOM<.5,{Ans(7)+8*Ans(3)*Ans(10),4*(Ans(2)-Ans(5)*Ans(8)),Ans(6)-20*Ans(3)*Ans(8)-8*Ans(1)},
{6*Ans(4)*Ans(9)-3*Ans(2)+Ans(7),6*Ans(9)*Ans(4)-Ans(7)+3*Ans(2),6*(3*Ans(2)+Ans(7))*Ans(10)*Ans(5)}):
UNTIL
ΠLIST(Ans)
END:


RE: HP 38G: Old Programme - What Does It Do? - Dave Britten - 06-03-2015 12:54 PM

Not having messed with my 38G in a while, what does Ans(7) (and the like) do? Is it implied multiplication, or does that index into a list of previous answers like on the TI-92/89? Or something else entirely?


RE: HP 38G: Old Programme - What Does It Do? - Gerald H - 06-03-2015 01:04 PM

Ans(7) in this case gets the 7th element of the list in Ans.


RE: HP 38G: Old Programme - What Does It Do? - Dave Britten - 06-03-2015 01:23 PM

So let's see, take the input value, or 2 if it's less than that, and multiply it by a random complex number.

Then build an 8-element list of the real and imaginary parts of that result raised to the powers 6, 4, 3, and 2.

Then take that list, flip a coin, and return one of two three element lists composed of various sums/products of those real/imaginary parts.

If any of those three elements is zero, i.e. ΠLIST(Ans) returns 0, start again from the beginning with a new random complex number.

So I know what it's doing, but I haven't a clue why. It honestly just looks like a simple list and Ans manipulation test program.

Does the program name indicate anything?


RE: HP 38G: Old Programme - What Does It Do? - Gerald H - 06-03-2015 01:26 PM

It's a 10 element list.

Name of programme is P224- which doen't say much to me now & I never named the programmes consecutively.