# HP Forums

Full Version: Four-Level RPN and the Real World
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hello there.

Please humour me on this one.

After seeing the posts about the Batman graph posted here a few weeks ago and the fact that the WP-34S can be configured with an 8-register stack, I got to wondering about just how complex the equations in the physical, biological, medical, etc. sciences really are.

So, with that said, just how is it that four levels of an RPN stack are sufficient for application and usage in the mathenatics for the sciences?

Or, are the mathematics in the sciences not that complex being that everthing from the HP-65 to the HP-41 and afterwards has sufficed for use in the real world?

Edited: 12 Dec 2013, 4:49 p.m.

Hi there,

Quote:
how is it that four levels of an RPN stack are sufficient for application and usage in the mathenatics for the sciences?

They aren't. They are sufficient for the majority -- but I've experienced problems every once and a while requiring at least five levels. Presumably six levels would catch all problems worked inside out. The reason why the WP 34S features eight levels is complex domain.

d:-)

A 4-level RPN stack + a couple of storage registers does the trick

Please enlighten me. Just what range of calculations are you speaking of?

Quote:
A 4-level RPN stack + a couple of storage registers does the trick

"A couple of storage registers" simply means missing stack levels. Not a problem with a virtually unlimited stack;-)

Except there are advantages to have storage registers in certain situations where a virtually unlimited stack is cumbersome and lacking the neatness of the 4-level stack. And so I really do prefer the HP-41 over the RPL machines like the 48 - from simple calculations to really complex ones.

Quote:
Except there are advantages to have storage registers in certain situations where a virtually unlimited stack is cumbersome and lacking the neatness of the 4-level stack.
As written above, not a problem with a virtually unlimited stack. You can limit stack usage as you like, and you can use variables and "register" arithmetic for calculations in combination with an unlimited stack, too.

With an unlimited stack, you are just not...ahem, limited;-)

Still there are many times I would prefer the T-register behavior of a 4-level stack and that it rolls around on only four levels. The use of fixed registers is of course a feature beyond the stack in that they are... fixed :-)

So an eight level stack is a good compromise: featuring D-level repetition AND high enough four all formulas.

d:-)

Quote:
high enough four all formulas.

`              ^^^^`
The spelling might indicate an unconscious preference for the superior 4-level stack :-)

Your RPN formulae can address registers of which there are 67 in an HP-15C, for example. These can be used to represent the variables in more complex calculations with intermediate storage when more than a couple of stack levels are required.

Edited: 13 Dec 2013, 6:32 a.m.

So sorry, Mr. Freud ;-)

Yes, it IS a very good compromise. Just one of the many excellent design decisions made in the 34S.

If I am just evaluating an equation and entering values in as necessary, then a 4 level stack can be sufficient for quite complex equations. However, if I enter values that are then reused in the equation multiple times, it is a different story.

In the first case, you are using the RPN stack to perform operations and hold intermediate results, which it is well designed for, is efficient and elegant.

In the second case you are using the stack to juggle input data as well as perform operations and hold intermediate results and that can cause a lot of grief, depending on the number of input variables and where in the equation they happen to be (re)used.

I find that a lot of stack manipulation and use of registers happens not because of the complexity of an equation, but because of the desire to move data around to put it into place for the equation. I think of those as unrelated problems.

That's why some kind of formula evaluation capability makes a lot of sense. RPN makes single evaluation straightforward (and so much fun), but reusing the algebra means you have to write a program. That's fine if I have to perform the calculation 100 times, but what if I need it just twice? It isn't really cost-effective... I always keep around a formula calculator for this. In an EOS calculator you'd just get back, edit the line and evaluate again. Keeping simple things simple has its beauty too.