let a thru z represent values, and operands are the math operators: +, -, *, /, ^ and parenthesis

also lets assume that we have: reverse subtract (r-) ,reverse divide (r/) and reverse power (r^)

such that x y r/ would be y/x instead of x/y.

the question: is there a way to write a infix to postfix program to minimize the stack depth ?

for example: x/(1+x/(1+x/(1+x))) --> x 1 x 1 x 1 x + / + / + /

i would like to have: 1 x + x r/ 1 + x r/ 1 + x r/

any book recomendations, examples or ideas are welcome.

also lets assume that we have: reverse subtract (r-) ,reverse divide (r/) and reverse power (r^)

such that x y r/ would be y/x instead of x/y.

the question: is there a way to write a infix to postfix program to minimize the stack depth ?

for example: x/(1+x/(1+x/(1+x))) --> x 1 x 1 x 1 x + / + / + /

i would like to have: 1 x + x r/ 1 + x r/ 1 + x r/

any book recomendations, examples or ideas are welcome.

If you're handling only binary operators and brackets, look up a parsing technique called "operator precedence".

Also see a compression algo called "sequitur".. it could be adapted to simplify bracketed formulae via tokenization, and would be a remarkably efficient way to do this, especially where the formula is expressed purely algebraically.