--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE book PUBLIC
+ "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "docbook/docbookxx.dtd" [
+<!ENTITY min SYSTEM "../madhouse/min.mad">
+<!ENTITY maxfunc SYSTEM "../madhouse/maxfunc.mad">
+<!ENTITY newton1 SYSTEM "../madhouse/newton1.mad">
+<!ENTITY newton2 SYSTEM "../madhouse/newton2.mad">
+<!ENTITY statement "&sgr;">
+]>
+<book>
+<preface><title>Notes from the 21st century</title>
+
+<sect1><title>MAD: An Appreciation</title>
+
+<para>Most of this document is a faithful transcription of the
+reference manual for MAD (Michigan Algorithm Decoder), an early
+academic computer language from 1962. The manual should be
+accompanied by an implementation. MAD has been revived as a work of
+reconstructive archeology, so that language connoisseurs of the
+present and future will be able to appreciate what computing life was
+like back in that day.</para>
+
+<para>MAD was an extended dialect of ALGOL 58, designed near the
+beginning of the great age of invention in compiled languages that
+stretched from FORTRAN in 1955 until the rise to dominance of C after
+1985. Study of it teaches a great deal about the uses and background
+assumptions of computing in 1962 and earlier.</para>
+
+<para>Some features of MAD are only superficially odd. The all-caps
+listings look strange to modern eyes; the IBM 709 on which it was
+implemented had a pre-ASCII, pre-EBCDIC six-bit character set with no
+lower-case letters and lacks several punctuation marks that later
+became standard. The limitation to six characters in variable names,
+labels, and strings reflects the compiler's primitive memory
+management; it meant all of these could fit in one 36-bit machine
+word.</para>
+
+<para>A deeper difference from modern languages is the complete lack
+of interactive I/O. MAD was designed to run in a batch environment,
+with programs submitted via card decks and sending output to line
+printers or a card punch. This limitation is a bit obscured in the
+implementation that goes with these notes, because the card punch is
+identified with Unix standard input and the line printer with Unix
+standard output. Thus, MAD I/O accidentally looks more flexible than
+it was — modern MAD programs (assuming anyone were perverse
+enough to write any new ones) could actually be part of
+pipelines!</para>
+
+<para>Punched-card input also explains some syntactic features that
+will seem strange to modern eyes. MAD statement labels lack a
+delimiter like C's trailing colon because they were distinguished by
+position (columns 1 to 7) on the card. The line continuation syntax,
+a digit in column 10, also relies on character position. In the late
+1960s and 1970s, when punched cards coexisted with interactive
+timesharing, the term <quote>free-format</quote> was commonly used to
+describe languages with the newer-style syntax that used
+whitespace-delimited tokens without relying on card position, and
+languages like MAD were called <quote>fixed-field</quote>. When batch
+computing vanished in the 1990s, both terms passed out of use.</para>
+
+<para>Perhaps strangest to the modern eye is the exclusiveness with
+which MAD is focused on numerical computations in applied
+mathematics. String handling is rudimentary, and data structures other
+than arrays are absent. These gaps reflect not only the
+non-interactive style of computing back then but the fact that what we
+would today call systems programming (which drove the incorporation of
+features like pointers, structures, unions, and typedefs in C) was not
+yet done in non-assembler languages. The fact that the if statement is
+called WHENEVER and the goto called TRANSFER is a mere cosmetic
+trivium by comparison.</para>
+
+<para>There are some significant respects in which MAD was actually
+rather advanced for its period. The multiline WHENEVER statement
+anticipated the free-format syntax of ALGOL 60 and its descendants,
+including Pascal and C.</para>
+
+</sect1>
+
+<sect1><title>How This Implementation Differs From The Original MAD</title>
+
+<para>The Retrocomputing Museum implementation of MAD translates MAD
+code into compileable C. It has been tested on the examples in the
+manual, which are included with the distribution.</para>
+
+<para>This implementation simulates the card format of the original by
+reserving the first 8 character positions of each line for a either a label
+field or continuation. Whether or not a label field is empty, it
+must be followed by a tab, and the statement proper begins following the
+tab. Continuation lines must begin with either 8 spaces or 7 spaces
+followed by a digit (which is ignored).</para>
+
+<para>Card images are read from standard input and printing is to
+standard output. Printer control codes +, 1, 2 and 4 are ignored
+(treated as 0 or space). Tape and drum devices are not
+supported.</para>
+
+<para>The 709 had 36-bit words; modern machines have 32 or 64.
+Precision and overflow of numeric results may therefore differ.
+The original MAD limit of 6 characters on variable names, labels, and
+string constants is not enforced.</para>
+
+<para>Label arrays, and the associated computed-transfer statement,
+are not implemented.</para>
+
+<para>The C output is self-contained and does not require any
+dedicated runtime support, except that the math library must be linked
+with it (linker option -lm).</para>
+</sect1>
+
+<sect1><title>Redactor's Notes</title>
+
+<para>The remainder of this document, following this section) is an exact
+transcription of the original Michigan Algorithm Decoder manual dated
+February 1962. Catherine Raymond typed it in from the original
+velo-bound typed manual; Eric Raymond hand-corrected it, and moved the
+result into PIC and XML-DocBook markup so both HTML and PostScript can
+be generated from it.</para>
+
+<para>Typewriter underlining in the original is expressed by
+DocBook <emphasis> tags in this version, which will probably
+render as italics.</para>
+
+<para>The original hyphenation will probably not be discernible in the
+visible rendering you see, though hyphen characters in the original
+have been preserved as ISO soft-hyphen entities.</para>
+
+<para>The program listings in the original failed to distinguish
+between 0 and O; this does not reflect incompetence but rather the
+fact that typewriters of the period did not have a separate 0 key.
+This distinction has been restored.</para>
+
+<para>In the original, the description of flowcharting conventions
+in Chapter 1 include small hand-drawn geometrical shapes after each
+of the items A, B, and the words "diamonds" and "rectangles" in item
+D were corresponding shapes.</para>
+
+<para>The pic diagrams preserve the logic of the original hand-drawn
+ones, but are not exact geometrical duplicates. The proportions of
+the flowchart elements are slightly different.</para>
+
+<para>In the original, sections were numbered only down to three
+levels deep. No per-chapter tables of contents were present.</para>
+
+<para>The item lists bulleted a., b., c... and 1., 2, 3... in this
+transcription were bulleted (a), (b), (c)... and (1), (2), (3)...
+in the original. There does not seem to be a good way to generate
+the original style in DocBook.</para>
+
+<para>Special characters like white square (□), back arrow
+(←), and the Greek letters were hand-drawn in the original
+(except for the capital thetas, which were typed capital Os with bars
+hand-drawn across them). The script-S used in the original as a base
+for subscripted labels has no ISO equivalent and has been transcribed as
+a Greek letter sigma (&statement;).</para>
+
+<para>Footnotes were tagged with asterisks in the original rather than
+being numbered. Section references to section numbers have been
+replaced with xref tags; as a result, they may render slightly
+differently than in the original. Notably, "section 1.1" becomes
+"Section 1.11" (capitalized) and expressions like "sections 1.1.4 and
+3.2" become "Section 1.1.4 and Section 3.2". We discovered while
+transcribing that Chapter 1 must have been added at the last minute,
+because references to Chapter 2 in the original had the form 1.x rather
+than 2.x.</para>
+
+<para>EPSLON and COMPLX and the like are not typos. As pointed out
+earlier, MAD variable names are limited to the 6 characters in a
+six-bit character set that would fit in the IBM 709's 36-bit
+word.</para>
+
+<para>A few typos in the original have been fixed. If you're really
+curious, comments in the XML source describe them.</para>
+
+<para>The original was not continuously page-numbered. Instead the
+pages were numbered within each chapter with the chapter number as
+a prefix; thus, page 6 of Chapter I was I.6.</para>
+
+</sect1>
+</preface>
+<preface><title>The Michigan Algorithm Decoder</title>
+
+<para>The Michigan Algorithm Decoder (MAD) is a computer program
+which translates algebraic statements describing algorithms to
+the equivalent machine instructions. This descriptive language –
+also called MAD – is explained in this manual. The language was
+patterned after ALGOL 58, a proposed standard language for the
+description of algorithms, with certain extensions and adaptations
+which the authors believe make tbe language more useful. It
+should be undergtood in what follows that a computer program may
+consist of several sections utilizing the language described
+herein or other languages if desired. The sections can be
+translated independently and are linked together just prior to
+the actual execution of the program.</para>
+
+<para>The original translating program was written for an IBM 704
+computer with 8192 words of magnetic core storage, 8192 words of
+magnetic drum storage and 6 magnetic tapes. The program was
+subsequently written for the IBM 790/90 computers with 32768 words
+of core storage. The features described in the appendices are
+included only in this later version. The programming and the
+preparation of this manual were done at the University of Michigan
+Computing Center, and the language has been widely used by
+University of Michigan students and staff.</para>
+<literallayout>
+ B. Arden
+ B. Galler
+ R. Graham
+</literallayout>
+</preface>
+
+<chapter><title>INTRODUCTION</title>
+
+<para>In order to present a problem to a digital computer for
+solution, it is necessary to transmit to the machine a statement of
+the problem, a procedure for solving it (usually called an algorithm
+for the solution of that problem), and the data which is needed in the
+solution. In fact, a statement of the problem is not really
+necessary, since the algorithm and data are sufficent for a computer,
+provided the algorithm is stated unambiguously and completely.</para>
+
+<para>As a simple example, let us consider the problem of determining
+the largest number in a collection of n + 1 numbers A = {
+a<subscript>0</subscript>, a<subscript>1</subscript>,
+a<subscript>2</subscript>, ... a<subscript>n</subscript> } with n ≥
+1. A verbal description of the procedure (algorithm) might be:</para>
+
+<procedure>
+<step>
+<para>Pick up the first number.</para>
+</step>
+<step>
+<para>Compare it with the second number.</para>
+</step>
+<step>
+<para>If the first is larger or if they are equal, keep the first one.</para>
+</step>
+<step>
+<para>If the second is larger, keep the second one.</para>
+</step>
+<step>
+<para>Whichever one was saved from this comparison is now compared with
+the third number.</para>
+</step>
+<step>
+<para>Continue to repeat steps 2 through 5 (each time moving down the
+list) until the n+1st number has been included in the
+comparison.</para>
+</step>
+<step>
+<para>The number which has been finally saved is then the largest
+number in the collection A.</para>
+</step>
+</procedure>
+
+<para>Unfortunately, this method of description is not very precise.
+Such words as "compare", "moving down the list", and "finally saved"
+should really be spelled out more exactly.</para>
+
+<!-- beginpage -->
+
+<para>The following restatement of the procedure would probably be
+more suitable:</para>
+
+<procedure>
+<step>
+<para>Set Z = a<subscript>0</subscript>.</para>
+</step>
+<step>
+<para>Let j = 1.</para>
+</step>
+<step>
+<para>If J > n, the problem is done<footnote><para>This test is redundant
+the first time, but after n times through steps (3) - (6) it will
+terminate the process for us.</para></footnote> go to step 7; otherwise
+go on.</para>
+</step>
+<step>
+<para>If Z < a<subscript>j</subscript>, let Z =
+a<subscript>j</subscript>; otherwise, go on.</para>
+</step>
+<step>
+<para>Let j increase by 1.</para>
+</step>
+<step>
+<para>Return to step 3.</para>
+</step>
+<step>
+<para>Z is the answer.</para>
+</step>
+</procedure>
+
+<para>This may be illustrated by following "flow diagram":</para>
+
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='fig1.png'/>
+ </imageobject>
+</mediaobject>
+
+<para>Note that the following conventions have been used here:</para>
+
+<orderedlist numeration='upperalpha'>
+<listitem>
+<para>Computation of subscripts or countiong occurs in diamond-shaped
+boxes.</para>
+</listitem>
+<listitem>
+<para>Actual computation occurs in rectangular boxes.</para>
+</listitem>
+<listitem>
+<para>Decisions, based on comparisons occur in triangular
+boxes.</para>
+</listitem>
+<listitem>
+<para>The "=" inside computation boxes (both diamonds and rectangles) is
+meant in the dynamic sense: "Compute the value of the expression on the
+right and let that now be the value of the variable whose name appears
+on the left."</para>
+</listitem>
+</orderedlist>
+
+<!-- beginpage -->
+
+<para>Although this problem does not require it, we frequently ask a
+question like "Does j = n?" The "=" in this context is a
+<emphasis>relation</emphasis> and yields either "YES or NO" when
+placed between two arithmetic expressions.</para>
+
+<para>We return to the example problems. The algorithm exhibits an
+important concept, which occurs in a great many procedurs; namely, it
+contains a <emphasis>loop</emphasis>. A loop has the following
+characteristic properties:</para>
+
+<orderedlist numeration='loweralpha'>
+<listitem>
+<para>It is repeated over and over until some conditions is satisfied
+(occasionally this may be a very complex condition). In the example,
+the condition was "j > n".</para>
+</listitem>
+<listitem>
+<para>Before the first "iteration," some initialization may be
+performed. In the example, Z - a<subscript>0</subscript> and j = 1.</para>
+</listitem>
+<listitem>
+<para>After the "body" of the loop is performed, (the comparison, in
+the example), some variable is incremented, and the termination
+conditions is tested again. In our example, j is increased by 1, and
+if j ≤ n, the "body" of the loop is computed again - with the new
+value of j.</para>
+</listitem>
+</orderedlist>
+
+<para>It is often convenient to take advantage of this standard structure of
+a loop, and use an "iteration box" in the flow diagram. This box
+would have to indicate the "scope"; i.e., the extent of the body of
+the loop, the variable which is to be initialized and later
+incremented, and the condition which will determine the number of
+iterations in the execution of the loop. The contents of a typical
+iteration box, (not related to the example above) might be:</para>
+
+<para>Repeat the computation through the box labelled (for example)
+"BACK", starting with the variable α having the value 12, and
+increasing it by the amount 3 after each time until either α >
+90, or |x + y| ≤ ε.</para>
+
+<para>We shall abbreviate this by the form:</para>
+
+<programlisting>
+THROUGH BACK, FOR ALPHA = 12, 3 ALPHA .G. 90 .OR. .ABS. (X+Y) .LE. EPSLON
+</programlisting>
+
+<para>Here we have substituted ".G." for ">", ".LE." for "≤",
+".ABS. (X+Y)" for "|x + y|". (The reason for these simple
+substitutions is characters such as >, ≤ as input to the computer.
+Such details are fully presented <!-- beginpage -->
+in Chapter II of this manual.)</para>
+
+<para>The flow diagram for our previous example, then, may be
+rewritten as follows: (In order to keep the notation familiar when
+possible, the above-mentioned character substitutions will not be made
+in diagrams.)</para>
+
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='fig2.png'/>
+ </imageobject>
+</mediaobject>
+
+<para>The three operators specified in a "THROUGH" statement are
+written in a single box to indicate the correspondence to a single
+statement.</para>
+
+<para>The question still remains: How does one communicate the
+algorithm to the computer? A translator such as MAD is designed
+according to the philosophy: Once the algorithm has been stated, as in
+a flow diagram, it should be presented to the computer directly in
+that form, or as near to it as possible. The "translator" then has
+the job of producing a translation from a flow diagram in a form
+acceptable as input to the translator, the user's work ends with the
+diagram itself.</para>
+
+<para>It should be remembered that the MAD language was designed with several
+important criteria in mind:</para>
+
+<orderedlist numeration='loweralpha'>
+<listitem>
+<para>Speed of translation - the choice of some words of more than six
+characters (e.g. WHENEVER, TRANSFER, THROUGH) enables the translator
+to recognize the statement type with a minimum of analysis.</para>
+</listitem>
+<listitem>
+<para>Generality - a few restrictions on the construction of
+statements and expressions have been introduced as possible.</para>
+</listitem>
+<!-- beginpage -->
+<listitem>
+<para>Ease of adding to the language - desired additions can be
+made easily, since most of the necessary information can be stored in
+tables during translation.</para>
+</listitem>
+</orderedlist>
+
+<para>It is obvious that a different set of criteria could lead to a
+different language. The details of the form of statements in this
+"input language" are the subject of Chapter II.<footnote><para>The
+reader may find some clarifying effect if he rereads Chapter I after
+reading Chapter II.</para></footnote></para>
+
+<para>We are concerned here with introducing some of the basic ideas,
+such as the loop, etc. The input form of our example would be:</para>
+
+<programlisting>
+&min;
+</programlisting>
+
+<para>The DIMENSION statement assigns a block of storage in the
+computer large enough to handle a<subscript>0</subscript>,
+a<subscript>1</subscript>, a<subscript>2</subscript>,
+... a<subscript>100</subscript>, if necessary. The INTEGER statement
+declares J and N to be integers. We have already seen that different
+shaped boxes are used for operations on integers, such as subscript
+modification and counting. The reason for this is that integer
+arithmetic can be done more simply and efficiently, usually with less
+round-off error, than arithmetic on non-integers. [Numbers which may
+have fractional parts are usually written in the so-called "scientific
+notation", such as 3.1 x 10<superscript>-6</superscript> are called
+floating point numbers.] Numbers are assumed to be in the
+floating-point mode unless otherwise declared, as in the INTEGER
+statement in the example. The WHENEVER statement above is to be
+interpreted in the sense: Whenever the following condition (in this
+case Z < a<subscript>j</subscript>) is satisfied, do the specified
+action (Z = a<subscript>j</subscript>), otherwise just go on.</para>
+
+<para>It is interesting to ask just how complicated a condition can be
+used in making decisions. We have seen that such conditions may occur
+in iterations statements, and "WHENEVER" statements, etc., for the
+purose of making binary (i.e., "yes" or "no") choices. An expression
+which can be labelled <!-- beginpage -->
+"True" or "False" is exactly what is needed
+here. Such expressions are called
+<emphasis>Boolean</emphasis><footnote><para>After the logician George
+Boole.</para></footnote> <emphasis>expressions</emphasis>, and usually
+involve "and", "or", "not", and possibly other such words connecting
+shorter expressions involving <, ≤, =, ≠, >, and ≥.
+For example, the following is a Boolean expression:</para>
+
+<programlisting>
+ ((x - 3)<superscript>3</superscript> < y and i ≤ j) or x ≥ 3
+</programlisting>
+
+<para>This will be "true" for some values of x and y, and "false" for
+others. It might then occur in statements such as:</para>
+
+<programlisting>
+WHENEVER ((X - 3) .P. 3 .L. Y .AND. I .LE. J) .OR. X .GE. 3,
+TRANSFER TO AGAIN
+</programlisting>
+
+<para>or in the iteration statement</para>
+
+<programlisting>
+THROUGH ALPHA, FOR BETA = 1, 1, (X - 3) .P. 3 .L. Y .AND.
+I. .LE. J) .OR. X .GE. 3
+</programlisting>
+
+<para>where .P. denotes exponentiation (i.e., "to the power").</para>
+
+<para>Returning again to the example problem on the largest of a set
+of numbers, we observe that no provision was made for obtaining the
+values of n, a<subscript>0</subscript>, a<subscript>1</subscript>,
+..., a<subscript>n</subscript> on which to perform our computation,
+nor was any provision made for producing an answer. Normally, each
+program would contain suitable input and output statements, such as
+are described in Chapter II and illustrated in Chapter III. Let us
+assume instead that we are interested in making out little algorithm
+available for use in any other program, as a pre-packaged "function",
+in the sense that, given n and a<subscript>0</subscript>, ...,
+a<subscript>n</subscript>, this function computes as its value the
+largest of a<subscript>0</subscript>, ..., a<subscript>n</subscript>.
+In this case we shall call our algorithm an EXTERNAL FUNCTION, and
+give it a name, say MAX., since it will be written and translated
+externally with respect to the program which will later call upon it.
+The program will now be written:</para>
+
+<!-- page break after "FUNCTION RETURN Z" in this listing -->
+<programlisting>
+&maxfunc;
+</programlisting>
+
+<para>The first statement specifies the inputs to the function to be N and
+A, the second statement indicates the point of entry, the FUNCTION
+RETURN statement specifies the value of Z as the desired value of the
+function, and the other statements are as before. Any program using
+the function now need only call upon it by name, as in the statement:</para>
+
+<programlisting>
+LARGEQ = 1. + MAS. (6,Q)/3.
+</programlisting>
+
+<para>Note that the set (in this use of MAX.) hose largest element is
+desired is called Q, and N has the value 6. No DIMENSION statement is
+needed for A is the EXTERNAL FUNCTION definition program above, since
+A is there only as a "dummy variable", anyway. When
+<emphasis>used</emphasis>, with a concrete set Q, we would expect a
+DIMENSION statement for Q in the program that calls on MAX. for a
+value.</para>
+
+<para>For a second example consider the problem of repeatedly solving,
+by Newton's method, of the equation f(x) -
+a<superscript>x</superscript> + x = 0, taking a different value for a
+each time but with the restriction that a ≥ 1. This method involves
+the repeated evaluation of the formula</para>
+
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='equation1.png'/>
+ </imageobject>
+</mediaobject>
+
+<para>(the prime denotes the derivative with respect to x) until
+x<subscript>i+1</subscript> is a root - i.e., until
+f(x<subscript>i+1</subscript>) = 0. Actually, in the numerical
+solution of equations where we deal with approximate numbers the
+latter condition becomes: until |f(x<subscript>i+1</subscript>)| <
+ε, where ε is a small positive number.</para>
+
+<para>To evaluate the iterative formula above the first time it is
+necessary to have an initial approximation, x<subscript>0</subscript>,
+to the desired root. The use of the index, i, as well as the initial
+subscript zero suggests that we will produce a sequence,
+x<subscript>0</subscript>, x<subscript>1</subscript>,
+... x<subscript>n</subscript>, of approximations to the root.
+However, from the computational point of view we do no need all of
+these values simultaneously, since to evaluate the formula it is
+sufficient to know only the last value, x, produced. We can
+say</para>
+
+<programlisting>
+x is replaced by x - f(x)/f'(x)
+</programlisting>
+
+<para>Often a left arrow (←) is used to mean "is replaced by" but
+in the actual <!-- beginpage --> statements produced for the computer
+the "=" symbol conventionally has this meaning.</para>
+
+<para>It is important to realize what the "=" means in this context; it is
+different from the usual use of the symbol where it indicated a
+<emphasis>relation</emphasis>. When the "=" symbol is used as such a
+"replacement operator" the item on the left of the "=" is always the
+<emphasis>name</emphasis> of a <emphasis>variable</emphasis>. The
+variable may have a complicated subscript but nevertheless it is not
+an expression, but the name of a variable. The item on the right of
+the symbol is an expression involving one or more constants,
+variables, etc. The operation implied is simply that the value of the
+express on the right becomes the <emphasis>value</emphasis> of the
+variable whose name appears on the left. This is referred to as
+substitution.</para>
+
+<para>For our specific example, then, the evaluation of the iterative
+formula could be described as</para>
+
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='equation2.png'/>
+ </imageobject>
+</mediaobject>
+<!-- in the original there was a comma hung out to the right of the listing -->
+
+<para>although we will for convenience break this into two statements.
+The entire computational procedure can be represented by the following
+flow diagram.</para>
+
+<!-- Figure 3 had x+x in one box caption where it needed x=x -->
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='fig3.png'/>
+ </imageobject>
+</mediaobject>
+
+<!-- beginpage -->
+
+<para>The corresponding statements are:</para>
+
+<programlisting>
+&newton1;
+</programlisting>
+
+<orderedlist>
+<listitem><para>The first statement, labelled ST, causes a value for a,x,
+and ε to be read into computer storage. A block of adjacent
+storage location in the computer (a "vector") named ALPHA is
+designated as containing a description of how the three
+numbers were punched on the card. (This description – which
+is the value of ALPHA – is described in a later statement; see
+(9) below.)</para></listitem>
+
+<listitem><para>The second statement is a simple conditional which causes
+the statement labelled PRT to be the next one executed if a <
+1. Otherwise, the next one in ssequence (labelled REPEAT in
+this case) will be executed.</para></listitem>
+
+<listitem><para>The statement labelled REPEAT computes
+a<superscript>x</superscript> + x using the current value of x, and
+places the result of this computation in a storage location named
+F.</para></listitem>
+
+<listitem><para>The next statement divides the value F of the function
+by the derivative of the function (log<subscript>e</subscript> a
+· a<superscript>x</superscript> + 1.0), evaluated using the
+current value of x, subtracts this quotient from the current value of
+x and the resulting difference is stored as the current value of x.
+The name ELOG. is the name for the function
+log<subscript>e</subscript> and the item in parentheses following this
+name indicated the variable whose natural logarithm is
+desired.</para></listitem>
+
+<!-- beginpage -->
+
+<listitem><para>The following statement is a simple conditional which
+causes the function and iterative formula to be evaluated
+again if |f(x)| ≥ ε. Otherwise, (i.e., |f(x)| <
+ε), the next statement in sequence is executed.</para></listitem>
+
+<listitem><para>The PRINT statement causes three numbers - the current
+values of a, x and ε to be printed. The arrangement and form
+of the numbers on the printed page are controlled by the
+format description which is the value of the vector named
+ALPHA.</para></listitem>
+
+<listitem><para>The TRANSFER statement following causes the statement
+labelled ST to be the next one performed.</para></listitem>
+
+<listitem><para>The statement labelled PRT is the one executed immediately
+after the first statement whenever a < 1.0. This statement
+causes the current value of a to be printed (here a must be <
+1.0) according to a format description stored in BETA. The
+format description also causes the printing of some constant
+alphabetic information preceding thenumber; namely, the remark
+"A TOO SMALL, A = ".</para></listitem>
+
+<listitem><para>The next two statements following the last TRANSFER TO ST
+set the initial values of two vectors named ALPHA and BETA.
+Although VECTOR VALUES statements can be used to preset
+vectors to specified numeric values, in both instances here
+the values are <emphasis>format descriptions</emphasis>. The
+strings of characters between the dollar signs (MAD quotation
+marks!) are to be taken literally as they appear and stored in
+designated vectors. The actual format specifications are
+described in more detail in Chapter II, but, for example, the
+first description: S1,3F15.6* means that the first item is to
+be a space (S1), followed by three (3) numbers printed with a
+decimal point but no exponent (F), each occupying fifteen card
+or print positions (15), and that there will be six positions
+to the right of the decimal point (.6). The asterisk (*)
+indicates the termination of the description.</para></listitem>
+
+<listitem><para> The final statement indicates the end of the statements
+and is the last statement executed when a definite termination
+to the problem is known. In our particular example, the
+computer would continue until it has exhausted the given input
+values of a, x, ε.</para></listitem>
+</orderedlist>
+
+<!-- beginpage -->
+
+<para>The final example before the description of the language in
+Chapter II is a more general and more elaborate illustration of
+Newton's method. Here, we consider the solution of the equation
+x<superscript>3</superscript> + ax<superscript>2</superscript> + bx +
+c = 0, starting with some input value for x<subscript>0</subscript>,
+using the iterative formula:</para>
+
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='equation3.png'/>
+ </imageobject>
+</mediaobject>
+
+<para>which is obtained from the standard Newton's Method formula</para>
+
+<!-- Yes, this is repeated from earlier -->
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='equation1.png'/>
+ </imageobject>
+</mediaobject>
+
+<!-- in the original, "problem" here was "probelm" -->
+<para>for the problem f(x) = 0. (Here f(x) =
+x<superscript>3</superscript> + ax<superscript>2</superscript> + bx +
+c). We shall specify quantities ε<subscript>1</subscript> and
+ε<subscript>2</subscript>, and stop the iteration when the
+following condition is satisfied:</para>
+
+<blockquote><para>
+(|x<subscript>i+1</subscript> - x<subscript>i</subscript>| < ε<subscript>1</subscript>
+and
+|f(x<subscript>i</subscript>| < ε<subscript>2</subscript>)
+or
+i ≤ n<subscript>0</subscript>
+</para></blockquote>
+
+<para>where n<subscript>0</subscript> is some upper limit to the
+number of equations which we can tolerate. The inequaliies involving
+ε<subscript>1</subscript> and ε<subscript>2</subscript> may
+be illustrated by the graph below, We are requiring that at
+x<subscript>i</subscript> the value of the function
+f(x<subscript>i</subscript>) be between the upper and lower bounds
+ε<subscript>1</subscript> and -ε<subscript>2</subscript>.
+Also the distance d between x<subscript>i+1</subscript> and
+x<subscript>i</subscript> should be less than
+ε<subscript>1</subscript>. Observe that we are never concerned
+with more than two successive aproximations to the root — say x
+and x<subscript>m</subscript> (for next x) — and that the
+incrementing of i is not really necessary.</para>
+
+<!-- beginpage -->
+
+<!-- The "NO CONVERGENCE" literal in figure 4 was missing a trailing quote. -->
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='fig4.png'/>
+ </imageobject>
+</mediaobject>
+
+<!-- beginpage -->
+<programlisting>
+&newton2;
+</programlisting>
+
+<para>The first statement, labelled GAMMA, would cause the program to
+read from the data card the numbers a, b, c, x<subscript>0</subscript>,
+ε<subscript>=1</subscript>, ε<subscript>2</subscript>, and
+n<subscript>0</subscript>. The format of the input information is to
+be found in a block of storage labelled "CARD" whose values are set
+later in the program by a VECTOR VALUES statement. The vector CARD
+actually has as values the format information in alphabetic form
+(sometimes called HOllerith, or binary-coded decimal (BCD) form). The
+con­struction and analysis of format information is thoroughly
+discussed in Chapter II.</para>
+<!-- page break at the soft hyphen above -->
+
+<para>The second statement in the program causes the inout information,
+properly labeled., to print out, preceded by the title "SOLUTION OF
+CUBIC EQUATION". The appropriate alphabetic information is contained
+in the format information which is t be found in the vecvtor TITLE, as
+set by a VECTOR VALUES statement later in the program.</para>
+
+<!-- in the original, there was a run-on typo, "NO CONVERGENCEis" -->
+<para>Two functions are defined in this program, and each is
+designated as an INTERNAL FUNCTION. The statement following that
+whuich is labelled BETA illustrates a conditional output statement.
+If the iteration is terminated because i ≥
+n<subscript>0</subscript>, the alphabetic information NO CONVERGENCE
+is printed before the values of I and X are printed, otherwise that
+remark is not printed. The final transfer to GAMMA cause the program
+to start over with a new set of data, if additional data is present,
+otherwise, the computation is automatically terminated.</para>
+
+<para>The VECTOR VALUES statement, illustrated here, may be used to
+cause vectors (and matrices) to be initialized to any desired value
+(even alphabetic values) before the program computation is begun. Of
+course, these values could be computed or read in as input, if
+desired, so that the data for a problem could be preceded by its own
+description of format, in problems where the format may change from
+one set of data to another.</para>
+</chapter>
+
+<chapter><title>DESCRIPTION OF THE LANGUAGE</title>
+
+<sect1><title>Constants, Variables, Operations, and Expressions</title>
+
+<sect2 id='constants'><title>Constants</title>
+
+<para>There are four classes of constants: Integer, floating point,
+alphabetic, and Boolean.</para>
+
+<sect3><title>Integer Constants</title>
+
+<para>Integer constants contain from 2 to 10 decimal digits. The
+decimal point is assumed to be immediately to the right of the
+rightmost digit, but is <emphasis>always</emphasis> omitted. Integers
+may be positive or negative, and while the "+" sign may be omitted,
+the "-" sign must be present if the number is negative (e.g., 2, -2, 0,
++0, -0. 100 are all integers). Leading (but not following) zeros may
+be omitted (e.g., 5 and 005 represent the same integer, but 3 and 300
+do not.</para>
+</sect3>
+
+<sect3><title>Floating Point Constants</title>
+
+<para>Floating point constants may be written with or without
+exponents. If written without an exponent, the constant contains from
+one to eight digits and a decimal point ".", which must be written,
+but which may appear anywhere in the number. Thus, 0., 1.5, -0.05,
++100.0, .1 and -4. are all floating-point constants. If the number is
+written with an exponent, it must contain from one to eight digits
+with or without a decimal point, followed by the letter "E", followed
+by the exponent of the power of 10 that multiplies the number. (If
+the decimal point is omitted, it is assumed to be immediately to the
+left of the letter "E".) The exponent m consists of one or two digits
+preceded by a sign (although a "+" sign may be omitted), and must
+satisfy the condition -38 ≥ m ≥ 38. Examples of floating-point
+constants with exponent are;
+
+<!-- beginpage -->
+
+.05E-2(= .05 × 10<superscript>-2</superscript>) -.05E2(= -.05
+× 10<superscript>2</superscript>),
+5E02(=5.0×10<superscript>2</superscript>),
+5.E2(-5.0×10<superscript>2</superscript>).</para>
+
+<para>Negative floating point constants must be preceded by a
+"-" sign. Positive constants may be preceded by a "+" sign.</para>
+</sect3>
+
+<sect3><title>Alphabetic Constants</title>
+<para>An alphabetic consists of from one to six admissible
+characters preceded and followed by the character "$". The admiss-
+ible characters include all letters of the alphabet, the digits 0
+through 9, the special characters +, -(minus sign), -(dash), *,
+/, =, ). (. ., the comma "," and the blank space, to be represented
+here occasionally (but not punched on input cards), as the character
+"□". Thus the following are alphabetic constants: $ABCD$, $TO BE$,
+$DEC. 4$, $5 +3=8$. Note that blank spaces, while ignored elsewhere
+in the language, count as characters in alphabetic constants. An
+alphabetic constant is stored internally as an integer, and any
+constant containing fewer than six characters will be extended to six
+characters by adding blanks on the right; thus $ABCD$ will appear
+internally as $ABCD□□$
+</para>
+</sect3>
+
+<sect3><title>Boolean Constants</title>
+<para>There are two Boolean constants – "true", which is written
+1B, and "false" which is written 0B.</para>
+</sect3>
+</sect2>
+<sect2><title>Variables</title>
+
+<para>The name of a variable consists of one to six letters or digits,
+the first of which must be a letter. If the variable is defined as an
+n-dimensional array variable (see section 3.3) then the name of an
+element of the array consists of the variable name, (i.e one to six
+letters or digits, starting with a letter), followed by the
+appropriate subscripts separated by commas and enclosed in
+parentheses. Thus the following are "single variables:": X51, ALPHA6,
+LAMBDA, GROSS, while the following are elements of arrays: BETA(C1,
+C2, 6), X15(Y, Z1), J(6), J(Z1 + 5 *Z2, 5). (See <xref
+linkend='subscripts'/> for the description of subscripts.) Parentheses
+enclosing subscripts may not be <!-- beginpage --> omitted.</para>
+</sect2>
+
+<!-- begin page -->
+
+<sect2><title>Statement Labels</title> <para>A statement may be
+labelled or unlabelled. Labels are used to refer to a statement in
+other statements. A statement label consists of from one to six
+letters or digits, the first of which must be a letter, e.g. IN or
+BACK. A statement label may be an element of a statement label
+vector, in which case the vector name is followed by a
+<emphasis>constant</emphasis> integer subscript enclosed in
+parentheses, e.g. S(2) or LBL(3). A statement label appears in the
+label field (i.e. columns 1-10) of the statement it identifies. When
+a statement extends to additional cards (i.e. cards identified by a
+digit punched in col. 11) the statement label need not be punched on
+the additional cards.</para>
+</sect2>
+
+<sect2 id='functions'><title>Functions</title>
+<para>The name of a function consists of one to six letters or digits
+followed by a period "." which must be written. The first character
+of a function name must be a letter. If the function is
+single-valued, then the value of the function is represented by
+following the function name by the proper number of arguments (see
+section 3.8 for the definition of function) separated by commas and
+enclosed in parentheses. Thus, ADD51., COS., POLY., and FUNCT3. are
+function names, while ADD51. (X,Y,ADD.), POLY. (N, VJ, 7) and COS. (X)
+are values of functions.</para>
+</sect2>
+
+<sect2><title>Arithmetic Operations</title>
+<para>The following arithmetic operations are available:</para>
+
+<orderedlist numeration='loweralpha'>
+<listitem><para>Addition, written as "+", e.g., Z5 + D.</para></listitem>
+
+<listitem><para>Subtraction, written as "-", e.g., Z5 - D. (Note,
+both the minus sign and the dash are accepted.)</para></listitem>
+
+<listitem><para>Multiplication, written as "*", e.g. Z5*D. (Note that the
+"*" may not be omitted. It is illegal to write Z5D, since it
+would be impossible to distinguish such a product from the
+variable Z5D.)</para></listitem>
+
+<listitem><para>Division, written as "/"; e.g., Z5/D. If both Z5 and D
+are integers, the result is again an integer; e.g., the
+"fractional part" of the true quotient is truncated (not
+rounded). For example, if Z5 = 7, and D = 3, the Z5 = D will
+have the value 2.</para></listitem>
+
+<!-- beginpage -->
+<listitem><para>Exponentiation, written as ".P.", e.g., Z5.P.D, and
+meaning (Z5)<superscript>D</superscript>, i.e., Z5 raised to the power
+D.</para></listitem>
+
+<listitem><para>Negation, written as "-", e.g., -ALOHA, meaning the
+"negative of ALOHA." Thus-X.P.-.5
+means-(X<superscript>-.5</superscript>).
+<!-- in the original, 'graph continued with ", the negative of the" -->
+</para></listitem>
+</orderedlist>
+</sect2>
+
+<sect2><title>Arithmetic Expressions</title>
+
+<para>Arithmetic expressions are defined inductively as follows:</para>
+
+<orderedlist numeration='loweralpha'>
+<listitem><para>All integer, floating point, and alphabetic constants,
+integer and floating point individual variables, subscripted integer
+and floating point array variables, and integer and floating point
+values of functions are arithmetic expressions.</para></listitem>
+
+<listitem><para>If E and F are any arithmetic expressions and V and
+individual or subscripted array variable, then the following
+are also arithmetic expressions: +E, -E, .ABS.E, E + F, E - F,
+E * F, E/F, E.P.F, and (E).</para></listitem>
+
+<listitem><para>The only arithmetic expressions are those arising in
+(a) and (b).</para></listitem>
+</orderedlist>
+</sect2>
+
+<sect2><title>Boolean Operations</title>
+<para>The following Boolean, or logical, oeprations are available in the
+language (where M and P are boolean expressions):</para>
+
+<orderedlist numeration='loweralpha'>
+<listitem><para>.NOT.M has the value 1B if and only if M has the value
+0B.</para></listitem>
+
+<listitem><para>(M) has the same value as M.</para></listitem>
+
+<listitem><para>M.OR.P has the value 0B if and only if both M and P
+have the value 0B.</para></listitem>
+
+<listitem><para>M.AND.P has the value 1B if and only if both M and P
+have the value 1B.</para></listitem>
+
+<listitem><para>M.THEN.P has the value 0B if and only if M has the
+value 1B and P has the value 0B.</para></listitem>
+
+<!-- beginpage -->
+
+<listitem><para>M.EQV.P has the value 1B if and only if M and P have
+the same values.</para></listitem>
+</orderedlist>
+
+<para>Thus, .NOT., .OR., .AND., .THEN., AND .EQV. correspond to the
+usual logical operations, ~, ∨, ∧, ⊃, and ≡.</para>
+</sect2>
+
+<sect2 id='boolean_expressions'><title>Boolean Expressions</title>
+
+<para>Boolean expressions are defined inductively as follows:</para>
+
+<orderedlist numeration='loweralpha'>
+<listitem><para>Boolean constants, Boolean individual variables,
+Boolean subscripted array variables and Boolean-valued functions are
+Boolean expressions. (see <xref linkend="functions"/> and
+section 3.2).</para></listitem>
+
+<listitem><para>If H and F are arithmetic expressions: then H.L.F.,
+H.LE.F, H.E.F., H.NE.F, H.G.F., H.GE.F, are Boolean
+expressions, where the meanings are H < F, H ≤ F, H = F, H ≠
+F, H > F, and H ≥ F, respectively.</para></listitem>
+
+<listitem><para>If M and P are Boolean expressions, then the following are
+also Boolean expressions: .NOT.M,(M), M.OR.P, M.AND.P,
+M.THEN.P, and M.EQV.P.</para></listitem>
+
+<listitem><para>The only Boolean expressions are those that arise in (a),
+(b), and (c).</para></listitem>
+</orderedlist>
+
+<para>Examples of Boolean expressions are: (X .G. 3 .AND. Y .LE. 2)
+.OR. (GAMMA .L. EPSILN), and ((P .AND. Q) .THEN. Q) .EQV. (P
+.OR. .NOT.P), where P and Q are Boolean variables.</para>
+</sect2>
+
+<sect2><title>Parentheses Conventions</title>
+
+<para>Parentheses are used in the same way as in ordinary algebra and logic
+to specify the order of the computation. Also, certain conventions
+are used to allow deletion of parentheses. The conventions used here
+are the same as in ordinary algebra and logic, namely: Parentheses may
+be omitted, subject to the rules (A) and (B) below, but redundant
+parentheses are allowed.</para>
+
+<para>(A) Within any expression the sequence of computation, unless
+otherwise indicated by parentheses, is:</para>
+
+<!-- beginpage -->
+<literallayout>
+ .ABS., + (as unary operations)
+ .P.
+ - (as a unary operator)
+ *, /
+ +, - (as binary operations, i.e., addition and subtraction)
+
+ .E., .NE., .G., .GE., .L., .LE.
+ .NOT.
+ .AND.
+ .OR.
+ .THEN.
+ .EQV.
+ , (as used to separate function arguments)
+ =
+</literallayout>
+
+<para>Examples:</para>
+
+<literallayout>
+ (1) .ABS.(B - C) means |B - C|, while .ABS.B - C means |B| - C.
+ (2) -B + C means (-B) + (C), while -(B + C) means the negation of
+ the sum.
+ (3) B.P. - X + Y means B<superscript>-X</superscript> + Y, while B.P.(-X + Y) means B<superscript>-X</superscript>+Y.
+ (4) K2/Z - 3 (K2/Z) - 3, while K2/(Z - 3) implies that Z - 3 is
+ the denominator.
+ (5) A * B + C means (A * B) + C.
+ (6) A.P.3/J means (A<superscript>3</superscript>)/J
+ (7) X.L. Y + 3 means (X) .L. (Y + 3).
+ (8) P.AND..NOT.P .EQV.Q means (P.AND.(.NOT.P)).EQV.Q.
+ (9) Z = X + Y /QA means Z = (X + Y/QA))
+ (10) A = -B.P.X means A = -(B<superscript>X</superscript>).
+</literallayout>
+
+<para>(B) Within an expression operations appearing on the same line
+of the list in (A) are to be performed from left to right, unless
+otherwise indicated by parentheses.</para>
+
+<!-- beginpage -->
+<para>Examples:</para>
+
+<literallayout>
+ (1) A + B - C + D - E means (((A + B) - C) + D) - E.
+ (2) X/Z * Y/R * S means (((X/Z) * Y/R) * S.
+</literallayout>
+</sect2>
+
+<sect2 id='expression_modes'><title>Mode of Expressions</title>
+
+<para>The kind of arithmetic performed on a constant, variable or
+function value is determined by its mode. There are five modes in
+MAD; floating point, integer, Boolean, statement label, and function
+name. Floating point, integer, and Boolean constants were described
+in <xref linkend='constants'/>. Alphabetic constants are assumed to
+be of integer mode. Section 3.2 describes how the modes of variables
+and functions are specified.</para>
+
+<para>If an expression consists entirely of one constant, one
+variable, or one function value, the mode is that of the constant,
+variable, of functional value itself. If the expression is a compound
+expression; i.e., consists of two or more subexpressions joined by
+logical or arithmetic operations, the following rule applies:</para>
+
+<para>If an expression is a Boolean expression as defined in <xref
+linkend='boolean_expressions'/>, then its mode is Boolean. An
+arithmetic expression is considered to be in the floating point mode
+if any operand of any arithmetic expression in the expression is in
+the floating point mode. If all operands are integer (or alphabetic),
+then the expression is conisdered to be in the integer mode. In this
+determination arguments, though not values, of functions are
+ignored.</para>
+
+<para>Thus, if Y, Z, and W are floating point variables, while the
+function GCD. and the variables I and J are in the integer mode, then
+the expressions</para>
+
+<literallayout>
+ Y = GCD.(I, J)
+ Y + Z - I
+ I + 1.
+ GCD. (I, J)/Z
+</literallayout>
+
+<para>are all floating point expressions while the expressions</para>
+
+<literallayout>
+ I + GCD.(I, J)
+ (I + J)/3
+ I + 1
+ GCD.(I, J)/I
+</literallayout>
+<!-- beginpage -->
+<para>are all integer expressions.</para>
+
+<para>If an expression has subexpressions of different modes, a conversion
+may be necessary before some of the operations can be performed.
+Thus, in the expression</para>
+
+<literallayout>
+ Y + 3
+</literallayout>
+
+<para>if Y is in the floating point mode it cannot be added directly
+to the integer 3. But for one precaution the user need not be
+concerned with this since the instructions necessary for the
+conversion of the integer to floating point form before adding are
+automatically inserted by the translator during the translation
+process. The precaution is that if the integer being converted is
+greater than 134,217,728 (i.e. 2<superscript>27</superscript>) then an
+improper conversion will take place.</para>
+
+<para>In some cases, however, the user must understand the sequence in
+which the conversions will be made. Consider the expression</para>
+
+<literallayout>
+ ( Y + 7/3) + (I * J/K)
+</literallayout>
+
+<para>where Y is in the floating point mode, and I, J, and K are in the
+integer mode. According to the parenthesizing conventions, the
+computation will proceed in the following order (where the T's are
+temporary locations):</para>
+
+<literallayout>
+ T<subscript>1</subscript> = I * J
+ T<subscript>2</subscript> = T<subscript>1</subscript>/K
+ T<subscript>3</subscript> = 7/3
+ T<subscript>4</subscript> = Y + T<subscript>3</subscript>
+ T<subscript>5</subscript> = T<subscript>4</subscript> + T<subscript>2</subscript>
+</literallayout>
+
+<para>and T<subscript>5</subscript> will be the value of the
+expression.</para>
+
+<para>Now, since both I and J are integers, the first multiplication
+will be integer multiplication, and T<subscript>1</subscript> will be
+an integer. Since the following involves two integers, it will be
+integer division, and, if K happens to have a larger value than
+T<subscript>1</subscript> the quotient is 0. Similarly,
+T<subscript>3</subscript> will have the value 2 because of the
+division of two integers. In the computation of
+T<subscript>4,</subscript> however, we have "mixed modes", since Y is
+floating point and T<subscript>3</subscript> is integer. There
+I<subscript>3</subscript> will be automatically converted to floating
+point before adding. Likewise, in the next step, <!-- beginpage
+-->the integer T<subscript>2</subscript> will be converted to floating
+point before adding to the floating point number.</para>
+
+<para>In other words, although the mode of the expression is floating
+point because of the presence of the floating point variable Y, some
+of the computation (until Y is involved) is performed in integer
+arithmetic, and this may occasionally cause the final value to be
+different from the value one might expect from a different analysis.</para>
+
+<para>In the example above, the divisions would be performed in the
+floating point mode if the expression were written:</para>
+
+<literallayout>
+ (Y + 7./3) + (I * J)/(K + 0.)
+</literallayout>
+
+<para>Of course, many times the expression will be written as
+originally stated just to achieve the "truncation" effect.</para>
+
+<para>A statement label (appearing in the label field of a statement) is a
+constant of statement label mode. A function name with no arguments
+(e.g. SIN.) is a constant of a function name mode. A single constant,
+variable, or function value of statement label (function name) mode is
+an expression of statement label (function name) mode. There are no
+other expressions of statement label (function name) mode. If A and B
+are both statement label (function name) expressions then A.E.B. and
+A.NE.B are Boolean expressions except when A or B are elements of a
+vactor which has been preset by a VECTOR VALUES statement (see section
+3.7). In this exceptional case A.E.B. and A.NE.B are not expressions.</para>
+</sect2>
+
+<sect2 id='subscripts'><title>Subscript Expressions</title>
+
+<para><emphasis>Any</emphasis> arithmetic expression may be used as a
+subscript expression for an element of a linear array. If the value
+of the expression is in the floating point mode (see
+<xref linkend='expression_modes'/>), it is truncated to integer form before
+being used as a subscript. The expressions for subscripts of elements
+of an array whose dimension is two or greater must be of integer
+mode. Moreover, for arrays of dimension three or greater the use of
+subscripts having other than integer mode will not be caught as an
+error. Subscript expressions may contain variables with subscripts,
+etc.</para>
+
+<para>Examples of subscripted variables: J(3), K10(Z + 5 * XY/T),
+MP(A, B + 6 * J, I * 6/TDX), MA(K(Z + 5) + T(1) + 6).</para>
+</sect2>
+</sect1>
+
+<sect1><title>Statements (Executable)</title>
+
+<sect2 id='substitution'><title>Substitution Statement</title>
+
+<!-- beginpage -->
+<para>This statement has the form illustrated by</para>
+
+<programlisting>
+ ALPHA = Y + Z + F.(X, Y, Z)
+</programlisting>
+
+<para>That is, the left side of the "=" sign consists of the name of a
+variable (either an individual variable or a subscripted array
+variable), and the right side consists of any expression of the same
+mode. The only exceptions to this mode requirement are the cases: (1)
+If the variable on the left is of integer mode then the value of a
+floating point expression of the right will be converted to integer
+mode. (2) if the variable on the left is of floating point mode then
+the value of an integer expression on the right will be converted to
+floating point mode.</para>
+
+<para>The substitution statement is to be interpreted as "(1) Compute the
+value of the expression on the right, (2) convert it, if necessary, to
+the mode of the variable on the left of the "=" sign, and (3) give the
+variable on the left the value which results from steps (1) and (2)."
+(See <xref linkend='expression_modes'/> for mode of expressions.)</para>
+
+<para>Thus, if Y is a floating point variable, then the statement</para>
+
+<programlisting>
+ Y = 1
+</programlisting>
+
+<para>will cause the integer 1 to be converted to floating point and then
+stored in the location called "Y"; i.e., Y will now have the value 1.
+(as a floating point number). If the statement were written</para>
+
+<programlisting>
+ Y = 1.
+</programlisting>
+
+<para>then the floating point number 1. would be stored in the
+location "Y"; i.e., Y would again have the floating point value 1.,
+but in this case the conversation of the integer is unnecessary, thus
+speeding up the computation.</para>
+
+<para>When a floating point number is to be converted to an integer,
+it is first expressed as a number with both an integer part and a
+fractional part, and then the fractional part is truncated. Thus, the
+following floating point numbers:</para>
+
+<programlisting>
+ 3E5, .3E0, .34568127E2, - .345681E10
+</programlisting>
+
+<para>would convert to the following integers, respectively:</para>
+
+<programlisting>
+ 300000, 0, 34, -3456810000.
+</programlisting>
+</sect2>
+
+<sect2><title>Transfer Statement</title>
+
+<para>This statement has the form: TRANSFER TO &statement;</para>
+
+<para>Here &statement; may be any statement label or any expression in
+<!-- beginpage -->
+statement label mode which labels an executable statement. Execution
+of this statement causes the computation to continue from the
+statement whose label is the value of &statement;. Examples: TRANSFER TO
+SUMX, TRANSFER TO SWTCH (K + 2) (if K=4 then the value of SWTCH(K+2)
+is SWTCH(6)).</para>
+
+</sect2>
+
+<sect2><title>Conditional Statements</title>
+
+<para>There are two types of conditional statements.</para>
+
+<para>(a) Simple Conditional</para>
+
+<programlisting>
+ WHENEVER B,Q
+</programlisting>
+
+<para>Here B is a Boolean expression and Q any executable statement
+except the following: end of program, another conditional, iteration,
+and function entry. If at the time of execution of this statement,
+the expression B has the value 1B, the statement Q is executed. If,
+however, B=0B, then Q is skipped and computation continues from the
+next statement in sequence. The comma in this statement, as in other
+statements containing punctuation, must be written.</para>
+
+<para>Examples:</para>
+
+<programlisting>
+ WHENEVER XM.LE.1, TRANSFER TO END
+ WHENEVER I.GE.N.AND.J.NE.I-1, I=0
+</programlisting>
+
+
+<para>(b) Compound Conditional</para>
+
+<!-- Original has hand-drawn large right curly braces pointing at each -->
+<!-- theta from the left, indicating the scope of the conditional body -->
+<programlisting>
+ &statement;<subscript>1</subscript> WHENEVER B<subscript>1</subscript>
+
+ ...
+ ... &THgr;<subscript>1</subscript>
+
+ &statement;<subscript>2</subscript> OR WHENEVER B<subscript>2</subscript>
+ ...
+ ... &THgr;<subscript>2</subscript>
+ ...
+ ...
+ &statement;<subscript>k</subscript> OR WHENEVER B<subscript>k</subscript>
+ ...
+ ... &THgr;<subscript>k</subscript>
+ &statement;<subscript>k</subscript>+1 END OF CONDITIONAL
+</programlisting>
+
+<para>Often the last condition B<subscript>k</subscript> is always
+true. This may be epxressed by the statement</para>
+<!-- beginpage -->
+
+<programlisting>
+ OR WHENEVER 1B
+</programlisting>
+
+<para>or alternately the statement</para>
+
+<programlisting>
+ OTHERWISE
+</programlisting>
+
+<para>The &statement;<subscript>i</subscript> are statement labels which
+need not be used unless desired. k may equal one (if no "OR
+WHENEVER..." statements are used). Here B<subscript>1</subscript>,
+..., B<subscript>k</subscript> are Boolean expressions, and the
+execution of this block of statements is as follows.</para>
+
+<para>Each B<subscript>1</subscript> is tested in turn, starting with
+B<subscript>1</subscript>. It B<subscript>1</subscript> has the value
+0B, then B<subscript>2</subscript> is tested, etc. As soon as some
+expression, say B<subscript>j</subscript>, has the value 1B, then the
+statements between (but not including)
+&statement;<subscript>j</subscript> and
+&statement;<subscript>j+1</subscript>
+(i.e. &THgr;<subscript>j</subscript>) are executed. At this point the
+execution of the entire block is considered ended, and computation
+continues from the first statement after the declaration labelled
+&statement;<subscript>k+1</subscript>. In other words, at most one of
+the alternative computations is performed; e.g., that one which
+immediately follows the first expression B<subscript>1</subscript>
+which has the value 1B. If none of the B<subscript>i</subscript> has
+the value 1B, none of the computation in the scope of these statements
+is performed.</para>
+
+<para>Example: The evaluation of the function whose graph is</para>
+
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='fig5.png'/>
+ </imageobject>
+</mediaobject>
+
+<para>might be given by the section of the program:</para>
+
+<programlisting>
+ WHENEVER X .LE. 0. .OR. 1. .LE. X .AND. X .L. 2. .OR. X .GE.3
+ Y = 0.
+ OR WHENEVER 0 .LE. X .AND. X. .L. 3.
+ Y = 1.
+ END OF CONDITIONAL
+</programlisting>
+
+<para>This section of program could be rewritten in another way.</para>
+
+<!-- beginpage after "Y = X" -->
+<programlisting>
+ WHENEVER 0. .LE. X .AND. X .L. 1.
+ Y = X
+ OR WHENEVER 2. .LE. X .AND. X .L. 3.
+ Y = 1.
+ OTHERWISE
+ Y = 0.
+ END OF CONDITIONAL
+</programlisting>
+
+<para>The indentation of the statements between the conditional statements
+is not required but contributes to the readability.</para>
+</sect2>
+
+<sect2><title>CONTINUE Statement</title>
+
+<para>This statement has the simple form:</para>
+
+<programlisting>
+ CONTINUE
+</programlisting>
+
+<para>It serves as an entry point in the program, and causes no computation
+to be performed by its presence or absence.</para>
+</sect2>
+
+<sect2><title>THROUGH (Iteration) Statement</title>
+
+<para>The following program segment illustrates the use of this
+statement.</para>
+
+<programlisting>
+ .
+ .
+ .
+ A = D(1, 1)
+ THROUGH ST1, FOR I = 1, I .G. 10
+ THROUGH ST1, FOR J = 1, J .G. 10
+ WHENEVER A .LE. D(I, J), TRANSFER TO ST1
+ K = I
+ L = J
+ ST1 CONTINUE
+ .
+ .
+ .
+</programlisting>
+
+<para>This statement casues the block of statements which follows
+immediately afterwards to be repeatedly executed, each time varying
+the value of some variable, until the specified list of values for
+that variable is exhausted, or until some specified condition is
+satisfied. The THROUGH statement may take either of the following two
+forms.</para>
+
+<para>(a) THROUGH &statement;, FOR VALUES OF V =
+E<subscript>1</subscript>, E<subscript>2</subscript>, ...,
+E<subscript>m</subscript></para> <para>Here &statement; is the statement
+label of the last executable statement in the block to be repeated.
+The block of statements following (and not including) the THROUGH
+statement, up to <emphasis>and including</emphasis> the statement
+whose label is &statement;, will be called the "scope" of the THROUGH
+statement. Following the word OF appears the name of the iteration
+variable (in <!-- beginpage -->the illustration: V), which may be
+either an individual variable or subscripted array variable of any
+mode. To the right of the "=" sign may appear any number of
+expressions E<subscript>1</subscript>, ... E<subscript>m</subscript>.
+The modes of the E<subscript>1</subscript> bear the same relationship
+to the mode of V as they would in the statement V =
+E<subscript>1</subscript> (see <xref linkend='substitution'/>).</para>
+
+<para>The execution of this statement causes the statements within its
+"scope" to be executed, first with V = E<subscript>1</subscript>, then
+again with V = E<subscript>2</subscript>, and so on, until the list of
+expressions is exhausted. Computation then proceeds with the
+statement immediately following statement &statement;. At this time the
+iteration variable will have the value of the expression
+E<subscript>m</subscript> unless <!-- beginpage -->its value was
+changed during the final iteration. An example of this type of
+statement is:</para>
+
+<programlisting>
+ THROUGH A, FOR VALUES OF BETA = 3, 4, X5, Y(6 + I) + 3
+ J = 5 = BETA + 6
+ J1 = J .P..5 - 1
+ A X(BETA) = J1 * COS.(2. * THETA)
+</programlisting>
+
+<para>(b) THROUGH &statement;, FOR V = E<subscript>1</subscript>,
+E<subscript>2</subscript>, B</para>
+
+<para>Here &statement; is a statement which defines the "scope" exactly
+as in (a) above (with the exception: If &statement; is the label of the
+THROUGH statement itself, the iteration will proceed as described
+below, but the scope will be empty, and the iteration will consist
+only of the incrementing of V by E<subscript>2</subscript> and the
+testing.) Following the word FOR is the name of the iteration
+variable (in the illustration: V), which may be an individual variable
+or subscripted array variable of any mode. The modes of
+E<subscript>1</subscript> and E<subscript>2</subscript> are subject to
+the rules which would apply to the statements V =
+E<subscript>1</subscript> and V = V + E<subscript>2</subscript>. B is
+a Boolean expression.</para>
+
+<para>The execution of the statement proceeds as follows: The variable
+V is set equal to E<subscript>1</subscript>. If the value of B = 1B,
+the scope of the THROUGH statement is not executed. If the value of B
+= 0B, the scope is executed. V is then incremented by
+E<subscript>2</subscript>, and B is tested again. In general, as soon
+as B = 1B, the scope is not executed, and the computation proceeds
+from the statement immediately following statement &statement;. Each
+time B = 0B, the statements in the scope are executed, then V is
+incremented by E<subscript>2</subscript>, and B is tested again.
+Thus, when the iteration is finished and B = 1B, V has the value used
+during the last computation of the scope, incremented by
+E<subscript>2</subscript>. The scope will not have been executed for
+this value of V. (The value of V will be E<subscript>1</subscript>,
+of course, if B = 1B before the scope is executed at all.) If, at any
+time, the computation transfers out of the iteration to another part
+of the program, the value of V will be the current value at the time
+the transfer was made.</para>
+
+<para>In all cases, every reference to an expression
+E<subscript>1</subscript> will involve its current value at the time
+of reference. Moreover, the variable <!-- beginpage --> V may have
+its value changed at any time during the execution of the
+scope.</para>
+
+</sect2>
+</sect1>
+</chapter>
+</book>