# Automated enumeration of slide rule algorithms

## Idea

If you look carefully at basic ternary operation (uU->vV; wW=>R(r)) you will notice that you can substitute for scales U and W any scales from slide rule's slide (it can be the same scale) and for R and V any scales from slide rule's body. If you know scales' formulas (which you should anyway) you will know what kind of formula this operation implements. So let us just substitute all possible combination of scales, determine the formula it calculates, order those formulas according to some principle and output it as some kind of nice long reference list.

And that is just for basic ternary operation. We also have basic unary operation (vV=>R(r)), we can search with a cursor (uU->vV; |->W=T; |=>R(r)), we can do the above with slide taken out and put back reversed, finally from formulas of 3 variables r=f(u,v,w) we can get formulas of 2 variables r=f(u,v,v)=g(u,v) etc.

## Implementation

There are some words to say and things to clarify before I present actual program. First of all I've chosen to limit myself to pure logarithmic scales. That is, scales that have form K·log 10x. The reason is twofold. First, these kind of scales are present on most slide rules in great variety and second the resulting formula has uniform form. Specifically,

### Derivatives of ternary operation: r=uavbwc

if scale U has formula U·log x, V, W and R -- V·log x, W·log x, R·log x, respectively, then uU->vV; wW=>R(r) will result in
R log r-V log v = W log w - U log u
or
r=u -U/R v V/R w W/R
Because of asymmetry of stock and slide (e.g K is present only on stock and CI is present only on slide), it may make sense to try variant where final result is being read from scale located on a slide: uU->vV; wR=>W(r). As we already know, reversing the slide (thus replacing U and W with UI and WI with formulas -U log x and -W log x) does not give us any new formulas in this case, so there is no need to do it.

### Reduction of ternary op to 2 variables r=uavb

Given the list of 3 variable formulas r=u -U/R v V/R w W/R it is easy to turn them into 2-variable formulas by setting u=v (giving r=v (V-U)/R w W/R ), u=w (giving r=v V/R w (W-U)/R ), and w=v (giving r=u U/R v (W+V)/R ).

Another way to reduce a number of variables is to substitue a constant for one of the variables. One very special constant for log scale is 1 (also known as index). To substitute one for the variable means just to drop it from the formula (1 any power=1). One thing to keep in mind when substituing 1 for the variable is that 1 on A is same as 1 on D so using A instead of D does not give new formula. There is a difference between index of a slide scale and index of stock scale, but if both scales are on stock (or slide) it does not make difference which index to use. So to avoid listing operations that look different in notation but perform same movements, this should be taken into account.

### Reduction of ternary op to 1 variable r=ua

It is easy to get a list of one variable formulas from the list of 2 variable formulas doing exactly the same things: substitution u=v, u=1, v=1 reduces the number of variables in the formula to 1.

### Search: r=uavb

Search looks for pair of values on given scales that match some relationship. In theory this relationship can be any simple equation, but in practice simplest and less mind strainig of them is simple equality: uU->vV; |->W=T; |=>R(r). For this operation assuming W on slide and T on stock we have
U log u + c = V log v
c=V log v - U log U
W log x + c = T log x
log x = c/(T-W)
log x=(V/(T-W)) log v - (U/(T-W)) log u
Now, if R is located on stock then
R log r = T log x
log r = (TV/(RT-RW)) log v - (TU/(RT-RW)) log u
r= u TV/(RT-RW) v TU/(RT-RW)
And if R is located on slide then
R log r = W log x
log r = (WV/(RT-RW)) log v - (WU/(RT-RW)) log u
r= u WV/(RT-RW) v WU/(RT-RW)
Once again, 2 variable formula can be reduced to one variable by applying methods described above.

Unlike basic ternary operation, reversing the slide in search may give some additional formulas, so all this should be applied to the reversed slide for additional results.

### Unary op: r=ua

And let's not forget about unary op -- lookup of one value over another for the pair of fixed scales on stock or slide.
R log r=U log u
r=u U/R

## Results

I've put this all together and come up with a perl script that does just that. Then it groups all formulas by type of operation, and within that group it orders them according to lexicographic order of powers. (Download). Oh, yeah. This script is copyright 2001 by Andrew Nikitin. You may use it at your own risk, as is, without any warranty whatsoever, blah, blah, blah.

```usage:
perl sr_ops3.pl [options] >output
options:
-o{type} -- output type. t-text, h-html, l-list
-r{rule} -- rule:
m - mannheim,
p - polyphase,
o - monster,
s - simple,
4 - N4-ES
t - tie-clip
-R{rule_description} -- alternative for -r
-n - print only 'new' monomials
-i - print index in the end
```
As an example of the results produced by this script let me introduce complete list of operations for Mannheim layout and reduced list (powers only) for Polyphase (AKA Rietz) layout. You can use the script to generate your own lists. They run quite big for complicated rules. For example complete list for polyphase layout is 203K and complete list for Hemmi 269 (which has K, F, A, D scales on body and B, K, CI, C scales on slide) is 1.81M.

## Further improvement

This script does not address the possibility of transfering intermediate values between scales. That is operations of form
uU->vV; wW=>T(x); |->xS; |=>R(r)
There is no reason not to allow at least one such operation per algorithm.

## Other scales

What about other scales? Except log scales there are log-log scales, trig scales, hyporbolic scales etc. If we substitute formulas for those scales into our equations we will get some formulas. Some of them may be useful in certain fields. There will be no simple structure (like in case of log scales) among these formulas.

## History: previous attempts

My inspiration for the whole activity was the book by M. Polivanov (ref). He lists 60 formulas solvable in single slide movement and gives some examples of their usage in actual calculations. I noticed that all formulas have form of what I call here "basic ternary operation" and varies only in choices of scales.

Typical slide rule manual also lists several "expressions solved with one settings of slide". For example, for K,A[B,CI,C]D layout, “The polyphase Slide Rule No. 4053” (ref) shows how to calculate the following powers: 2 3 1/2 1/3 3/2 2/3 -1 -2 -1/2 -3 -1/3 4 -4 5 -5 6 7 9 5/2 9/2 11/2 15/2 -2/3 4/3 -4/3 5/3 -5/3 7/3 8/3 -8/3 -10/3 11/3 14/3 1/6 -1/6 5/6 7/6 -7/6 11/6.

The same list (in the same order and sometimes with the same typos) can also be found in many thick books about slide rule.

For example, "A Manual of the SLIDE RULE Its History, Principle and Operation" by J. E. Thompson B.S. in E.E., A.M. (ref) on page 173 lists calculatable expressions together with their algorithms. This list, word to word, including punctuation and capitalization is identical to one found K&E manual by Bleckenridge (ref).

The question is where this list originally came from. Definitely, K&E book is not the source. Not only it is later than this Thompson's book, but it also contains some typos in the list, like item 6: x=3a2 in K&E became x=√a2, or item 36: x=6a5 became x=6a. This definitely shows that W. E. Bleckenridge, A.M. just copied this table from some other source and wasn't even careful enough to do it right.

Now, I doubt that Thompson's book was the source. First of all, this table describes operation in plain english, e.g. "set 1 to a on D, over a on C read x on A", while the rest of Thompson's book incorporates "table notation" (pretty clumsy) to describe slide rule operations. Table also calls cursor "Indicator" (capitalized), while Thomson calls it "runner" in the rest of the book.

Origin must exist, but I could not find it so far. If you know who is the author of this list or where it appeared first please send me a note. I am also interested to know if there is a book about slide rules where cursor is called "Indicator" and published before 1930.

There is little doubt that this list was produced systematically using similar procedure as I have described here. Complete inpracticality of the most of the formulas (u 14/3) speaks for itself. It was purely academic exersize on the part of unsung and yet unknown hero of automated enumeration of slide rule algorithms of the past. Unfortunately (fortunately for me) he could not (or did not wish to) afford services of a professional computer (in XIX century those used to be just guys with paper and pencil and, occasionally, slide rule) and he missed couple of gems. Now, for the first time in centuries human kind finally is capable of calculating in a single slide movement on rules with polyphase layout such powers as u10/3 u-5/6 u-3/2 u-7/3 u-7/2 u-9/2 u-6 . (I might be mistaken, please correct me if you have seen mentions of these powers in some slide rule book)

Also, original author did not even mention formulas obtained by searching and searching with inverted slide as well as his list of 2 and 3 variable formulas is far more incomplete. I think he knew about them but just did not dare to undertake a complete search. Or maybe just had better things to do with his life, whatever. Nevertheless, he did good job and with the invention of electronic computers his effort may be completed.

## References

1. П. М. Поливанов. Упрощённые приёмы машиностроительных рассчётов на счётной линейке. М.:Машиностроение, 1974. 48 стр. (djvu)
2. W. E. Bleckenridge. The polyphase Slide Rule No. 4053. Published 1938. 83 pages.
3. J. E. Thompson B.S. in E.E., A.M. A Manual of the SLIDE RULE Its History, Principle and Operation (second printing, NY, D. Van Nostrand Company, Inc., (C) 1930)

[ Index page | Emulator | Notation | Deframe | Feedback ]