annual premium payable for an entire life for $1 of whole life
insurance, (2)A<subscript>x</subscript> =
M<subscript>x</subscript>/D<subscript>x</subscript>, which is the
-single permium payable at age x for $1 of whole life insurance, and
+single premium payable at age x for $1 of whole life insurance, and
(2)a<subscript>x</subscript> =
N<subscript>x</subscript>/D<subscript>x</subscript>, which is the
present value at age x of a whole life annuity of $1, first payment
-at age $x.</para>
+at age x.</para>
<para>Printing of results is under the control of an input variable
PRINT. Certain relationships must hold between some independently
&commutefunc;
</programlisting>
+<!-- beginpage III.46 after "M(OMEGA) = C(OMEGA)" in listing -->
+<!-- beginpage III.47 after line labeled GAMMA in listing -->
+
</sect2>
</sect1>
+<!-- beginpage III.48 -->
<sect1><title>Symbol Manipulation and Recursive Function Examples</title>
<sect2><title><emphasis role='note'>Example 1: Find a word in a string</emphasis></title>
</imageobject>
</mediaobject>
+<!-- beginpage III.49 -->
+
<!-- beginpage -->
<programlisting>
&wordsearch;
</programlisting>
</sect2>
+<!-- beginpage III.50 -->
<sect2><title><emphasis role='note'>Example 2: Compute the factorial function</emphasis></title>
<para><emphasis>Problem:</emphasis> Evaluate the recursive function,</para>
<programlisting>
&factfunc;
</programlisting>
-<!-- beginpage; -->
+<!-- beginpage III.51 -->
<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
</programlisting>
</sect2>
+<!-- beginpage III.52 -->
<sect2><title><emphasis role='note'>Example 3: Compute greatest common
divisor</emphasis></title>
<para><emphasis>Problem:</emphasis> To find the greatest common
<para><emphasis>Analysis:</emphasis> The greatest common divisor is
defined recursively by three equations</para>
-<!-- FIXME: MATH GOES HERE -->
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='equation9.png'/>
+ </imageobject>
+</mediaobject>
<para>Where REM.(A,B) is the remainder of A/B. This function expects
the arguments to be found on the temporary storage list as the two
remove many pitfalls encountered in using dummy variables with
recursive functions.</para>
+<!-- beginpage III.53 -->
<programlisting>
&gcdfunc;
</programlisting>
-<!-- beginpage; -->
+<!-- beginpage III.54 -->
<para><emphasis>Note:</emphasis> When called upon for a value, a
function such as GCD, must have at least one argument (in this example
before any use of SAVE or RESTORE), since the SAVE and RESTORE
statements always refer to the current list.</para>
+<!-- beginpage III.55 -->
+
<para>An example of a program using GCD. is:</para>
<programlisting>
</programlisting>
</sect2>
+<!-- beginpage III.56 -->
<sect2><title><emphasis role='note'>Example 4: Evaluate Tschebychev polynomials</emphasis></title>
<para><emphasis>Problem:</emphasis> To evaluate Tschebychev polynomials.</para>
<para><emphasis>Analysis:</emphasis> The Tschebychev polynomial T(N,X)
is defined recursively as follows:</para>
-<!-- FIXME: MATH GOES HERE -->
+<mediaobject>
+ <imageobject>
+ <imagedata fileref='equation10.png'/>
+ </imageobject>
+</mediaobject>
<para>It is important to understand that when an expression is written
as an argument of a function its value is computed and stored in a
a temporary location is that often expressions cannot be used as
arguments of recursive functions.</para>
+<!-- beginpage III.57 -->
<programlisting>
&tschebfunc;
</programlisting>
</sect2>
</sect1>
</chapter>
+<!-- beginpage III.58 -->
+
</book>
<!--
Local Variables: