A.   Learning and Mastering RPN

Learning RPN is learning to recognize the next small calculation inside a larger one. Supply its operands, perform it, and treat its result as one number. The stack keeps other unfinished parts available while you work. With practice, a long expression becomes a sequence of short, checkable steps rather than a string of symbols to memorize.

Chapter 2 and chapter 3 introduce the controls and first calculations. This appendix develops the planning skill: translating notation, choosing an evaluation order, conserving stack space, reusing values, and checking intermediate results. Work through the examples slowly before trying to minimize keystrokes. A sequence you can explain is more useful than a shorter sequence whose operand order you cannot verify.

A.1   Infix, prefix, and postfix describe the same calculation

An operator can be written between its operands, before them, or after them. These positions give the names infix, prefix, and postfix. Ordinary written arithmetic is mostly infix: in \(8+4\), the plus sign is between 8 and 4. RPN uses postfix: \(8\ 4\ +\) supplies both numbers before asking for their sum. Polish notation puts the operator first; reverse Polish notation puts it last.

Table A.1: Three notations for one expression. Spaces separate complete numbers or operators; these are mathematical descriptions, not literal calculator key sequences.
Notation

The quotient of \(8+4\) and \(7-3\)

Infix

\((8+4)/(7-3)\)

Prefix

\(\div \quad +\quad 8\quad 4\quad -\quad 7\quad 3\)

Postfix

\(8\quad 4\quad +\quad 7\quad 3\quad -\quad \div \)

The postfix description reads as instructions: form 8 plus 4, form 7 minus 3, then divide the first result by the second. Each operator knows how many operands it needs. Addition takes two; square root takes one. Once an operation has used its operands, its result takes their place. The sequence itself therefore identifies the groups that infix notation marks with parentheses.

There is still mathematical grouping to respect. RPN removes the need to enter parentheses; it does not remove your responsibility to recognize them in the original problem. Likewise, there is no pending RPN multiplication waiting to take precedence over an earlier addition. Each mathematical key acts immediately. You choose the order that implements the written expression.

SpicyRPN is a calculator, not a text reader for postfix formulas. Consecutive digits form one number, so typing 8 then 4 enters 84. Use ENTER to separate two newly typed numbers. By contrast, a function already finishes its numeric entry, so its result is ready for the next operation without another ENTER.

A.2   Prepare to see what each key does

Unless a sequence explicitly says otherwise, use RPN, real mode (COMPLEX absent), a fixed stack of 5, 600 working digits, and FIX 4. Show the Scientific panel. Angle units, date order, and payment timing do not affect this appendix’s calculations. No example assumes empty memories; the memory examples explicitly replace the registers they use.

The shared procedure in section 2.2 establishes these settings. If they are already selected, cancel any active shift or pending command, then press f CLEAR, the orange function of \(1/x\). The display should read 0.0000 with no ENTRY or pending-command flag. This is the prepared start below.

Repeat CLEAR before each independent experiment, but do not clear between rows described as successive steps. CLEAR leaves memories, settings, and the separate saved Last operands intact. With a command pending, a clear sequence can cancel that command instead of clearing the stack; first cancel pending commands as described in section 1.8.

Open the full-stack inspector between steps whenever you want to see where a waiting result went. Its small triangle is at the lower right of the display. Inspection does not commit a number or move a value. In this appendix, X means the displayed S0, and Y means S1. The traces put S0/X at the bottom and the deepest register at the top. Integers and fractions denote values; the actual FIX 4 display adds or rounds decimal places. An italic value is still being typed.

If number entry and waiting subtotals already feel familiar, continue with section A.4. The following short refresher is optional.

Optional refresher: when ENTER is needed

During entry, ENTER finishes the number in S0/X; when entry is inactive, it duplicates that value. A new number lifts the stack on its first character. Thus ENTER separates two freshly typed numbers, but is unnecessary between a completed result and a new number. An extra ENTER there leaves an unwanted duplicate deeper in the stack. Section 2.3 and section 3.5 provide worked examples.

A.3   Optional refresher: a waiting intermediate result

Think of each unfinished part as a value with a job. In \((8+4)/(7-3)\), the numerator’s job is to wait while the denominator is calculated. The stack holds it in a deeper register while newer operands occupy X and Y. From the prepared start, press:

f CLEAR 8 ENTER 4 +

7 ENTER 3 \(-\) \(\div \)

Table A.2: Three checkpoints for the quotient, in order. The numerator waits in S2 while both denominator operands are present.

Checkpoint

S0 (X) S1 (Y)

Deeper needed value

Numerator ready

12 0

None

While typing 3

3 7

12 in S2

Denominator ready

4 12

None

The final division uses \(Y/X=12/4\), giving 3.0000. Three useful values coexist at the busiest point; the padding zeros need no attention. Section 3.6 gives a full register-by-register trace of the same pattern. The next section shows how to choose that pattern from the written expression.

A.4   Translate grouping before translating keys

Begin with the last operation the written expression requires. A large fraction ends with division; a sum of two products ends with addition; a square root enclosing a sum ends with square root. Then plan the operands of that final operation. Repeat this process for each smaller part until every input is a number or a value you already have.

For \(3+4\times 5\), the final operation is addition: its operands are 3 and the product 20. For \((3+4)\times 5\), the final operation is multiplication: its operands are the sum 7 and 5. The numbers are the same, but their jobs and evaluation order differ.

Table A.3: Preserving written grouping. Start each row from the prepared RPN settings and f CLEAR. Results omit FIX 4’s trailing zeros.
Expression

Keys after clearing

Result
\(3+4\times 5\)

3 ENTER 4 ENTER 5 \(\times \) +

23
\((3+4)\times 5\)

3 ENTER 4 + 5 \(\times \)

35
\((20-6)-2\)

20 ENTER 6 \(-\) 2 \(-\)

12
\(20-(6-2)\)

20 ENTER 6 ENTER 2 \(-\) \(-\)

16
\(2^{(3^2)}\)

2 ENTER 3 ENTER 2 \(y^x\) \(y^x\)

512
\((2^3)^2\)

2 ENTER 3 \(y^x\) 2 \(y^x\)

64

Notice how two successive operators finish a nested calculation. In \(20-(6-2)\), the first subtraction leaves 4 in X and the waiting 20 in Y; the second subtraction obtains 16. In the power example, the first power obtains \(3^2=9\), and the second computes \(2^9\). The power key always reads base Y and exponent X.

It is often helpful to mark completed subexpressions on paper. Replace \(6-2\) mentally with a single box labeled 4, then read the remaining expression as \(20-4\). An RPN result is exactly that kind of replacement, carried out on the stack.

Single-operand functions finish their own groups

Apply a single-operand function only after its whole argument has been formed in X. Squaring one term and then adding another is different from adding both terms and squaring their sum. A fraction bar or a root sign can group an expression just as parentheses do.

Work outward from an inner difference

Use the prepared RPN start. Calculate
\[ \frac {\sqrt {9+(12-4)^2}}{5}. \]

Square is the orange function of square root. First make the inner difference, square it, add 9, take the root, and finally divide:

f CLEAR 12 ENTER 4 \(-\) f \(x^2\)

9 + \(\sqrt {x}\) 5 \(\div \)

Checkpoints are 8, 64, 73, and \(\sqrt {73}\); the final result is 1.7088. Its retained value begins 1.7088007490635. Every step needs at most two useful stack values.

A.5   Choose an order that fits the stack

The length of a formula does not by itself determine its stack needs. A hundred successive additions can keep only an accumulated sum and one new number. A much shorter expression can need several waiting operands if you enter every outer value before evaluating its nested parts.

A fixed five-register stack can hold five useful values at once. Starting a sixth number discards the previous S4 immediately, on the first entry character. There is no overflow prompt that asks whether that deepest value is still needed. A later drop repeats the new deepest value; it cannot recover the discarded one. Plan space before the lift.

One practical rule is to evaluate the more demanding part first. If a completed left part must wait while a right part uses four positions, you need five positions in total. If the right part is evaluated first, and the left part needs only one position, the second phase needs only two positions. Use SWAP before the final operation when this reverses the required operand order.

For a systematic count, suppose separate evaluations of the left and right parts need peaks of \(L\) and \(R\) useful values. Evaluating left first needs \(\max (L,1+R)\); evaluating right first needs \(\max (R,1+L)\). Choose the smaller count, allowing for the final operand order. A number needs one position, a unary function adds none, and two equally demanding parts need one extra position when combined. These counts describe ordinary arithmetic, without deliberate duplicates or retained-base functions such as percent.

Six nested operands with only two useful positions

Use the prepared RPN start. Evaluate the right-nested quotient
\[ \frac {10}{\displaystyle \frac {20}{\displaystyle \frac {30} {\displaystyle \frac {40}{\displaystyle \frac {50}{60}}}}}. \]

Start with the innermost division, then introduce each outer numerator:

f CLEAR 50 ENTER 60 \(\div \)

40 \(x\leftrightarrow y\) \(\div \) 30 \(x\leftrightarrow y\) \(\div \)

20 \(x\leftrightarrow y\) \(\div \) 10 \(x\leftrightarrow y\) \(\div \)

The successive mathematical quotients are \(5/6\), 48, \(5/8\), 32, and \(5/16\). The final display is 0.3125. Each new outer numerator initially occupies X, so SWAP places it in Y before division by the waiting denominator.

Entering 10, 20, 30, 40, 50, and 60 before doing any arithmetic would require six positions. The following deliberately incorrect alternative overflows the prepared five-register stack and loses the initial 10, producing the incorrect answer 0.6250:

f CLEAR 10 ENTER 20 ENTER 30 ENTER

40 ENTER 50 ENTER 60 \(\div \) \(\div \) \(\div \) \(\div \) \(\div \)

The 10 was lost when 60 began. Repeated deepest-register copies later supply a second 20 in its place. Inspecting only the last division would not reveal how the wrong operand arose.

You can instead choose a larger fixed depth or an unlimited stack with STACK, as explained in section 2.10. Unlimited avoids the fixed-capacity loss but does not supply deepest-register repetition or roll. Another option is ordinary memory. None of these choices removes the need to know what each waiting value represents.

Changing the order in which two independent parts are calculated need not change their internal formulas. By contrast, regrouping a chain of additions or rewriting a quotient algebraically can change its finite-precision rounding. Use a convenient order while retaining the intended grouping, and consult chapter 5 for sensitive calculations.

A.6   The project website’s expression equal to 42

The project’s original online RPN primer includes the following expression.1 It combines nested fractions, powers, a square root, and a product of two grouped expressions:

\begin{equation} \frac {\displaystyle \frac {\displaystyle 5^7- \frac {24^3+66}{\sqrt {57-3\times 7}}}{5}} {(2\times 4+2)\bigl (6+3(5\times 3-5)\bigr )+1} =42. \label {eq:learning-rpn-forty-two} \end{equation}

Here “complex expression” means intricate grouping; all its operands and results are real. Leave complex mode off. The walkthrough below uses the current SpicyRPN entry and stack rules.

Name the main intermediate results before entering them:

\begin{align*} A&=\sqrt {57-3\times 7}=6, & B&=\frac {24^3+66}{A}=2315,\\ N&=\frac {5^7-B}{5}=15162, & C&=6+3(5\times 3-5)=36,\\ D&=(2\times 4+2)C+1=361. && \end{align*}

The last step is \(N/D\). These letters are labels for the explanation, not memories to store or symbols to enter. There are two main phases: produce N, then keep it waiting while producing D.

Build the entire numerator

Use the prepared real RPN start, fixed depth 5, 600 working digits, FIX 4, and no active shift or pending command. Follow all rows successively:

Keys

X after the row

f CLEAR 57 ENTER 3 ENTER 7 \(\times \) \(-\) \(\sqrt {x}\)

6

24 ENTER 3 \(y^x\) 66 +

13890

\(x\leftrightarrow y\) \(\div \)

2315

5 ENTER 7 \(y^x\)

78125

\(x\leftrightarrow y\) \(-\) 5 \(\div \)

15162

The first row makes A. In the second row, A waits in Y while X becomes 13890; SWAP arranges \(13890/6\). Next B waits while \(5^7\) is formed. SWAP puts \(5^7\) in Y and B in X; subtraction gives 75810, and division by 5 produces N. The display is 15,162.0000. Continue below without clearing or pressing an extra ENTER.

Build the denominator and join the two parts

Continue directly from the preceding numerator, with 15162 in X, all deeper positions zero, the same RPN settings, and no active shift or pending command. Do not clear between these rows:

Keys

X after the row

5 ENTER 3 \(\times \) 5 \(-\)

10

3 \(\times \) 6 +

36

2 ENTER 4 \(\times \) 2 +

10

\(\times \) 1 +

361

\(\div \)

42

The first two rows make C while N waits. The third makes the other factor, \(2\times 4+2\). Multiplication joins the factors; adding 1 completes D. The final division uses Y = 15162 and X = 361, displaying 42.0000.

The stack reaches its largest useful population when 4 is being entered for the denominator’s left factor: N, C, 2, and 4 coexist. Four positions are sufficient for this sequence; the default fifth position provides spare room. No ordinary memory is required.

Table A.4: Checkpoints in the extended example, in chronological order. “Enter 4” is the busiest point in the denominator phase. Only N and D remain relevant before the final division.
Position A ready B ready Enter 4 D ready Finished
S4 0 0 0 0 0
S3 0 0 15162 0 0
S2 0 0 36 0 0
Y/S1 0 0 2 15162 0
X/S0 6 2315 4 361 42

An independent arithmetic check is particularly simple: \(24^3+66=13890\), \(13890/6=2315\), and \((78125-2315)/5=15162\). The denominator is \(10\times 36+1=361\), and \(361\times 42=15162\). These checks isolate the structure of the calculation; a correct final 42 is more convincing when its numerator and denominator also agree.

A.7   Use deepest-register repetition deliberately

An ordinary binary operation drops a fixed stack by one position and repeats its deepest value. If every position above X contains the same factor, each multiplication exposes another copy in Y while S4 renews the supply. This can produce successive powers or repeated growth without retyping the factor.

The setup matters. A freshly typed value needs one ENTER to finish entry and four more to fill a five-register stack with copies. A value already produced by an operation needs only four ENTER presses, because its entry is already finished. A larger fixed depth needs more copies; an unlimited stack never renews a deepest register in this way.

Generate successive powers of two

Use the prepared RPN start with fixed depth exactly 5. Fill the stack:

f CLEAR 2 ENTER ENTER ENTER ENTER ENTER

All five positions now contain 2. Press \(\times \) four times, inspecting after each if desired. X displays, successively, 4.0000, 8.0000, 16.0000, and 32.0000. Y, S2, S3, and S4 remain 2 after every multiplication.

Table A.5: The repeating factor in a fixed five-register stack. No new number is entered between these multiplications.
Position Filled First \(\times \) Second \(\times \) Third \(\times \)
S4 2 2 2 2
S3 2 2 2 2
S2 2 2 2 2
Y/S1 2 2 2 2
X/S0 2 4 8 16

This is a reusable operand, not a special repeat-operation mode. Pressing addition with the same prepared stack would repeatedly add 2 instead. Division calculates \(Y/X\), so repeated division would not divide the displayed running result by 2 in the same way. Attend to operand order even when the repeated value is convenient.

Follow three periods of one-percent growth

Use the prepared RPN start with fixed depth 5. Form the factor \(1+1/100=1.01\), then fill all positions with it:

f CLEAR 1 ENTER 100 \(\div \) 1 + ENTER ENTER ENTER ENTER

Now enter 1000 ENTER. X is 1000 and the other four positions contain 1.01. Press \(\times \) once per period. The first three displays are 1,010.0000, 1,020.1000, and 1,030.3010, agreeing with \(1000(1.01)^j\) for \(j=1,2,3\). The four waiting factors remain 1.01.

This example uses ordinary multiplication, not the financial registers. It neither changes n nor counts periods for you, and it does not round each period’s value to cents. Keep track of how many multiplications you performed. Use TVM or AMORT when you need their financial models and register updates; see chapter 11.

A new digit, a recall, a swap, or an unrelated function can disturb the prepared pattern. Inspect it before relying on another repeated factor, and rebuild it when changing tasks. The supply is replenished by the fixed-stack rule; the arithmetic still has finite precision and range.

A.8   Reverse subtraction or division safely

Evaluating the right-hand part first can save space. It also leaves that result in Y when the left-hand part arrives in X. For subtraction, division, powers, and indexed roots, put the operands in their intended positions before using the key. SWAP, the unshifted \(x\leftrightarrow y\), exchanges only X and Y.

For finite real values, subtraction followed by sign change reverses the difference: \(-(a-b)=b-a\). Division followed by reciprocal reverses a quotient when both operands and the intermediate quotient are nonzero and usable: \(1/(a/b)=b/a\). The reciprocal method introduces an extra arithmetic operation and can encounter an invalid or extreme intermediate value. SWAP avoids forming the wrong quotient in the first place.

Table A.6: Two ways to correct deliberately reversed operands. Start each independent row with the prepared RPN settings, no active shift or pending command, and f CLEAR.
Intended result

Keys after clearing

Result
\(12-3\)

3 ENTER 12 \(x\leftrightarrow y\) \(-\)

9
\(12-3\)

3 ENTER 12 \(-\) +/\(-\)

9
\(12/3\)

3 ENTER 12 \(x\leftrightarrow y\) \(\div \)

4
\(12/3\)

3 ENTER 12 \(\div \) \(1/x\)

4

There is no comparable general one-key reversal for \(a^b\) and \(b^a\). Use SWAP before power. The same discipline applies to a root’s radicand and index. Remember also that sign change or reciprocal is a new unary calculation and updates the saved operands. If your plan depends on LAST X or LAST Y, another calculation may have replaced the pair you intended to recover.

A.9   Give a reusable value an ordinary memory register

Use the stack for values needed soon in the current calculation. Use ordinary memory for a value that several calculations need, a result you want to preserve while clearing or rearranging the stack, or a checkpoint whose meaning would otherwise be hard to remember. Choosing a memory is a way to make the work easier to follow, not a failure to master the stack.

STO followed by a digit copies X into that register without removing X. RCL followed by a digit lifts the saved value onto the stack. Recall finishes a number being typed, so ENTER is unnecessary between that number and RCL. Ordinary recall also updates Last X; do not rely on an older saved operand after recalling a memory. Chapter 6 covers the full bank and clearing rules.

Reuse a circular cross-sectional area

Use the prepared RPN start. This example replaces R2; preserve its old value first if needed. For radius 1.25, calculate and store the area \(A=\pi (1.25)^2\). Orange 0 supplies \(\pi \):

f CLEAR 1.25 f \(x^2\) f 0 \(\times \) STO 2

The display is 4.9087. R2 retains the working-precision area, not the four-place readout. For cylinders of lengths 3 and 8 in the same length unit, try each row:

Complete sequence

Volume

f CLEAR 3 RCL 2 \(\times \)

14.7262

f CLEAR 8 RCL 2 \(\times \)

39.2699

The results are \(75\pi /16\) and \(25\pi /2\), in cubic length units. R2 remains available after both calculations.

For a one-use intermediate, you can store it, clear the stack, calculate the other part, then recall it. Check the resulting order: that recall places the stored part in X. Use SWAP if it belongs in Y for the final operation. Writing a short note such as “R2 = area” is often more helpful than remembering the register number alone.

A.10   Practice, check, and recover

For each exercise, use the prepared real RPN settings, fixed depth 5, 600 working digits, FIX 4, and no active shift or pending command. Begin with f CLEAR. If an exercise specifies memory, initialize it as requested regardless of its earlier contents. Do not look at the answers until you have identified the final operation and the maximum number of useful values your sequence keeps at once.

1.
Write \(6(2+5)\) in postfix notation, then enter it.
2.
Calculate \((17-5)/(2+4)\). Identify X and Y immediately before the final operation.
3.
Calculate \((3^2+4^2)/(7-2)\), using the square function.
4.
Calculate \(9/[2+(8-5)^2]\), forming the denominator first.
5.
Calculate both \(2^{(1+3)}\) and \((2+1)^3\). Explain why they require different operation orders.
6.
Calculate \(1/[1+1/(1+1/2)]\), starting at the innermost fraction and using reciprocal.
7.
Calculate \((20-3)/(7-2)\), forming \(7-2\) first. Trace where the denominator waits.
8.
Fill the five-register stack with 1.02, enter 200, and find the value after three successive multiplications. How many ENTER presses finish and fill a freshly typed factor?
9.
Store \(\sqrt {5^2+12^2}\) in R3, deliberately replacing its previous contents. Clear the stack and use two recalls to calculate \((R3+7)/(R3-5)\). R3 in this expression means the stored value, not a variable-name entry feature.
10.
Enter and accept 96 ENTER 6 ENTER. Replace the accepted 6 with 8 without re-entering 96, then divide.
11.
Intend to calculate \((7+5)+(48/6)\), but deliberately press multiplication for the division. Recover immediately with DROP, LAST Y, and LAST X, preserving the waiting subtotal 12, then complete the intended calculation.
12.
Calculate \((2+3)\bigl ((4+5)/(6+7)\bigr )\). Show a checkpoint at its maximum useful stack population and explain why no memory is required.

A.11   Answers and annotated checkpoints

The sequences below follow the same prepared settings. Each begins after a fresh f CLEAR, unless an explicit later CLEAR appears. Line breaks do not mean ENTER or CLEAR. The numeric results are given in FIX 4; the explanatory fractions are exact mathematical checks, not instructions to retype rounded values.

1. One group and a multiplier

One postfix form is \(2\ 5\ +\ 6\ \times \). Enter 2 ENTER 5 + 6 \(\times \) to obtain 42.0000. Addition first makes 7; multiplication uses Y = 7 and X = 6. The equally valid \(6\ 2\ 5\ +\ \times \) keeps an extra waiting value and requires three useful positions instead of two.

2. Two differences or sums become one quotient

Press 17 ENTER 5 \(-\) 2 ENTER 4 + \(\div \). The answer is 2.0000, from \(12/6\).

Position After first \(-\) Enter 4 Before final \(\div \)
S4 0 0 0
S3 0 0 0
S2 0 12 0
Y/S1 0 2 12
X/S0 12 4 6

The numerator is temporarily in S2. Addition drops the denominator’s two operands into one result, bringing that numerator back to Y.

3. Two squares, then a denominator

Press 3 f \(x^2\) 4 f \(x^2\) + 7 ENTER 2 \(-\) \(\div \). The answer is 5.0000. The numerator is \(9+16=25\); it waits while \(7-2=5\) is formed. Typing 4 after the first square starts a new operand, so it needs no preceding ENTER.

4. A denominator before its numerator

Press 8 ENTER 5 \(-\) f \(x^2\) 2 + 9 \(x\leftrightarrow y\) \(\div \). The answer is 0.8182, from \(9/11\). After typing 9, X is 9 and Y is 11. SWAP makes the numerator Y and denominator X before division.

5. Different arguments for power

For \(2^{(1+3)}\), press 1 ENTER 3 + 2 \(x\leftrightarrow y\) \(y^x\). The answer is 16.0000. This sequence calculates the exponent first, then swaps to put base 2 in Y and exponent 4 in X.

For \((2+1)^3\), start again with CLEAR, then press 2 ENTER 1 + 3 \(y^x\). The answer is 27.0000. Here the addition makes the base, so no swap is needed after entering exponent 3.

6. Repeated reciprocal around completed groups

Press 2 \(1/x\) 1 + \(1/x\) 1 + \(1/x\). The mathematical checkpoints are \(1/2\), \(3/2\), \(2/3\), \(5/3\), and \(3/5\). The final display is 0.6000. Each reciprocal acts on the whole value then in X; no parentheses need to be entered.

7. Keep the earlier denominator in reserve

Press 7 ENTER 2 \(-\) 20 ENTER 3 \(-\) \(x\leftrightarrow y\) \(\div \). The result is 3.4000, from \(17/5\).

Position Denominator Enter 3 Numerator After SWAP
S4 0 0 0 0
S3 0 0 0 0
S2 0 5 0 0
Y/S1 0 20 5 17
X/S0 5 3 17 5

The denominator’s position changes, but its value remains 5 until the final division consumes it.

8. Fill the fixed stack, then count three operations

Press 1.02 ENTER ENTER ENTER ENTER ENTER, then 200 ENTER \(\times \) \(\times \) \(\times \). Five ENTER presses finish and fill the freshly typed factor. The running values are 204, 208.08, and 212.2416; the last display is 212.2416. Each multiplication retains 1.02 in all four deeper positions. The independent check is \(200(1.02)^3\).

9. Initialize and reuse a memory

Press 5 f \(x^2\) 12 f \(x^2\) + \(\sqrt {x}\) STO 3. The value in X and R3 is 13, from \(\sqrt {25+144}\). Then press:

f CLEAR RCL 3 7 + RCL 3 5 \(-\) \(\div \)

The first sum is 20. The second recall places 13 in X and moves that sum to Y; typing 5 leaves the useful stack, from deeper to shallower, as 20, 13, 5. Subtraction produces X = 8 and Y = 20. Division gives 2.5000, and R3 still contains 13.

10. Remove the accepted operand before replacing it

DROP is the orange function of roll down. The complete sequence after CLEAR is 96 ENTER 6 ENTER f DROP 8 \(\div \). DROP removes 6 and exposes 96 in X. Typing 8 lifts 96 back into Y, so division gives 12.0000. CLx would leave a zero position in place; typing 8 afterward would put that zero in Y instead of 96.

11. Recover operands before another calculation replaces them

Reproduce the mistaken operation with 7 ENTER 5 + 48 ENTER 6 \(\times \). S0/X is 288 and S1/Y is the waiting 12. The separate saved operands are Last Y = 48 and Last X = 6. LAST Y is blue \(1/x\) and LAST X is blue \(x\leftrightarrow y\). Immediately press:

f DROP g LAST Y g LAST X \(\div \) +

The repaired division yields 8; addition to the waiting 12 produces 20.0000.

Position Mistake After DROP Both recalls After \(\div \)
S4 0 0 0 0
S3 0 0 0 0
S2 0 0 12 0
Y/S1 12 0 48 12
X/S0 288 12 6 8

DROP and both recalls preserve the saved pair until the corrected division uses it. CLx would replace Last X with 288. LAST X/Y are operand recovery, not a restoration of the whole earlier stack or an undo of memory changes; see section 2.9.

12. Four useful values at the busiest point

Press 2 ENTER 3 + 4 ENTER 5 + 6 ENTER 7 + \(\div \) \(\times \). The display is 3.4615, from \(5(9/13)=45/13\).

While 7 is being entered, S4 is zero, S3 holds 5, S2 holds 9, Y holds 6, and X is the entry 7. These four useful values fit in the five-register stack. Addition leaves 13 in X, 9 in Y, and 5 in S2; division leaves \(9/13\) in X and 5 in Y; multiplication finishes the expression. This trace identifies why each deeper value was retained and exactly when it became an operand.

Developing a reliable habit

When practicing, pause at meaningful intermediate results instead of checking only the final display. Identify the first checkpoint that differs, then inspect the entry state and operand order there. Repeating the same mistaken sequence faster is unlikely to help. Trying another valid evaluation order, checking a simple limiting case, or substituting the result back into the original relation provides a more independent check.

Read the function’s stack rules before extending this planning method to a new domain. Percent retains its base in Y; statistics can return two values; financial operations may use stored registers rather than the displayed operands. The ordinary consume-two, produce-one model used for most of this appendix is a strong starting point, but those specialized commands have the distinct effects documented in chapter 10, chapter 11, chapter 12 and chapter 13.