Posts: 4,587

Threads: 105

Joined: Jul 2005

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:-)

Posts: 896

Threads: 183

Joined: Jul 2005

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

Posts: 125

Threads: 9

Joined: Oct 2011

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. *

Posts: 189

Threads: 39

Joined: Nov 2011

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.