]> thyrsus.com Git - mad.git/commitdiff
Another page.
authorEric S. Raymond <esr@thyrsus,com>
Sat, 13 Mar 2004 15:31:40 +0000 (15:31 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Sat, 13 Mar 2004 15:31:40 +0000 (15:31 +0000)
doc/mad-manual.xml

index e3576d638508b75c6bc7e1754ed60ffccbbc4e91..314e345845b2ccc293d8a8f8a2a2f6bbead80c49 100644 (file)
@@ -3594,7 +3594,7 @@ values of a, b, and C are printed immediately after they are brought
 in to help in finding trouble spots during the development of the
 program (not as necessary here as in longer problems, but a good
 idea!).</para>
-<!-- beginpage -->
+<!-- beginpage III.2 -->
 
 <para><emphasis>Flow Diagram:</emphasis></para>
 
@@ -3603,13 +3603,13 @@ idea!).</para>
     <imagedata fileref='fig07.png'/>
   </imageobject>
 </mediaobject>
-<!-- beginpage -->
+<!-- beginpage III.3 -->
 
 <para><emphasis>The Program:</emphasis></para>
 
 <programlisting>
 &quadratic;
-<!-- beginpage -->
+<!-- beginpage III.4 -->
 *DATA
           4.          -8.          4.
           0            5.         10.
@@ -3695,7 +3695,7 @@ original table had:
 
 <para>The problem is to write a program to generate the entire "truth
 table" for the given expression T.</para>
-<!-- beginpage -->
+<!-- beginpage III.5 -->
 
 <para><emphasis>Flow Diagram:</emphasis></para>
 
@@ -3704,7 +3704,7 @@ table" for the given expression T.</para>
     <imagedata fileref='fig08.png'/>
   </imageobject>
 </mediaobject>
-<!-- beginpage -->
+<!-- beginpage III.6 -->
 
 <para><emphasis>The Program:</emphasis></para>
 
@@ -3726,7 +3726,7 @@ NORMAL MODE IS BOOLEAN
 instead of the BOOLEAN declaration.</para>
 
 </sect2>
-<!-- beginpage -->
+<!-- beginpage III.7 -->
 <sect2><title>Example 3<emphasis role='note'>: Simpson's Rule approximation of a definite integral</emphasis></title>
 
 <para><emphasis>Problem:</emphasis> To approximate 
@@ -3764,7 +3764,7 @@ external function or an internal function.</para>
     <imagedata fileref='fig09.png'/>
   </imageobject>
 </mediaobject>
-<!-- beginpage -->
+<!-- beginpage III.8 -->
 
 <para><emphasis>The Program:</emphasis></para>
 
@@ -3775,11 +3775,11 @@ external function or an internal function.</para>
 <para>If, for some reason, the integral of sin 3x - cos(rx + 1) were
 needed if 0 &le; x &le; 3, and the integral of sin 3x - cos(rx)
 otherwise, the program might then be as follows:</para>
-<!-- beginpage -->
+<!-- beginpage III.9 -->
 
 <para><emphasis>The Program:</emphasis></para>
 
-<!-- beginpage after H = (B-A)/N -->
+<!-- beginpage III.10 after H = (B-A)/N -->
 <programlisting>
 &simpsmain;
 </programlisting>
@@ -3809,12 +3809,52 @@ READ    READ FORMAT INPUTS,A,B,N,R
        FUNCTION NAME S
 </programlisting>
 </sect2>
-<!-- beginpage -->
+<!-- beginpage III.11 -->
 <sect2><title>Example 4<emphasis role='note'>: Find roots of a function by half-interval approximation</emphasis></title>
 
-<!-- FIXME: TEXT FOR PAGE III. 11 GOES HERE -->
-
-<!-- beginpage -->
+<para><emphasis>Problem:</emphasis> To find a real solution (if it
+exists) of the equation f(x) = 0 (where f is a continuous function)
+obn an arbitrary interval [a, b], provided the roots (if there are
+more than one) are at least &epsi; apart.</para>
+
+<para><emphasis>Analysis:</emphasis> We specify a, b, and &epsi; as
+parameters.  The method used will be "half-interval convergence," in
+which the function is evaluated at x -a, and then the interval is
+scanned for a change of sign<footnote><para>A change of sign is
+detected when the numbers involved have a negative
+product.</para></footnote> in the value of f(x). If no change odf sign
+is found, the scanning is repeated with a step size for searching half
+of the previous size. If the step size becomes smaller than &epsi;,
+and no change of sign is found, the process is terminated, and comment
+is printed: "NO SOLUTION".</para> 
+
+<!-- the original formula used a horizontal division bar and no parens -->
+<para>If a change of sign is found between x<subscript>L</subscript>
+and x<subscript>R</subscript>, the value of f is computeed at
+x<subscript>M</subscript> = (x<subscript>L</subscript> +
+x<subscript>R</subscript>)/2, i.e. the midpoint of the interval of
+uncertainty [x<subscript>L</subscript>, x<subscript>R</subscript>]. We
+then determine which one of the intervals [x<subscript>L</subscript>,
+x<subscript>M</subscript>]. [x<subscript>M</subscript>,
+x<subscript>R</subscript>] now contains a change in sign.  We then
+compute the value of f at the midpoint of that smaller interval, etc.,
+until the interval being considered finally has length less that
+&epsi;, at which time either end may be taken as the solution with an
+error less than &epsi;.</para>
+
+<para>The method used here to handle the x<subscript>M</subscript>
+cpomputation is perhaps not the most obvious one. It consists of 
+a simple loop in which the value of x is adjusted by h&prime; = -h/2, then
+h&prime;&prime; - h&prime;/2 = h/4, etc., until h is small enough. The
+adjustment of x is either to the left or to the right, depending on
+the occurrence or non-occurrence, respectively, of a change of sign
+between f(a) and f(x).</para>
+
+<para>It should be understood that this method may not find a root
+which is one of a pair of roots which either coincide or are less that
+&epsi; apart.</para>
+
+<!-- beginpage III.12 -->
 <para><emphasis>Flow diagram:</emphasis></para>
 
 <mediaobject>
@@ -3822,7 +3862,7 @@ READ      READ FORMAT INPUTS,A,B,N,R
     <imagedata fileref='fig10.png'/>
   </imageobject>
 </mediaobject>
-<!-- beginpage -->
+<!-- beginpage III.13 -->
 
 <para><emphasis>Program:</emphasis> It is assumed here that f
 (referred to as F. in the program) will be defined as an internal
@@ -3836,14 +3876,14 @@ programs were punched-card decks.  An internal function definition was
 typically a single card that could be slipped anywhere into the 
 program deck.</para></note>
 
-<!-- pagebreak after the VECTOR VALUES ABEPS line -->
+<!-- beginpage III.14 after the VECTOR VALUES ABEPS line -->
 <programlisting>
 &findroot;
 *DATA
           1.          2.          .01
 </programlisting>
 </sect2>
-<!-- pagebreak -->
+<!-- beginpage III.15 -->
 <sect2><title>Example 5<emphasis role='note'>: Compute the transpose of a matrix</emphasis></title>
 
 <para><emphasis>Problem:</emphasis> Find the transpose A' of an n&times;n
@@ -3875,7 +3915,7 @@ argument in a function <emphasis>definition</emphasis> program.  The
 function would be <emphasis>called</emphasis> with a statement of the
 form EXECUTE TRANS.(A, N).</para>
 </sect2>
-<!-- pagebreak -->
+<!-- beginpage III.16 -->
 <sect2><title>Example 6<emphasis role='note'>: Matrix multiplication</emphasis></title>
 
 <para><emphasis>Problem:</emphasis> Multiply the matrix A =
@@ -3903,7 +3943,7 @@ of C is computed by the formula</para>
   </imageobject>
 </mediaobject>
 
-<!-- pagebreak; -->
+<!-- beginpage III.17 -->
 
 <note><para>The Retrocomputing Museum implementation cannot yet
 compile this example.  The problem is the EQUIVALENCE declaration;
@@ -3914,7 +3954,7 @@ there is no general way to implement this in generated C.</para></note>
 
 <programlisting>
 &matrixmult;
-<!-- pagebreak; -->
+<!-- beginpage III.18 -->
 * DATA
    2   3   3
           1.           2.           3.           4.          5.          6.
@@ -3922,12 +3962,12 @@ there is no general way to implement this in generated C.</para></note>
          13.          14.          15.
 </programlisting>
 </sect2>
-<!-- pagebreak; -->
+<!-- beginpage III.19 -->
 <sect2><title>Example 7<emphasis role='note'>: Solve simultaneous linear equations</emphasis></title>
 
 <!-- FIXME: TEXT FOR PAGES III.19-20 GOES HERE -->
 
-<!-- beginpage -->
+<!-- beginpage III.21 -->
 <para><emphasis>Flow diagram:</emphasis></para>
 
 <mediaobject>
@@ -3936,13 +3976,13 @@ there is no general way to implement this in generated C.</para></note>
   </imageobject>
 </mediaobject>
 
-<!-- beginpage -->
+<!-- beginpage III.22 -->
 
 <para><emphasis>The Program:</emphasis></para>
 
 <programlisting>
 &jordan;
-<!-- pagebreak; -->
+<!-- beginpage III.23 hust before VECTOR VALUES RESULT -->
 * DATA
    3
           1.           1.           1.           6.         -1.           0
@@ -3951,13 +3991,14 @@ there is no general way to implement this in generated C.</para></note>
 
 </sect2>
 </sect1>
-<!-- beginpage -->
+<!-- beginpage III.24 -->
 <sect1><title>Business Data Processing Examples</title>
 <sect2><title>Example 1<emphasis role='note'>: Payroll Processing</emphasis></title>
 
 <!-- FIXME: TEST FOR PAGES III.24-25 GOES HERE -->
 
-<!-- beginpage -->
+<!-- beginpage III.26 -->
+<!-- this heading was not present in the original -->
 <para><emphasis>Flow diagram:</emphasis></para>
 
 <mediaobject>
@@ -3966,13 +4007,12 @@ there is no general way to implement this in generated C.</para></note>
   </imageobject>
 </mediaobject>
 
-<!-- beginpage -->
+<!-- beginpage III.27 -->
 
 <para><emphasis>The Program:</emphasis></para>
 
 <programlisting>
 &payroll;
-<!-- pagebreak; -->
 * DATA
 GEORGE WASHINGTON                        12345678 100.    4800.
 JOHN ADAMS                               12345679 200.    4900.
@@ -3981,12 +4021,11 @@ JAMES MADISON                            12345681 200.    4700.
 JOHN QUINCY ADAMS                        12345682 100.     300.
 </programlisting>
 
-<!-- beginpage -->
+<!-- beginpage III.28 -->
 <para><emphasis>Alternate Program:</emphasis></para>
 
 <programlisting>
 &altpayroll;
-<!-- pagebreak; -->
 * DATA
 GEORGE WASHINGTON                        12345678 100.    4800.
 JOHN ADAMS                               12345679 200.    4900.
@@ -3996,33 +4035,42 @@ JOHN QUINCY ADAMS                        12345682 100.     300.
 </programlisting>
 
 </sect2>
+<!-- beginpage III.29 -->
+
+<!-- FIXME: TEXT FOR PAGES III.29 GOES HERE -->
+
+<!-- beginpage III.30 -->
 <sect2><title>Example 2<emphasis role='note'>: Payroll Tape Processing</emphasis></title>
 
 <!-- FIXME: TEXT FOR PAGES III.30-32 GOES HERE -->
 
-<!-- beginpage -->
+<!-- beginpage III.33 -->
+<!-- This heading was not present in the original -->
 <para><emphasis>Flow diagram:</emphasis></para>
 
+<!-- this figure spanned pages III.33 and III.34 in the original -->
 <mediaobject>
   <imageobject>
     <imagedata fileref='fig15.png'/>
   </imageobject>
 </mediaobject>
 
-<!-- beginpage -->
-
+<!-- beginpage III.35 -->
+<!-- This heading was not present in the original -->
 <para><emphasis>The Program:</emphasis></para>
 
+<!-- this listing spans pages III.35, III.36, and III.36A -->
 <programlisting>
 &payrolltape;
 </programlisting>
 
 </sect2>
+<!-- beginpage III.37 -->
 <sect2><title>Example 3<emphasis role='note'>: Mortgage Payment Processing</emphasis></title>
 
-<!-- FIXME: TEXT FOR PAGES III.37 GOES HERE -->
+<!-- FIXME: TEXT FOR PAGE III.37 GOES HERE -->
 
-<!-- beginpage -->
+<!-- beginpage III.38 -->
 <para><emphasis>Flow diagram:</emphasis></para>
 
 <mediaobject>
@@ -4031,14 +4079,16 @@ JOHN QUINCY ADAMS                        12345682 100.     300.
   </imageobject>
 </mediaobject>
 
+<!-- beginpage III.39 -->
+
 <mediaobject>
   <imageobject>
     <imagedata fileref='fig17.png'/>
   </imageobject>
 </mediaobject>
 
-<!-- beginpage -->
-
+<!-- beginpage III.40 -->
+<!-- This heading was not present in the original -->
 <para><emphasis>The Program:</emphasis></para>
 
 <programlisting>
@@ -4046,11 +4096,12 @@ JOHN QUINCY ADAMS                        12345682 100.     300.
 </programlisting>
 
 </sect2>
+<!-- beginpage III.42 -->
 <sect2><title>Example 4<emphasis role='note'>: Actuarial computation</emphasis></title>
 
 <!-- FIXME: TEXT FOR PAGES III.42-43 GOES HERE -->
 
-<!-- beginpage -->
+<!-- beginpage III.44 -->
 <para><emphasis>Flow diagram:</emphasis></para>
 
 <mediaobject>
@@ -4059,7 +4110,7 @@ JOHN QUINCY ADAMS                        12345682 100.     300.
   </imageobject>
 </mediaobject>
 
-<!-- beginpage -->
+<!-- beginpage III.45 -->
 
 <para><emphasis>The Program:</emphasis></para>
 
@@ -4092,7 +4143,7 @@ character per word in W(1)...W(L).</para>
   </imageobject>
 </mediaobject>
 
-<!-- pagebreak -->
+<!-- beginpage -->
 <programlisting>
 &wordsearch;
 </programlisting>
@@ -4119,7 +4170,7 @@ handl<emphasis>ed.</emphasis></para>
 <programlisting>
 &factfunc;
 </programlisting>
-<!-- pagebreak; -->
+<!-- beginpage; -->
 
 <para>In order to use this function, the calling program would have to
 specify a list for use in the SAVE and RESTORE stayements.  The
@@ -4151,7 +4202,7 @@ recursive functions.</para>
 <programlisting>
 &gcdfunc;
 </programlisting>
-<!-- pagebreak; -->
+<!-- beginpage; -->
 
 <para><emphasis>Note:</emphasis> When called upon for a value, a
 function such as GCD, must have at least one argument (in this example
@@ -4190,7 +4241,7 @@ arguments of recursive functions.</para>
 <programlisting>
 &tschebfunc;
 </programlisting>
-<!-- pagebreak; -->
+<!-- beginpage; -->
 
 <para>A program which uses TSCHEB. is:</para>