[gnu.emacs.sources] Patch for Gnu Emacs Calc, 1.06 -> 1.07, part 2/3

daveg@near.cs.caltech.edu (Dave Gillespie) (10/31/90)

#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file calc.patch continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> calc.patch
X  @end group
X  
X! Here we verify the identity @samp{@var{n}!@: = gamma(@var{n}+1)}.
X  
X  The binomial coefficient @var{n}-choose-@var{m} can be defined as
X! @samp{@var{n}!@: / @var{m}!@: (@var{n}-@var{m})!} for all reals @var{n} and
X  @var{m}.  The intermediate results in this formula can become quite
X  large even if the final result is small; the @kbd{k c} command computes
X  a binomial coefficient in a way that avoids large intermediate
X***************
X*** 2287,2293 ****
X  Vector-related commands generally begin with the @kbd{v} prefix key.
X  Some are uppercase letters and some are lowercase.  To make it easier
X  to type these commands, the shift-@kbd{V} key acts the same as the
X! @kbd{v} prefix.  (@pxref{Mode Settings}, for a way to make all
X  prefix keys have this property.)
X  
X  If we take the dot product of two perpendicular vectors we expect
X--- 2286,2292 ----
X  Vector-related commands generally begin with the @kbd{v} prefix key.
X  Some are uppercase letters and some are lowercase.  To make it easier
X  to type these commands, the shift-@kbd{V} key acts the same as the
X! @kbd{v} prefix.  (@xref{Mode Settings}, for a way to make all
X  prefix keys have this property.)
X  
X  If we take the dot product of two perpendicular vectors we expect
X***************
X*** 2697,2703 ****
X  
X  Position the cursor at the upper-left corner of this table, just
X  to the left of the @samp{1.34}.  Press @kbd{C-@@} to set the mark.
X! (On your system this may be @kbd{C-2}, @kbd{C-SPC}, or @kbd{C-NUL}.)
X  Now position the cursor to the lower-right, just after the @samp{1.354}.
X  You have now defined this region as an Emacs ``rectangle.''  Still
X  in the Info buffer, type @kbd{M-x calc-grab-region}.  This command
X--- 2696,2702 ----
X  
X  Position the cursor at the upper-left corner of this table, just
X  to the left of the @samp{1.34}.  Press @kbd{C-@@} to set the mark.
X! (On your system this may be @kbd{C-2}, @kbd{C-SPC}, or @kbd{NUL}.)
X  Now position the cursor to the lower-right, just after the @samp{1.354}.
X  You have now defined this region as an Emacs ``rectangle.''  Still
X  in the Info buffer, type @kbd{M-x calc-grab-region}.  This command
X***************
X*** 2712,2717 ****
X--- 2711,2717 ----
X  @end example
X  @end group
X  
X+ @noindent
X  (If the size of this matrix is awkward, you may wish to type @kbd{v .}
X  [the letter `v' followed by a period] to enable ``abbreviated vectors''
X  display mode.)
X***************
X*** 3023,3035 ****
X  
X  @cindex Maximizing a function over a list of values
X  (@bullet) @strong{Exercise 8.}  Compute a list of values of Bessel's
X! J1 function @samp{besJ(1,x)} for @samp{x} from 0 to 5 in steps of 0.25.
X  Find the value of @samp{x} (from among the above set of values) for
X  which @samp{besJ(1,x)} is a maximum.  Use an ``automatic'' method,
X! i.e., just reading along the list to find the smallest value is
X  not allowed!  (There is an @kbd{a X} command which does this kind
X  of thing automatically; @pxref{Numerical Solutions}.)
X! @xref{List Answer 8, 8}. (@bullet)
X  
X  @cindex Digits, vectors of
X  (@bullet) @strong{Exercise 9.}  You are given an integer in the range
X--- 3023,3043 ----
X  
X  @cindex Maximizing a function over a list of values
X  (@bullet) @strong{Exercise 8.}  Compute a list of values of Bessel's
X! @ifinfo
X! J1
X! @end ifinfo
X! @iftex
X! @tex
X! $J_1$
X! @end tex
X! @end iftex
X! function @samp{besJ(1,x)} for @samp{x} from 0 to 5 in steps of 0.25.
X  Find the value of @samp{x} (from among the above set of values) for
X  which @samp{besJ(1,x)} is a maximum.  Use an ``automatic'' method,
X! i.e., just reading along the list to find the largest value is
X  not allowed!  (There is an @kbd{a X} command which does this kind
X  of thing automatically; @pxref{Numerical Solutions}.)
X! @xref{List Answer 8, 8}. (@bullet)@refill
X  
X  @cindex Digits, vectors of
X  (@bullet) @strong{Exercise 9.}  You are given an integer in the range
X***************
X*** 3595,3601 ****
X  
X  Calc has a built-in @kbd{a P} command that solves an equation using
X  @kbd{H a S} and returns a vector of all the solutions.  It simply
X! automates the job we just did by hand.
X  
X  (@bullet) @strong{Exercise 2.}  Find the values for which the
X  original formula @samp{17 x^2 - 6 x^4 + 3} is zero.  (There are
X--- 3603,3614 ----
X  
X  Calc has a built-in @kbd{a P} command that solves an equation using
X  @kbd{H a S} and returns a vector of all the solutions.  It simply
X! automates the job we just did by hand.  Applied to our original
X! cubic polynomial, it would produce the vector of solutions
X! @samp{[1.19023, -1.19023, 0]}.  (There is also an @kbd{a X} command
X! which finds a local maximum of a function.  It uses a numerical search
X! method rather than examining the derivatives, and thus requires you
X! to provide some kind of initial guess to show it where to look.)
X  
X  (@bullet) @strong{Exercise 2.}  Find the values for which the
X  original formula @samp{17 x^2 - 6 x^4 + 3} is zero.  (There are
X***************
X*** 3650,3656 ****
X  
X  @group
X  @example
X! 3:  10                  1:  [1, 1.1, 1.2,  ...  , 1.8, 1.9 ]
X  2:  1                       .
X  1:  0.1
X      .
X--- 3663,3669 ----
X  
X  @group
X  @example
X! 3:  10                  1:  [1, 1.1, 1.2,  ...  , 1.8, 1.9]
X  2:  1                       .
X  1:  0.1
X      .
X***************
X*** 3730,3739 ****
X--- 3743,3760 ----
X  that the steps are not required to be flat.  Simpson's rule boils
X  down to the formula,
X  
X+ @ifinfo
X  @example
X  (h/3) * (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + ...
X                + 2 f(a+(n-2)*h) + 4 f(a+(n-1)*h) + f(a+n*h))
X  @end example
X+ @end ifinfo
X+ @iftex
X+ @tex
X+ $$ {h \over 3} (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + \cdots
X+               + 2 f(a+(n-2)h) + 4 f(a+(n-1)h) + f(a+n h)) $$
X+ @end tex
X+ @end iftex
X  
X  @noindent
X  where @samp{n} (which must be even) is the number of slices and @samp{h}
X***************
X*** 3741,3750 ****
X--- 3762,3779 ----
X  For reference, here is the corresponding equation for the stairstep
X  method:
X  
X+ @ifinfo
X  @example
X  h * (f(a) + f(a+h) + f(a+2h) + f(a+3h) + ...
X            + f(a+(n-2)*h) + f(a+(n-1)*h))
X  @end example
X+ @end ifinfo
X+ @iftex
X+ @tex
X+ $$ h (f(a) + f(a+h) + f(a+2h) + f(a+3h) + \cdots
X+            + f(a+(n-2)h) + f(a+(n-1)h)) $$
X+ @end tex
X+ @end iftex
X  
X  Compute the integral from 1 to 2 of @samp{sin(x) ln(x)} using
X  Simpson's rule with 10 slices.  @xref{Algebra Answer 4, 4}. (@bullet)
X***************
X*** 3909,3917 ****
X  
X  @cindex Continued fractions
X  (@bullet) @strong{Exercise 4.}  The @dfn{continued fraction}
X! representation of @samp{phi} is @samp{1 + 1/(1 + 1/(1 + 1/( ... )))}.
X  We can compute an approximate value by carrying this however far
X! and then replacing @samp{1/( ... )} by 1.  Approximate @samp{phi}
X  using a twenty-term continued fraction.
X  @xref{Programming Answer 4, 4}. (@bullet)
X  
X--- 3938,3946 ----
X  
X  @cindex Continued fractions
X  (@bullet) @strong{Exercise 4.}  The @dfn{continued fraction}
X! representation of @samp{phi} is @samp{1 + 1/(1 + 1/(1 + 1/( ...@: )))}.
X  We can compute an approximate value by carrying this however far
X! and then replacing @samp{1/( ...@: )} by 1.  Approximate @samp{phi}
X  using a twenty-term continued fraction.
X  @xref{Programming Answer 4, 4}. (@bullet)
X  
X***************
X*** 4000,4006 ****
X  The @dfn{Bernoulli numbers} are a sequence with the interesting
X  property that all of the odd Bernoulli numbers are zero, and the
X  even ones, while difficult to compute, can be roughly approximated
X! by the formula @samp{2 n! / (2 pi)^n}.  Let's write a keyboard
X  macro to compute (approximate) Bernoulli numbers.  (Calc has a
X  command, @kbd{k b}, to compute exact Bernoulli numbers, but
X  this command is very slow for large @var{n} since the higher
X--- 4029,4035 ----
X  The @dfn{Bernoulli numbers} are a sequence with the interesting
X  property that all of the odd Bernoulli numbers are zero, and the
X  even ones, while difficult to compute, can be roughly approximated
X! by the formula @samp{2 n!@: / (2 pi)^n}.  Let's write a keyboard
X  macro to compute (approximate) Bernoulli numbers.  (Calc has a
X  command, @kbd{k b}, to compute exact Bernoulli numbers, but
X  this command is very slow for large @var{n} since the higher
X***************
X*** 4159,4164 ****
X--- 4188,4194 ----
X  new_x = x - f(x)/f'(x)
X  @end example
X  
X+ @noindent
X  where @samp{f'(x)} is the derivative of @samp{f}.  The @samp{x}
X  values will quickly converge to a solution, i.e., eventually
X  @samp{new_x} and @samp{x} will be equal to within the limits
X***************
X*** 4228,4234 ****
X  e.g., @kbd{Z K s}.  Now enter the true definition, using the
X  @kbd{z s} command to call itself recursively, then assign it to
X  the same key with @kbd{Z K s}.  Now the @kbd{z s} command will
X! run the complete recursive program.  The task:  Write a program
X  that computes Stirling numbers of the first kind.  Test it with
X  @emph{small} inputs like @samp{s(4,2)}.  (There is a built-in
X  command for Stirling numbers, @kbd{k s}, which you can use to
X--- 4258,4266 ----
X  e.g., @kbd{Z K s}.  Now enter the true definition, using the
X  @kbd{z s} command to call itself recursively, then assign it to
X  the same key with @kbd{Z K s}.  Now the @kbd{z s} command will
X! run the complete recursive program.  (Another way is to use
X! @kbd{Z E} or @code{read-kbd-macro} to read the whole macro at once,
X! thus avoiding the ``training'' phase.)  The task:  Write a program
X  that computes Stirling numbers of the first kind.  Test it with
X  @emph{small} inputs like @samp{s(4,2)}.  (There is a built-in
X  command for Stirling numbers, @kbd{k s}, which you can use to
X***************
X*** 4529,4536 ****
X  give a floating-point result that is inaccurate even when rounded
X  down to an integer.  Consider @samp{123456789 / 2} when the current
X  precision is 6 digits.  The true answer is @samp{61728394.5}, but
X! with a precision of 6 this will be rounded to @samp{61728300.}.
X! The result, when converted to an integer, will be off by 94.
X  
X  Here are two solutions:  Raise the precision enough that the
X  floating-point round-off error is strictly to the right of the
X--- 4561,4568 ----
X  give a floating-point result that is inaccurate even when rounded
X  down to an integer.  Consider @samp{123456789 / 2} when the current
X  precision is 6 digits.  The true answer is @samp{61728394.5}, but
X! with a precision of 6 this will be rounded to @samp{12345700.@: / 2.@: =
X! 61728500.}.  The result, when converted to an integer, will be off by 106.
X  
X  Here are two solutions:  Raise the precision enough that the
X  floating-point round-off error is strictly to the right of the
X***************
X*** 4820,4829 ****
X  @group
X  @example
X  2:  30                  2:  [0, 0, 0, 2, ...]    1:  [1, 1, 1, 0, ...]
X! 1:  [1, 2, 3, 4, ...]   1:  0                    .
X      .                       .
X  
X!  30 RET v x 30 RET   s 1    V M %  0             V M a =  s 2
X  @end example
X  @end group
X  
X--- 4852,4861 ----
X  @group
X  @example
X  2:  30                  2:  [0, 0, 0, 2, ...]    1:  [1, 1, 1, 0, ...]
X! 1:  [1, 2, 3, 4, ...]   1:  0                        .
X      .                       .
X  
X!  30 RET v x 30 RET   s 1    V M %  0                 V M a =  s 2
X  @end example
X  @end group
X  
X***************
X*** 4936,4942 ****
X  @end group
X  
X  If we did not know the formula for triangular numbers, we could have
X! computed them using an @kbd{V U +} command.  We could also have
X  gotten them the hard way by mapping a reduction across the original
X  triangular list.
X  
X--- 4968,4974 ----
X  @end group
X  
X  If we did not know the formula for triangular numbers, we could have
X! computed them using a @kbd{V U +} command.  We could also have
X  gotten them the hard way by mapping a reduction across the original
X  triangular list.
X  
X***************
X*** 5006,5012 ****
X  1:  0.5801562                      .                  1:  1
X      .                                                     .
X  
X!     V R X                          V M a =                RET V R +    DEL
X  @end example
X  @end group
X  
X--- 5038,5044 ----
X  1:  0.5801562                      .                  1:  1
X      .                                                     .
X  
X!     RET V R X                      V M a =                RET V R +    DEL
X  @end example
X  @end group
X  
X***************
X*** 5137,5142 ****
X--- 5169,5186 ----
X  @end example
X  @end group
X  
X+ Another way to do this final step would be to reduce the formula
X+ @samp{10 x + y} across the vector of digits.
X+ 
X+ @group
X+ @example
X+ 1:  [0, 0, 2, 5, ... ]        1:  25129926000
X+     .                             .
X+ 
X+                                   V R ' 10x+y RET RET
X+ @end example
X+ @end group
X+ 
X  @node List Answer 10, Types Answer 1, List Answer 9, Answers to Exercises
X  @subsection List Tutorial Exercise 10
X  
X***************
X*** 5350,5356 ****
X  very probable that 15485863 is prime.  (In fact, this number is the
X  millionth prime.)
X  
X! Note that the formulas @samp{a^(n-1) mod n} or @samp{a^(n-1) % n} would
X  have been vastly less efficient, since they would have calculated
X  the power using full integer arithmetic.
X  
X--- 5394,5400 ----
X  very probable that 15485863 is prime.  (In fact, this number is the
X  millionth prime.)
X  
X! Note that the formulas @samp{(a^(n-1)) mod n} or @samp{a^(n-1) % n} would
X  have been vastly less efficient, since they would have calculated
X  the power using full integer arithmetic.
X  
X***************
X*** 5400,5407 ****
X  @example
X  2:  0@@ 2' 47"                    1:  [0@@ 3' 7" .. 0@@ 3' 47"]
X  1:  [0@@ 0' 20" .. 0@@ 1' 0"]          .
X  
X!                                      +
X  @end example
X  @end group
X  
X--- 5444,5452 ----
X  @example
X  2:  0@@ 2' 47"                    1:  [0@@ 3' 7" .. 0@@ 3' 47"]
X  1:  [0@@ 0' 20" .. 0@@ 1' 0"]          .
X+     .
X  
X!     [ 0@@ 20" .. 0@@ 1' ]              +
X  @end example
X  @end group
X  
X***************
X*** 5501,5507 ****
X  
X  @group
X  @example
X! 1:  17 x^2 - 6 x^4 + 3 = 0   2:  17 y - 6 y^2 + 3 = 0
X  2:  17 x^2 - 6 x^4 + 3 = 0   1:  [(0., 0.408), (0., -0.408), 1.732, -1.732]
X      .                            .
X  
X--- 5546,5552 ----
X  
X  @group
X  @example
X! 1:  17 x^2 - 6 x^4 + 3 = 0   2:  17 x^2 - 6 x^4 + 3 = 0
X  2:  17 x^2 - 6 x^4 + 3 = 0   1:  [(0., 0.408), (0., -0.408), 1.732, -1.732]
X      .                            .
X  
X***************
X*** 5650,5656 ****
X  
X  @group
X  @example
X! 1:  11.22      1:  1.112      1:  0.374
X      .              .              .
X  
X      *              .1 *           3 /
X--- 5695,5701 ----
X  
X  @group
X  @example
X! 1:  11.22      1:  1.122      1:  0.374
X      .              .              .
X  
X      *              .1 *           3 /
X***************
X*** 6399,6405 ****
X  
X  Keypad Mode includes many more commands than will fit on the keypad
X  at once.  Click the right mouse button [@code{calc-keypad-menu}]
X! to switch to the next next.  The bottom five rows of the keypad
X  stay the same; the top three rows change to a new set of commands.
X  To return to earlier menus, click the middle mouse button
X  [@code{calc-keypad-menu-back}] or simple advance through the menus
X--- 6444,6450 ----
X  
X  Keypad Mode includes many more commands than will fit on the keypad
X  at once.  Click the right mouse button [@code{calc-keypad-menu}]
X! to switch to the next menu.  The bottom five rows of the keypad
X  stay the same; the top three rows change to a new set of commands.
X  To return to earlier menus, click the middle mouse button
X  [@code{calc-keypad-menu-back}] or simple advance through the menus
X***************
X*** 6422,6428 ****
X  
X  @group
X  @example
X! |----+-----Calc 1.06-----+----1
X  |FLR |CEIL|RND |TRNC|CLN2|FLT |
X  |----+----+----+----+----+----|
X  | LN |EXP |    |ABS |IDIV|MOD |
X--- 6467,6473 ----
X  
X  @group
X  @example
X! |----+-----Calc 1.07-----+----1
X  |FLR |CEIL|RND |TRNC|CLN2|FLT |
X  |----+----+----+----+----+----|
X  | LN |EXP |    |ABS |IDIV|MOD |
X***************
X*** 6545,6551 ****
X  extracts the imaginary part.
X  
X  @key{RAND} takes a number from the top of the stack and computes
X! a random number greater then or equal to zero but less than that
X  number.  (@xref{Random Numbers}.)  @key{RAGN} is the ``random
X  again'' command; it computes another random number using the
X  same limit as last time.
X--- 6590,6596 ----
X  extracts the imaginary part.
X  
X  @key{RAND} takes a number from the top of the stack and computes
X! a random number greater than or equal to zero but less than that
X  number.  (@xref{Random Numbers}.)  @key{RAGN} is the ``random
X  again'' command; it computes another random number using the
X  same limit as last time.
X***************
X*** 6623,6630 ****
X  @key{INDX} removes an integer @var{n}, then builds a vector of
X  integers from 1 to @var{n}.  @kbd{INV INDX} takes three numbers
X  from the stack:  The vector size @var{n}, the starting number,
X! and the increment.  @kbd{BLD} takes any value @var{x} and an
X! integer @var{n} and builds a vector of @var{n} copies of @var{x}.
X  
X  @key{IDNT} removes an integer @var{n}, then builds an @var{n}-by-@var{n}
X  identity matrix.
X--- 6668,6675 ----
X  @key{INDX} removes an integer @var{n}, then builds a vector of
X  integers from 1 to @var{n}.  @kbd{INV INDX} takes three numbers
X  from the stack:  The vector size @var{n}, the starting number,
X! and the increment.  @kbd{BLD} takes an integer @var{n} and any
X! value @var{x} and builds a vector of @var{n} copies of @var{x}.
X  
X  @key{IDNT} removes an integer @var{n}, then builds an @var{n}-by-@var{n}
X  identity matrix.
X***************
X*** 6658,6669 ****
X  the input vectors, whose elements are the formula evaluated with
X  the variables set to the various sets of numbers in those vectors.
X  
X! The @key{"x"} key pushes the variable name @samp{x} onto the
X  stack.  To build the formula @samp{x^2 + 6}, you would use the
X  key sequence @kbd{"x" 2 y^x 6 +}.  This formula would then be
X  suitable for use with the @key{MAP$} key described above.
X  With @key{INV}, @key{HYP}, or @key{INV} and @key{HYP}, the
X! @key{"x"} key pushes the variable names @samp{y}, @samp{z}, and
X  @samp{t}, respectively.
X  
X  @node Keypad Modes Menu, , Keypad Vectors Menu, Keypad Mode
X--- 6703,6714 ----
X  the input vectors, whose elements are the formula evaluated with
X  the variables set to the various sets of numbers in those vectors.
X  
X! The @kbd{"x"} key pushes the variable name @samp{x} onto the
X  stack.  To build the formula @samp{x^2 + 6}, you would use the
X  key sequence @kbd{"x" 2 y^x 6 +}.  This formula would then be
X  suitable for use with the @key{MAP$} key described above.
X  With @key{INV}, @key{HYP}, or @key{INV} and @key{HYP}, the
X! @kbd{"x"} key pushes the variable names @samp{y}, @samp{z}, and
X  @samp{t}, respectively.
X  
X  @node Keypad Modes Menu, , Keypad Vectors Menu, Keypad Mode
X***************
X*** 6689,6695 ****
X  these keys, to set a different display precision.
X  
X  The @key{GRP} key turns grouping of digits with commas on or off.
X! @kbd{INV GRP} enables grouping to the right of decimal points as
X  well as to the left.
X  
X  The @key{RAD} and @key{DEG} keys switch between radians and degrees
X--- 6734,6740 ----
X  these keys, to set a different display precision.
X  
X  The @key{GRP} key turns grouping of digits with commas on or off.
X! @kbd{INV GRP} enables grouping to the right of the decimal point as
X  well as to the left.
X  
X  The @key{RAD} and @key{DEG} keys switch between radians and degrees
X***************
X*** 6987,6993 ****
X  A @dfn{fraction} is a ratio of two integers.  Fractions are traditionally
X  written ``2/3'' but Calc uses the notation @samp{2:3}.  (The @kbd{/} key
X  performs RPN division; the following two sequences push the number
X! @samp{2:3} on the stack:  @kbd{2 : 3 @key{RET}}, @kbd{2 @key{RET} 3 /},
X  assuming Fraction Mode has been enabled.)
X  When the Calculator produces a fractional result it always reduces it to
X  simplest form, which may in fact be an integer.@refill
X--- 7032,7038 ----
X  A @dfn{fraction} is a ratio of two integers.  Fractions are traditionally
X  written ``2/3'' but Calc uses the notation @samp{2:3}.  (The @kbd{/} key
X  performs RPN division; the following two sequences push the number
X! @samp{2:3} on the stack:  @kbd{2 :@: 3 @key{RET}}, @kbd{2 @key{RET} 3 /},
X  assuming Fraction Mode has been enabled.)
X  When the Calculator produces a fractional result it always reduces it to
X  simplest form, which may in fact be an integer.@refill
X***************
X*** 7096,7102 ****
X  place of brackets: @samp{@{1, 2, 3@}}, but the commas are required in
X  this case.
X  
X! Traditional vector and matrix arithmetic is supported;
X  @pxref{Basic Arithmetic} and @pxref{Matrix Functions}.
X  Many other operations are applied to vectors element-wise.  For example,
X  the complex conjugate of a vector is a vector of the complex conjugates
X--- 7141,7147 ----
X  place of brackets: @samp{@{1, 2, 3@}}, but the commas are required in
X  this case.
X  
X! Traditional vector and matrix arithmetic is also supported;
X  @pxref{Basic Arithmetic} and @pxref{Matrix Functions}.
X  Many other operations are applied to vectors element-wise.  For example,
X  the complex conjugate of a vector is a vector of the complex conjugates
X***************
X*** 7256,7264 ****
X  A side effect of this definition is that @samp{(2 +/- 1) * (2 +/- 1)}
X  is not the same as @samp{(2 +/- 1)^2}; the former represents the product
X  of two independent values which happen to have the same probability
X! distributions, and the product of one random value with itself.  The
X! form will produce an answer with less error, since on the average the
X! two indepdent errors can be expected to cancel out.@refill
X  
X  Consult a good text on error analysis for a discussion of the proper use
X  of standard deviations.  Actual errors often are neither Gaussian-distributed
X--- 7301,7309 ----
X  A side effect of this definition is that @samp{(2 +/- 1) * (2 +/- 1)}
X  is not the same as @samp{(2 +/- 1)^2}; the former represents the product
X  of two independent values which happen to have the same probability
X! distributions, and latter is the product of one random value with itself.
X! The former will produce an answer with less error, since on the average
X! the two independent errors can be expected to cancel out.@refill
X  
X  Consult a good text on error analysis for a discussion of the proper use
X  of standard deviations.  Actual errors often are neither Gaussian-distributed
X***************
X*** 7294,7304 ****
X  
X  @cindex Interval forms
X  An @dfn{interval} is a subset of consecutive real numbers.  For example,
X! the interval @samp{[2 .. 4]} represents all the numbers from 2 to 4,
X! inclusive.  If you multiply it by the interval @samp{[0.5 .. 2]} you
X! obtain @samp{[1 .. 8]}.  This calculation represents the fact that if
X! you multiply some number in the range @samp{[2 .. 4]} by some other
X! number in the range @samp{[0.5 .. 2]}, your result will lie in the range
X  from 1 to 8.  Interval arithmetic is used to get a worst-case estimate
X  of the possible range of values a computation will produce, given the
X  set of possible values of the input.
X--- 7339,7349 ----
X  
X  @cindex Interval forms
X  An @dfn{interval} is a subset of consecutive real numbers.  For example,
X! the interval @samp{[2 ..@: 4]} represents all the numbers from 2 to 4,
X! inclusive.  If you multiply it by the interval @samp{[0.5 ..@: 2]} you
X! obtain @samp{[1 ..@: 8]}.  This calculation represents the fact that if
X! you multiply some number in the range @samp{[2 ..@: 4]} by some other
X! number in the range @samp{[0.5 ..@: 2]}, your result will lie in the range
X  from 1 to 8.  Interval arithmetic is used to get a worst-case estimate
X  of the possible range of values a computation will produce, given the
X  set of possible values of the input.
X***************
X*** 7305,7330 ****
X  
X  Calc supports several varieties of intervals, including @dfn{closed}
X  intervals of the type shown above, @dfn{open} intervals such as
X! @samp{(2 .. 4)}, which represents the range of numbers from 2 to 4
X  @emph{exclusive}, and @dfn{semi-open} intervals in which one end
X  uses a round parenthesis and the other a square bracket.  In mathematical
X! terms, @samp{[2 .. 4]} means @samp{2 <= x <= 4}, whereas @samp{(2 .. 4)}
X! represents @samp{2 < x < 4}, @samp{[2 .. 4)} represents @samp{2 <= x < 4},
X! and @samp{(2 .. 4]} represents @samp{2 < x <= 4}.@refill
X  
X  The lower and upper limits of an interval must be either real numbers
X  (or HMS forms), or symbolic expressions which are assumed to be real-valued.
X  In general the lower limit must be less than the upper limit.  A closed
X! interval containing only one value, @samp{[3 .. 3]}, is converted to a
X  plain number (3) automatically.  An interval containing no values at all
X! (such as @samp{[3 .. 2]} or @samp{[2 .. 2)}) can be represented but is not
X  guaranteed to behave well when used in arithmetic.
X  
X  Intervals are entered in the notation shown here, either as algebraic
X  formulas, or using incomplete forms.  (@xref{Incomplete Objects}.)
X  In algebraic formulas, multiple periods in a row are collected from
X! left to right, so that @samp{1....1e2} is interpreted as @samp{1 .. .. 1e2}
X! (a syntax error) rather than @samp{1. .. .1e2}.  Use spaces or type
X  @samp{1.0..0.1e2} to make the notation unambiguous.
X  
X  While it may seem that intervals and error forms are similar, they are
X--- 7350,7375 ----
X  
X  Calc supports several varieties of intervals, including @dfn{closed}
X  intervals of the type shown above, @dfn{open} intervals such as
X! @samp{(2 ..@: 4)}, which represents the range of numbers from 2 to 4
X  @emph{exclusive}, and @dfn{semi-open} intervals in which one end
X  uses a round parenthesis and the other a square bracket.  In mathematical
X! terms, @samp{[2 ..@: 4]} means @samp{2 <= x <= 4}, whereas @samp{(2 ..@: 4)}
X! represents @samp{2 < x < 4}, @samp{[2 ..@: 4)} represents @samp{2 <= x < 4},
X! and @samp{(2 ..@: 4]} represents @samp{2 < x <= 4}.@refill
X  
X  The lower and upper limits of an interval must be either real numbers
X  (or HMS forms), or symbolic expressions which are assumed to be real-valued.
X  In general the lower limit must be less than the upper limit.  A closed
X! interval containing only one value, @samp{[3 ..@: 3]}, is converted to a
X  plain number (3) automatically.  An interval containing no values at all
X! (such as @samp{[3 ..@: 2]} or @samp{[2 ..@: 2)}) can be represented but is not
X  guaranteed to behave well when used in arithmetic.
X  
X  Intervals are entered in the notation shown here, either as algebraic
X  formulas, or using incomplete forms.  (@xref{Incomplete Objects}.)
X  In algebraic formulas, multiple periods in a row are collected from
X! left to right, so that @samp{1....1e2} is interpreted as @samp{1 ..@: ..@: 1e2}
X! (a syntax error) rather than @samp{1.@: ..@: .1e2}.  Use spaces or type
X  @samp{1.0..0.1e2} to make the notation unambiguous.
X  
X  While it may seem that intervals and error forms are similar, they are
X***************
X*** 7331,7337 ****
X  based on entirely different concepts of inexact quantities.  An error
X  form @samp{x +/- sigma} means a variable is random, and its value could
X  be anything but is ``probably'' within one @code{sigma} of the mean
X! value @code{x}.  An interval @samp{[lo .. hi]} means a variable's value
X  is unknown, but guaranteed to lie in the specified range.  Error forms
X  are statistical or ``average case'' approximations; interval arithmetic
X  tends to produce ``worst case'' bounds on an answer.@refill
X--- 7376,7382 ----
X  based on entirely different concepts of inexact quantities.  An error
X  form @samp{x +/- sigma} means a variable is random, and its value could
X  be anything but is ``probably'' within one @code{sigma} of the mean
X! value @code{x}.  An interval @samp{[lo ..@: hi]} means a variable's value
X  is unknown, but guaranteed to lie in the specified range.  Error forms
X  are statistical or ``average case'' approximations; interval arithmetic
X  tends to produce ``worst case'' bounds on an answer.@refill
X***************
X*** 7376,7382 ****
X  
X  @pindex calc-dots
X  Incomplete entry is also used to enter intervals.  For example,
X! @kbd{[ 2 .. 4 )} enters a semi-open interval.  Note that when you type
X  the first period, it will be interpreted as a decimal point, but when
X  you type a second period immediately afterward, it is re-interpreted as
X  part of the interval symbol.  Typing @kbd{..} corresponds to executing
X--- 7421,7427 ----
X  
X  @pindex calc-dots
X  Incomplete entry is also used to enter intervals.  For example,
X! @kbd{[ 2 ..@: 4 )} enters a semi-open interval.  Note that when you type
X  the first period, it will be interpreted as a decimal point, but when
X  you type a second period immediately afterward, it is re-interpreted as
X  part of the interval symbol.  Typing @kbd{..} corresponds to executing
X***************
X*** 7515,7521 ****
X  Vectors that contain commas (not embedded within nested parentheses or
X  brackets) do not treat spaces specially:  @samp{[a b, 2 c d]} is a vector
X  of two elements.  Also, vectors entered with curly braces instead of
X! square brackets, do not give spaces any special treatment.
X  
X  @cindex Function call notation
X  A function call is, e.g., @samp{sin(1+x)}.  Function names follow the same
X--- 7560,7566 ----
X  Vectors that contain commas (not embedded within nested parentheses or
X  brackets) do not treat spaces specially:  @samp{[a b, 2 c d]} is a vector
X  of two elements.  Also, vectors entered with curly braces instead of
X! square brackets do not give spaces any special treatment.
X  
X  @cindex Function call notation
X  A function call is, e.g., @samp{sin(1+x)}.  Function names follow the same
X***************
X*** 7667,7679 ****
X  @cindex Retrieving previous results
X  The @kbd{t y} (@code{calc-trail-yank}) command reads the selected value in
X  the trail and pushes it onto the Calculator stack.  It allows you to
X! re-use any previously computed value without retyping.
X  
X  @kindex t <
X  @pindex calc-trail-scroll-left
X  @kindex t >
X  @pindex calc-trail-scroll-right
X! The @kbd{t <} (@code{calc-trail-scroll-left}) and @kbd{d >}
X  (@code{calc-trail-scroll-right}) commands horizontally scroll the trail
X  window left or right by one half of its width.@refill
X  
X--- 7712,7726 ----
X  @cindex Retrieving previous results
X  The @kbd{t y} (@code{calc-trail-yank}) command reads the selected value in
X  the trail and pushes it onto the Calculator stack.  It allows you to
X! re-use any previously computed value without retyping.  With a numeric
X! prefix argument @var{n}, it yanks the value @var{n} lines above the current
X! trail pointer.
X  
X  @kindex t <
X  @pindex calc-trail-scroll-left
X  @kindex t >
X  @pindex calc-trail-scroll-right
X! The @kbd{t <} (@code{calc-trail-scroll-left}) and @kbd{t >}
X  (@code{calc-trail-scroll-right}) commands horizontally scroll the trail
X  window left or right by one half of its width.@refill
X  
X***************
X*** 7709,7715 ****
X  @kindex t r
X  @pindex calc-trail-isearch-backward
X  The @kbd{t s} (@code{calc-trail-isearch-forward}) and @kbd{t r}
X! (@code{calc-trail-isearch-backward}) commands perform an incremental
X  search forward and backward through the trail.  You can press @key{RET}
X  to terminate the search; the trail pointer moves to the current line.
X  If you cancel the search with @kbd{C-g}, the trail pointer does not
X--- 7756,7769 ----
X  @kindex t r
X  @pindex calc-trail-isearch-backward
X  The @kbd{t s} (@code{calc-trail-isearch-forward}) and @kbd{t r}
X! (@code{calc-trail-isearch-backward})
X! @ifinfo
X! commands
X! @end ifinfo
X! @iftex
X! com-mands
X! @end iftex
X! perform an incremental
X  search forward and backward through the trail.  You can press @key{RET}
X  to terminate the search; the trail pointer moves to the current line.
X  If you cancel the search with @kbd{C-g}, the trail pointer does not
X***************
X*** 7729,7735 ****
X  from the trail.  The line is saved in the Emacs kill ring suitable for
X  yanking into another buffer, but it is not easy to yank the text back
X  into the trail buffer.  With a numeric prefix argument, this command
X! kills the @samp{N} lines below or above the selected one.
X  
X  The @kbd{t .} (@code{calc-full-trail-vectors}) command is described
X  elsewhere; @pxref{Vector and Matrix Formats}.
X--- 7783,7789 ----
X  from the trail.  The line is saved in the Emacs kill ring suitable for
X  yanking into another buffer, but it is not easy to yank the text back
X  into the trail buffer.  With a numeric prefix argument, this command
X! kills the @var{n} lines below or above the selected one.
X  
X  The @kbd{t .} (@code{calc-full-trail-vectors}) command is described
X  elsewhere; @pxref{Vector and Matrix Formats}.
X***************
X*** 7755,7762 ****
X  the trail is displayed, and the current height of the Calc window.
X  If there were already saved mode settings in the file, they are replaced.
X  Otherwise, the new mode information is appended to the end of the file.
X- (You can change which file this uses; @pxref{Installation}.)@refill
X  
X  @kindex m x
X  @pindex calc-always-load-extensions
X  The @kbd{m x} (@code{calc-always-load-extensions}) command enables a mode
X--- 7809,7839 ----
X  the trail is displayed, and the current height of the Calc window.
X  If there were already saved mode settings in the file, they are replaced.
X  Otherwise, the new mode information is appended to the end of the file.
X  
X+ @kindex m F
X+ @pindex calc-settings-file-name
X+ The @kbd{m F} (@code{calc-settings-file-name}) command allows you to
X+ choose a different place than your @file{.emacs} file for @kbd{m m},
X+ @kbd{Z P}, and similar commands to save permanent information.
X+ You are prompted for a file name.  All Calc modes are then reset to
X+ their default values, settings from the file you named are loaded
X+ if this file exists, and this file becomes the one that Calc will
X+ use in the future for commands like @kbd{m m}.  The default settings
X+ file name is @file{~/.emacs}.  You can see the current file name by
X+ giving a blank response to the @kbd{m F} prompt.  See also the
X+ discussion of the @code{calc-settings-file} variable; @pxref{Installation}.
X+ 
X+ If the file name you give contains the string @samp{.emacs} anywhere
X+ inside it, @kbd{m F} will not automatically load the new file.  This
X+ is because you are presumably switching to your @file{~/.emacs} file,
X+ which may contain other things you don't want to reread.  You can give
X+ a numeric prefix argument of 1 to @kbd{m F} to force it to read the
X+ file no matter what its name.  Conversely, an argument of -1 tells
X+ @kbd{m F} @emph{not} to read the new file.  An argument of 2 or -2
X+ tells @kbd{m F} not to reset the modes to their defaults beforehand,
X+ which is useful if you intend your new file to have a variant of the
X+ modes present in the file you were using before.
X+ 
X  @kindex m x
X  @pindex calc-always-load-extensions
X  The @kbd{m x} (@code{calc-always-load-extensions}) command enables a mode
X***************
X*** 7763,7771 ****
X  in which the first use of Calc loads the entire program, including the
X  extensions module.  Otherwise, the extensions module will not be loaded
X  until the first advanced Calc feature is used.  (This will not work very
X! well if you used @code{calc-split} when installing the Calculator.)
X! Since this mode only has effect when Calc is first loaded, @kbd{m x} is
X! usually followed by @kbd{m m} to make the mode-setting permanent.
X  
X  @kindex m S
X  @pindex calc-shift-prefix
X--- 7840,7849 ----
X  in which the first use of Calc loads the entire program, including the
X  extensions module.  Otherwise, the extensions module will not be loaded
X  until the first advanced Calc feature is used.  (This will not work very
X! well if you used @code{calc-split} or @code{calc-install} to install the
X! Calculator.)  Since this mode only has effect when Calc is first loaded,
X! @kbd{m x} is usually followed by @kbd{m m} to make the mode-setting
X! permanent.
X  
X  @kindex m S
X  @pindex calc-shift-prefix
X***************
X*** 7772,7779 ****
X  The @kbd{m S} (@code{calc-shift-prefix}) command enables a mode in which
X  the @kbd{a}, @kbd{b}, @kbd{d}, @kbd{f}, @kbd{g}, @kbd{j}, @kbd{k}, and @kbd{m}
X  prefix keys may be typed shifted as well as unshifted.  If you are
X! typing, say, @kbd{a D} (@code{calc-derivative}) quite often you might
X! find it easier to turn this mode on so that you can type @kbd{A D} instead.
X  When this mode is enabled, the commands that used to be on those
X  single shifted letters (e.g., @kbd{A} (@code{calc-abs})) can now be
X  invoked by pressing the shifted letter twice:  @kbd{A A}.  Note that
X--- 7850,7857 ----
X  The @kbd{m S} (@code{calc-shift-prefix}) command enables a mode in which
X  the @kbd{a}, @kbd{b}, @kbd{d}, @kbd{f}, @kbd{g}, @kbd{j}, @kbd{k}, and @kbd{m}
X  prefix keys may be typed shifted as well as unshifted.  If you are
X! typing, say, @kbd{a S} (@code{calc-solve-for}) quite often you might
X! find it easier to turn this mode on so that you can type @kbd{A S} instead.
X  When this mode is enabled, the commands that used to be on those
X  single shifted letters (e.g., @kbd{A} (@code{calc-abs})) can now be
X  invoked by pressing the shifted letter twice:  @kbd{A A}.  Note that
X***************
X*** 7851,7859 ****
X  the @kbd{m} prefix.  (That's the letter @kbd{m}, not the @key{META} key.)
X  
X  The @samp{m a} (@code{calc-algebraic-mode}) command is described elsewhere
X! (@pxref{Algebraic Entry}).  The @samp{m @}} (@code{calc-use-selections})
X! command is described along with other selection commands (@pxref{Selecting
X! Subformulas}).
X  
X  @menu
X  * Angular Modes::
X--- 7929,7935 ----
X  the @kbd{m} prefix.  (That's the letter @kbd{m}, not the @key{META} key.)
X  
X  The @samp{m a} (@code{calc-algebraic-mode}) command is described elsewhere
X! (@pxref{Algebraic Entry}).
X  
X  @menu
X  * Angular Modes::
X***************
X*** 8050,8059 ****
X  @kindex m U
X  @pindex calc-units-simplify-mode
X  The @kbd{m U} (@code{calc-units-simplify-mode}) mode does units
X! simplification; it applies @code{calc-simplify-units}, which in turn
X  is a superset of @code{calc-simplify}.  In this mode, variable names
X  which are identifiable as unit names (like @samp{mm} for ``millimeters'')
X! are simplified with their unit definitions in mind.
X  
X  A common technique is to set the simplification mode down to the lowest
X  amount of simplification you will allow to be applied automatically, then
X--- 8126,8136 ----
X  @kindex m U
X  @pindex calc-units-simplify-mode
X  The @kbd{m U} (@code{calc-units-simplify-mode}) mode does units
X! simplification; it applies the command @code{calc-simplify-units},
X! which in turn
X  is a superset of @code{calc-simplify}.  In this mode, variable names
X  which are identifiable as unit names (like @samp{mm} for ``millimeters'')
X! are simplified with their unit definitions in mind.@refill
X  
X  A common technique is to set the simplification mode down to the lowest
X  amount of simplification you will allow to be applied automatically, then
X***************
X*** 8069,8077 ****
X  (@code{calc-line-breaking}) commands are described elsewhere;
X  @pxref{Stack Basics} and @pxref{Normal Language Modes}, respectively.
X  Display formats for vectors and matrices are also covered elsewhere;
X! @pxref{Vector and Matrix Formats}.  The @samp{d @}}
X! (@code{calc-use-selections}) command is described along with other
X! selection commands (@pxref{Selecting Subformulas}).@refill
X  
X  @menu
X  * Radix Modes::
X--- 8146,8152 ----
X  (@code{calc-line-breaking}) commands are described elsewhere;
X  @pxref{Stack Basics} and @pxref{Normal Language Modes}, respectively.
X  Display formats for vectors and matrices are also covered elsewhere;
X! @pxref{Vector and Matrix Formats}.@refill
X  
X  @menu
X  * Radix Modes::
X***************
X*** 8352,8359 ****
X  @kbd{d ~} (@code{calc-refresh}) to re-align right-justified or centered text.
X  
X  Right-justification is especially useful together with fixed-point
X! notation (@code{d f}; @code{calc-fix-notation}).  With these modes together,
X! the decimal points on numbers will always line up.
X  
X  @node Language Modes, , Display Modes, Mode Settings
X  @section Language Modes
X--- 8427,8434 ----
X  @kbd{d ~} (@code{calc-refresh}) to re-align right-justified or centered text.
X  
X  Right-justification is especially useful together with fixed-point
X! notation (see @code{d f}; @code{calc-fix-notation}).  With these modes
X! together, the decimal points on numbers will always line up.
X  
X  @node Language Modes, , Display Modes, Mode Settings
X  @section Language Modes
X***************
X*** 8538,8544 ****
X  (@samp{subscr(a, i)}, written @samp{a[i]} in C and Pascal modes) are
X  written @samp{a_i} in @TeX{} mode.  Fractions and quotients are written
X  using @code{\over}; binomial coefficients are written with @code{\choose}.
X! Interval forms are written with @code{\dots}, and
X  error forms are written with @code{\pm}.
X  Absolute values are written as in @samp{|x + 1|}, and the floor and
X  ceiling functions are written with @code{\lfloor}, @code{\rfloor}, etc.
X--- 8613,8619 ----
X  (@samp{subscr(a, i)}, written @samp{a[i]} in C and Pascal modes) are
X  written @samp{a_i} in @TeX{} mode.  Fractions and quotients are written
X  using @code{\over}; binomial coefficients are written with @code{\choose}.
X! Interval forms are written with @code{\ldots}, and
X  error forms are written with @code{\pm}.
X  Absolute values are written as in @samp{|x + 1|}, and the floor and
X  ceiling functions are written with @code{\lfloor}, @code{\rfloor}, etc.
X***************
X*** 8560,8567 ****
X  @samp{\hbox@{@var{name}@}}.  The @samp{\hbox@{ @}} notation is ignored
X  during reading.
X  
X! During reading, text of the form @samp{\matrix@{ ... @}} is replaced
X! by @samp{[ ... ]}.  The same also applies to @code{\pmatrix} and
X  @code{\bmatrix}.  The symbol @samp{&} is interpreted as a comma,
X  and the symbols @samp{\cr} and @samp{\\} are interpreted as semicolons.
X  During output, matrices are displayed in @samp{\matrix@{ a & b \\ c & d@}}
X--- 8635,8642 ----
X  @samp{\hbox@{@var{name}@}}.  The @samp{\hbox@{ @}} notation is ignored
X  during reading.
X  
X! During reading, text of the form @samp{\matrix@{ ...@: @}} is replaced
X! by @samp{[ ...@: ]}.  The same also applies to @code{\pmatrix} and
X  @code{\bmatrix}.  The symbol @samp{&} is interpreted as a comma,
X  and the symbols @samp{\cr} and @samp{\\} are interpreted as semicolons.
X  During output, matrices are displayed in @samp{\matrix@{ a & b \\ c & d@}}
X***************
X*** 8604,8613 ****
X  
X  @example
X  [(3, 4), 3 +/- 4, [3 .. 4)]
X! [3 + 4i, 3 \pm 4, [3 \dots 4)]
X  @end example
X  @tex
X! $$ [3 + 4i, 3 \pm 4, [ 3 \dots 4)] $$
X  @end tex
X  
X  @example
X--- 8679,8688 ----
X  
X  @example
X  [(3, 4), 3 +/- 4, [3 .. 4)]
X! [3 + 4i, 3 \pm 4, [3 \ldots 4)]
X  @end example
X  @tex
X! $$ [3 + 4i, 3 \pm 4, [ 3 \ldots 4)] $$
X  @end tex
X  
X  @example
X***************
X*** 8622,8628 ****
X  
X  @example
X  [sin(a), sin(2 a), sin(2 + a), sin(a / b)]
X! [\sin{a}, \sin{2 a}, \sin(2 + a), \sin\left( {a \over b} \right)]
X  @end example
X  @tex
X  \def\sin{\hbox{sin}}
X--- 8697,8703 ----
X  
X  @example
X  [sin(a), sin(2 a), sin(2 + a), sin(a / b)]
X! [\sin@{a@}, \sin@{2 a@}, \sin(2 + a), \sin\left( @{a \over b@} \right)]
X  @end example
X  @tex
X  \def\sin{\hbox{sin}}
X***************
X*** 8634,8640 ****
X  @example
X  [f(a), foo(bar), sin(pi)]
X  [f(a), foo(bar), \sin{\pi}]
X! [f(a), \hbox{foo}(\hbox{bar}), \sin{\pi}]
X  @end example
X  @tex
X  \def\sin{\hbox{sin}}
X--- 8709,8715 ----
X  @example
X  [f(a), foo(bar), sin(pi)]
X  [f(a), foo(bar), \sin{\pi}]
X! [f(a), \hbox@{foo@}(\hbox@{bar@}), \sin@{\pi@}]
X  @end example
X  @tex
X  \def\sin{\hbox{sin}}
X***************
X*** 8644,8651 ****
X  
X  @example
X  [ [ a / b, 0 ], [ 0, 2^(x + 1) ] ]
X! \matrix{ {a \over b} & 0 \\ 0 & 2^{(x + 1)} }
X! \pmatrix{ {a \over b} & 0 \\ 0 & 2^{(x + 1)} }
X  @end example
X  @tex
X  $$ \matrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$
X--- 8719,8726 ----
X  
X  @example
X  [ [ a / b, 0 ], [ 0, 2^(x + 1) ] ]
X! \matrix@{ @{a \over b@} & 0 \\ 0 & 2^@{(x + 1)@} @}
X! \pmatrix@{ @{a \over b@} & 0 \\ 0 & 2^@{(x + 1)@} @}
X  @end example
X  @tex
X  $$ \matrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$
X***************
X*** 8747,8753 ****
X  
X  If both arguments of @kbd{+} are intervals, the result is an interval
X  which describes all possible sums of the possible input values.  If one
X! argument is a plain number, it is treated as the interval @samp{[x .. x]}.
X  
X  @kindex -
X  @pindex calc-minus
X--- 8822,8828 ----
X  
X  If both arguments of @kbd{+} are intervals, the result is an interval
X  which describes all possible sums of the possible input values.  If one
X! argument is a plain number, it is treated as the interval @samp{[x ..@: x]}.
X  
X  @kindex -
X  @pindex calc-minus
X***************
X*** 8773,8780 ****
X  HMS forms together.  Error forms, modulo forms, and intervals can also
X  be multiplied; see the comments for addition of those forms.  When two
X  error forms or intervals are multiplied they are considered to be
X! independent; thus, @samp{[-2 .. 3] * [-2 .. 3]} is @samp{[-6 .. 9]},
X! whereas @samp{[-2 .. 3] ^ 2} is @samp{[0 .. 9]}.
X  
X  @kindex /
X  @pindex calc-divide
X--- 8848,8855 ----
X  HMS forms together.  Error forms, modulo forms, and intervals can also
X  be multiplied; see the comments for addition of those forms.  When two
X  error forms or intervals are multiplied they are considered to be
X! independent; thus, @samp{[-2 ..@: 3] * [-2 ..@: 3]} is @samp{[-6 ..@: 9]},
X! whereas @samp{[-2 ..@: 3] ^ 2} is @samp{[0 ..@: 9]}.
X  
X  @kindex /
X  @pindex calc-divide
X***************
X*** 8782,8796 ****
X  dividing a scalar @samp{B} by a square matrix @samp{A}, the computation
X  performed is @samp{B} times the inverse of @samp{A}.  This also occurs
X  if @samp{A} is itself a vector or matrix, in which case the effect is
X! to solve the set of linear equations represented by @samp{B}.  If @samp{A}
X! is a matrix with the same number of rows as @samp{B}, or a plain vector
X  (which is interpreted here as a column vector), then the equation
X  @samp{A X = B} is solved for the vector or matrix @samp{X}.  Otherwise,
X! if @samp{A} is a non-square matrix with the same number of @emph{columns}
X! as @samp{B}, the equation @samp{X A = B} is solved.  If you wish a vector
X! @samp{A} to be interpreted as a row vector to be solved as @samp{X A = B},
X  make it into a one-row matrix with @kbd{C-u 1 v p} first.  To force a
X! left-handed solution with a square matrix @samp{A}, transpose @samp{A} and
X  @samp{B} before dividing, then transpose the result.
X  
X  HMS forms can be divided by real numbers or by other HMS forms.  Error
X--- 8857,8871 ----
X  dividing a scalar @samp{B} by a square matrix @samp{A}, the computation
X  performed is @samp{B} times the inverse of @samp{A}.  This also occurs
X  if @samp{A} is itself a vector or matrix, in which case the effect is
X! to solve the set of linear equations represented by @samp{B}.  If @samp{B}
X! is a matrix with the same number of rows as @samp{A}, or a plain vector
X  (which is interpreted here as a column vector), then the equation
X  @samp{A X = B} is solved for the vector or matrix @samp{X}.  Otherwise,
X! if @samp{B} is a non-square matrix with the same number of @emph{columns}
X! as @samp{A}, the equation @samp{X A = B} is solved.  If you wish a vector
X! @samp{B} to be interpreted as a row vector to be solved as @samp{X A = B},
X  make it into a one-row matrix with @kbd{C-u 1 v p} first.  To force a
X! left-handed solution with a square matrix @samp{B}, transpose @samp{A} and
X  @samp{B} before dividing, then transpose the result.
X  
X  HMS forms can be divided by real numbers or by other HMS forms.  Error
X***************
X*** 8822,8828 ****
X  for all real numbers @samp{a} and @samp{b} (except @samp{b}=0).  For
X  positive @samp{b}, the result will always be between 0 (inclusive) and
X  @samp{b} (exclusive).  Modulo does not work for HMS forms and error forms.
X! if @samp{a} is a modulo form, its modulo is changed to @samp{b}, which
X  must be positive real number.
X  
X  @kindex \
X--- 8897,8903 ----
X  for all real numbers @samp{a} and @samp{b} (except @samp{b}=0).  For
X  positive @samp{b}, the result will always be between 0 (inclusive) and
X  @samp{b} (exclusive).  Modulo does not work for HMS forms and error forms.
X! If @samp{a} is a modulo form, its modulo is changed to @samp{b}, which
X  must be positive real number.
X  
X  @kindex \
X***************
X*** 8851,8857 ****
X  @pindex calc-change-sign
X  The @kbd{n} (@code{calc-change-sign}) command negates the number on the top
X  of the stack.  It works on numbers, vectors and matrices, HMS forms, error
X! forms, and modulo forms.
X  
X  @kindex A
X  @pindex calc-abs
X--- 8926,8932 ----
X  @pindex calc-change-sign
X  The @kbd{n} (@code{calc-change-sign}) command negates the number on the top
X  of the stack.  It works on numbers, vectors and matrices, HMS forms, error
X! forms, intervals, and modulo forms.
X  
X  @kindex A
X  @pindex calc-abs
X***************
X*** 8863,8869 ****
X  the square root of the sum of the squares of the absolute values of the
X  elements.  The absolute value of an error form is defined by replacing
X  the mean part with its absolute value and leaving the error part the same.
X! The absolute value of a modulo form is undefined.
X  
X  @kindex f A
X  @pindex calc-abssqr
X--- 8938,8945 ----
X  the square root of the sum of the squares of the absolute values of the
X  elements.  The absolute value of an error form is defined by replacing
X  the mean part with its absolute value and leaving the error part the same.
X! The absolute value of a modulo form is undefined.  The absolute value of
X! an interval is defined in the obvious way.
X  
X  @kindex f A
X  @pindex calc-abssqr
X***************
X*** 8909,8915 ****
X  The @kbd{f Q} (@code{calc-isqrt}) [@code{isqrt}] command computes the
X  integer square root of an integer.  This is the true square root of the
X  number, rounded down to an integer.  For example, @samp{isqrt(10)}
X! produces 3.
X  
X  @kindex f n
X  @kindex f x
X--- 8985,8992 ----
X  The @kbd{f Q} (@code{calc-isqrt}) [@code{isqrt}] command computes the
X  integer square root of an integer.  This is the true square root of the
X  number, rounded down to an integer.  For example, @samp{isqrt(10)}
X! produces 3.  Note that, like @kbd{\} [@code{idiv}], this uses exact
X! integer arithmetic throughout to avoid roundoff problems.
X  
X  @kindex f n
X  @kindex f x
X***************
X*** 8919,8927 ****
X  @tindex max
X  The @kbd{f n} (@code{calc-min}) [@code{min}] and @kbd{f x} (@code{calc-max})
X  [@code{max}] commands take the minimum or maximum of two real numbers,
X! respectively.  These commands also work on HMS forms.  (In algebraic
X! expressions, these functions take any number of arguments and return the
X! maximum or minimum among all the arguments.)@refill
X  
X  @kindex f M
X  @kindex f X
X--- 8996,9004 ----
X  @tindex max
X  The @kbd{f n} (@code{calc-min}) [@code{min}] and @kbd{f x} (@code{calc-max})
X  [@code{max}] commands take the minimum or maximum of two real numbers,
X! respectively.  These commands also work on HMS forms and intervals.  (In
X! algebraic expressions, these functions take any number of arguments and
X! return the maximum or minimum among all the arguments.)@refill
X  
X  @kindex f M
X  @kindex f X
X***************
X*** 8933,8939 ****
X  the ``mantissa'' part @var{m} of its floating-point argument; @kbd{f X}
X  (@code{calc-xpon-part}) [@code{xpon}] extracts the ``exponent'' part
X  @var{e}.  The original number is equal to @samp{@var{m} * 10^@var{e}},
X! where @var{m} is in the interval @samp{[1.0 .. 10.0)} except that
X  @samp{@var{m}=@var{e}=0} if the original number is zero.  For integers
X  and fractions, @code{mant} returns the number unchanged and @code{xpon}
X  returns zero.  The @kbd{v u} (@code{calc-unpack}) command can also be
X--- 9010,9016 ----
X  the ``mantissa'' part @var{m} of its floating-point argument; @kbd{f X}
X  (@code{calc-xpon-part}) [@code{xpon}] extracts the ``exponent'' part
X  @var{e}.  The original number is equal to @samp{@var{m} * 10^@var{e}},
X! where @var{m} is in the interval @samp{[1.0 ..@: 10.0)} except that
X  @samp{@var{m}=@var{e}=0} if the original number is zero.  For integers
X  and fractions, @code{mant} returns the number unchanged and @code{xpon}
X  returns zero.  The @kbd{v u} (@code{calc-unpack}) command can also be
X***************
X*** 9177,9185 ****
X  generally unaffected by this operation.@refill
X  
X  If the simplification mode is set below the default level, it is raised
X! to the default level for the purposes of this command.  Thus, you can
X! use @kbd{c c} to apply the default simplifications manually when their
X! automatic application is disabled.  @xref{Simplification Modes}.
X  
X  @cindex Roundoff errors, correcting
X  A numeric prefix argument to @kbd{c c} sets the floating-point precision
X--- 9254,9262 ----
X  generally unaffected by this operation.@refill
X  
X  If the simplification mode is set below the default level, it is raised
X! to the default level for the purposes of this command.  Thus, @kbd{c c}
X! applies the default simplifications even if their automatic application
X! is disabled.  @xref{Simplification Modes}.
X  
X  @cindex Roundoff errors, correcting
X  A numeric prefix argument to @kbd{c c} sets the floating-point precision
X***************
X*** 9240,9248 ****
X  @tindex ln
X  The shift-@kbd{L} (@code{calc-ln}) [@code{ln}] command computes the natural
X  logarithm of the real or complex number on the top of the stack.  With
X! the Inverse flag it computes the exponential function instead.  With
X! the Hyperbolic flag it computes the common (base-10) logarithm.  With
X! both flags, it computes 10 to a given power.
X  
X  @kindex E
X  @kindex I L
X--- 9317,9324 ----
X  @tindex ln
X  The shift-@kbd{L} (@code{calc-ln}) [@code{ln}] command computes the natural
X  logarithm of the real or complex number on the top of the stack.  With
X! the Inverse flag it computes the exponential function instead, although
X! this is redundant with the @kbd{E} command.
X  
X  @kindex E
X  @kindex I L
X***************
X*** 9413,9419 ****
X  @kindex f G
X  @kindex I f G
X  @kindex H f G
X! @kindex I H f G
X  @pindex calc-inc-gamma
X  @tindex gammaP
X  @tindex gammaQ
X--- 9489,9495 ----
X  @kindex f G
X  @kindex I f G
X  @kindex H f G
X! @kindex H I f G
X  @pindex calc-inc-gamma
X  @tindex gammaP
X  @tindex gammaQ
X***************
X*** 9420,9427 ****
X  @tindex gammag
X  @tindex gammaG
X  The @kbd{f G} (@code{calc-inc-gamma}) [@code{gammaP}] command computes
X! the incomplete gamma function @samp{P(a,x)}.  This is defined by the
X! integral, @samp{gammaP(a,x) = integ(t^(a-1) exp(t), t, 0, x) / gamma(a)}.
X  Thus the limit is one as @samp{x} goes to infinity (see the definition
X  of the normal gamma function).
X  
X--- 9496,9503 ----
X  @tindex gammag
X  @tindex gammaG
X  The @kbd{f G} (@code{calc-inc-gamma}) [@code{gammaP}] command computes
X! the incomplete gamma function, denoted @samp{P(a,x)}.  This is defined by
X! the integral, @samp{gammaP(a,x) = integ(t^(a-1) exp(t), t, 0, x) / gamma(a)}.
X  Thus the limit is one as @samp{x} goes to infinity (see the definition
X  of the normal gamma function).
X  
X***************
X*** 9452,9458 ****
X  @tindex betaI
X  @tindex betaB
X  The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes
X! the incomplete beta function @samp{I(x,a,b)}.  This is defined by
X  @samp{betaI(x,a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, x) / beta(a,b)}.
X  Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding
X  un-normalized version [@code{betaB}].
X--- 9528,9534 ----
X  @tindex betaI
X  @tindex betaB
X  The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes
X! the incomplete beta function @samp{I(x,a,b)}.  It is defined by
X  @samp{betaI(x,a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, x) / beta(a,b)}.
X  Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding
X  un-normalized version [@code{betaB}].
X***************
X*** 9463,9469 ****
X  @tindex erf
X  @tindex erfc
X  The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the
X! error function @samp{erf(x) = 2 integ(exp(-(t^2)), t, 0, x) / sqrt(pi))}.
X  The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}]
X  is the corresponding integral from @samp{x} to infinity; the sum
X  @samp{erf(x) + erfc(x) = 1}.
X--- 9539,9545 ----
X  @tindex erf
X  @tindex erfc
X  The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the
X! error function @samp{erf(x) = 2 integ(exp(-(t^2)), t, 0, x) / sqrt(pi)}.
X  The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}]
X  is the corresponding integral from @samp{x} to infinity; the sum
X  @samp{erf(x) + erfc(x) = 1}.
X***************
X*** 9476,9487 ****
X  @tindex besY
X  The @kbd{f j} (@code{calc-bessel-J}) [@code{besJ}] and @kbd{f y}
X  (@code{calc-bessel-Y}) [@code{besY}] commands compute the Bessel
SHAR_EOF
echo "End of part 2, continue with part 3"
echo "3" > s2_seq_.tmp
exit 0
--
Dave Gillespie
  256-80 Caltech Pasadena CA USA 91125
  daveg@csvax.cs.caltech.edu, ...!cit-vax!daveg