aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/ChangeLog8
-rw-r--r--man/calc.texi210
2 files changed, 108 insertions, 110 deletions
diff --git a/man/ChangeLog b/man/ChangeLog
index 1c6d1dbf16b..6b8d53ef246 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,8 +1,10 @@
12007-06-20 Jay Belanger <jay.p.belanger@gmail.com> 12007-06-20 Jay Belanger <jay.p.belanger@gmail.com>
2 2
3 * calc.texi (Basic Arithmetic, Customizing Calc): 3 * calc.texi:Change ifinfo to ifnottex (as appropriate) throughout.
4 Make description of the variable `calc-multiplication-has-precedence' 4 (About This Manual): Remove redundant information.
5 match its new effect. 5 (Getting Started): Mention author.
6 (Basic Arithmetic, Customizing Calc): Make description of the
7 variable `calc-multiplication-has-precedence' match its new effect.
6 8
72007-06-19 Jay Belanger <jay.p.belanger@gmail.com> 92007-06-19 Jay Belanger <jay.p.belanger@gmail.com>
8 10
diff --git a/man/calc.texi b/man/calc.texi
index 3151d9b7b92..9436e79ef0f 100644
--- a/man/calc.texi
+++ b/man/calc.texi
@@ -124,28 +124,32 @@ Copyright @copyright{} 1990, 1991, 2001, 2002, 2003, 2004,
124@end titlepage 124@end titlepage
125 125
126@c [begin] 126@c [begin]
127@ifinfo 127@ifnottex
128@node Top, Getting Started, (dir), (dir) 128@node Top, Getting Started, (dir), (dir)
129@chapter The GNU Emacs Calculator 129@chapter The GNU Emacs Calculator
130 130
131@noindent 131@noindent
132@dfn{Calc} is an advanced desk calculator and mathematical tool 132@dfn{Calc} is an advanced desk calculator and mathematical tool
133that runs as part of the GNU Emacs environment. 133written by Dave Gillespie that runs as part of the GNU Emacs environment.
134 134
135This manual is divided into three major parts: ``Getting Started,'' 135This manual, also written (mostly) by Dave Gillespie, is divided into
136the ``Calc Tutorial,'' and the ``Calc Reference.'' The Tutorial 136three major parts: ``Getting Started,'' the ``Calc Tutorial,'' and the
137introduces all the major aspects of Calculator use in an easy, 137``Calc Reference.'' The Tutorial introduces all the major aspects of
138hands-on way. The remainder of the manual is a complete reference to 138Calculator use in an easy, hands-on way. The remainder of the manual is
139the features of the Calculator. 139a complete reference to the features of the Calculator.
140@end ifnottex
140 141
142@ifinfo
141For help in the Emacs Info system (which you are using to read this 143For help in the Emacs Info system (which you are using to read this
142file), type @kbd{?}. (You can also type @kbd{h} to run through a 144file), type @kbd{?}. (You can also type @kbd{h} to run through a
143longer Info tutorial.) 145longer Info tutorial.)
144
145@end ifinfo 146@end ifinfo
147
146@menu 148@menu
147* Getting Started:: General description and overview. 149* Getting Started:: General description and overview.
150@ifinfo
148* Interactive Tutorial:: 151* Interactive Tutorial::
152@end ifinfo
149* Tutorial:: A step-by-step introduction for beginners. 153* Tutorial:: A step-by-step introduction for beginners.
150 154
151* Introduction:: Introduction to the Calc reference manual. 155* Introduction:: Introduction to the Calc reference manual.
@@ -179,7 +183,12 @@ longer Info tutorial.)
179* Lisp Function Index:: Internal Lisp math functions. 183* Lisp Function Index:: Internal Lisp math functions.
180@end menu 184@end menu
181 185
186@ifinfo
182@node Getting Started, Interactive Tutorial, Top, Top 187@node Getting Started, Interactive Tutorial, Top, Top
188@end ifinfo
189@ifnotinfo
190@node Getting Started, Tutorial, Top, Top
191@end ifnotinfo
183@chapter Getting Started 192@chapter Getting Started
184@noindent 193@noindent
185This chapter provides a general overview of Calc, the GNU Emacs 194This chapter provides a general overview of Calc, the GNU Emacs
@@ -267,12 +276,6 @@ experience with GNU Emacs in order to get the most out of Calc,
267this manual ought to be readable even if you don't know or use Emacs 276this manual ought to be readable even if you don't know or use Emacs
268regularly. 277regularly.
269 278
270@ifinfo
271The manual is divided into three major parts:@: the ``Getting
272Started'' chapter you are reading now, the Calc tutorial (chapter 2),
273and the Calc reference manual (the remaining chapters and appendices).
274@end ifinfo
275@iftex
276The manual is divided into three major parts:@: the ``Getting 279The manual is divided into three major parts:@: the ``Getting
277Started'' chapter you are reading now, the Calc tutorial (chapter 2), 280Started'' chapter you are reading now, the Calc tutorial (chapter 2),
278and the Calc reference manual (the remaining chapters and appendices). 281and the Calc reference manual (the remaining chapters and appendices).
@@ -280,7 +283,6 @@ and the Calc reference manual (the remaining chapters and appendices).
280@c This manual has been printed in two volumes, the @dfn{Tutorial} and the 283@c This manual has been printed in two volumes, the @dfn{Tutorial} and the
281@c @dfn{Reference}. Both volumes include a copy of the ``Getting Started'' 284@c @dfn{Reference}. Both volumes include a copy of the ``Getting Started''
282@c chapter. 285@c chapter.
283@end iftex
284 286
285If you are in a hurry to use Calc, there is a brief ``demonstration'' 287If you are in a hurry to use Calc, there is a brief ``demonstration''
286below which illustrates the major features of Calc in just a couple of 288below which illustrates the major features of Calc in just a couple of
@@ -321,6 +323,7 @@ you can also go to the part of the manual describing any Calc key,
321function, or variable using @w{@kbd{h k}}, @kbd{h f}, or @kbd{h v}, 323function, or variable using @w{@kbd{h k}}, @kbd{h f}, or @kbd{h v},
322respectively. @xref{Help Commands}. 324respectively. @xref{Help Commands}.
323 325
326@ifnottex
324The Calc manual can be printed, but because the manual is so large, you 327The Calc manual can be printed, but because the manual is so large, you
325should only make a printed copy if you really need it. To print the 328should only make a printed copy if you really need it. To print the
326manual, you will need the @TeX{} typesetting program (this is a free 329manual, you will need the @TeX{} typesetting program (this is a free
@@ -347,7 +350,7 @@ or
347@example 350@example
348dvips calc.dvi 351dvips calc.dvi
349@end example 352@end example
350 353@end ifnottex
351@c Printed copies of this manual are also available from the Free Software 354@c Printed copies of this manual are also available from the Free Software
352@c Foundation. 355@c Foundation.
353 356
@@ -543,13 +546,13 @@ system. Type @kbd{d N} to return to normal notation.
543Type @kbd{7.5}, then @kbd{s l a @key{RET}} to let @expr{a = 7.5} in these formulas. 546Type @kbd{7.5}, then @kbd{s l a @key{RET}} to let @expr{a = 7.5} in these formulas.
544(That's a letter @kbd{l}, not a numeral @kbd{1}.) 547(That's a letter @kbd{l}, not a numeral @kbd{1}.)
545 548
546@iftex 549@ifnotinfo
547@strong{Help functions.} You can read about any command in the on-line 550@strong{Help functions.} You can read about any command in the on-line
548manual. Type @kbd{C-x * c} to return to Calc after each of these 551manual. Type @kbd{C-x * c} to return to Calc after each of these
549commands: @kbd{h k t N} to read about the @kbd{t N} command, 552commands: @kbd{h k t N} to read about the @kbd{t N} command,
550@kbd{h f sqrt @key{RET}} to read about the @code{sqrt} function, and 553@kbd{h f sqrt @key{RET}} to read about the @code{sqrt} function, and
551@kbd{h s} to read the Calc summary. 554@kbd{h s} to read the Calc summary.
552@end iftex 555@end ifnotinfo
553@ifinfo 556@ifinfo
554@strong{Help functions.} You can read about any command in the on-line 557@strong{Help functions.} You can read about any command in the on-line
555manual. Remember to type the letter @kbd{l}, then @kbd{C-x * c}, to 558manual. Remember to type the letter @kbd{l}, then @kbd{C-x * c}, to
@@ -1251,9 +1254,12 @@ Press @kbd{1} now to enter the first section of the Tutorial.
1251@menu 1254@menu
1252* Tutorial:: 1255* Tutorial::
1253@end menu 1256@end menu
1254@end ifinfo
1255 1257
1256@node Tutorial, Introduction, Interactive Tutorial, Top 1258@node Tutorial, Introduction, Interactive Tutorial, Top
1259@end ifinfo
1260@ifnotinfo
1261@node Tutorial, Introduction, Getting Started, Top
1262@end ifnotinfo
1257@chapter Tutorial 1263@chapter Tutorial
1258 1264
1259@noindent 1265@noindent
@@ -1272,32 +1278,22 @@ The Quick mode and Keypad mode interfaces are fairly
1272self-explanatory. @xref{Embedded Mode}, for a description of 1278self-explanatory. @xref{Embedded Mode}, for a description of
1273the Embedded mode interface. 1279the Embedded mode interface.
1274 1280
1275@ifinfo
1276The easiest way to read this tutorial on-line is to have two windows on
1277your Emacs screen, one with Calc and one with the Info system. (If you
1278have a printed copy of the manual you can use that instead.) Press
1279@kbd{C-x * c} to turn Calc on or to switch into the Calc window, and
1280press @kbd{C-x * i} to start the Info system or to switch into its window.
1281Or, you may prefer to use the tutorial in printed form.
1282@end ifinfo
1283@iftex
1284The easiest way to read this tutorial on-line is to have two windows on 1281The easiest way to read this tutorial on-line is to have two windows on
1285your Emacs screen, one with Calc and one with the Info system. (If you 1282your Emacs screen, one with Calc and one with the Info system. (If you
1286have a printed copy of the manual you can use that instead.) Press 1283have a printed copy of the manual you can use that instead.) Press
1287@kbd{C-x * c} to turn Calc on or to switch into the Calc window, and 1284@kbd{C-x * c} to turn Calc on or to switch into the Calc window, and
1288press @kbd{C-x * i} to start the Info system or to switch into its window. 1285press @kbd{C-x * i} to start the Info system or to switch into its window.
1289@end iftex
1290 1286
1291This tutorial is designed to be done in sequence. But the rest of this 1287This tutorial is designed to be done in sequence. But the rest of this
1292manual does not assume you have gone through the tutorial. The tutorial 1288manual does not assume you have gone through the tutorial. The tutorial
1293does not cover everything in the Calculator, but it touches on most 1289does not cover everything in the Calculator, but it touches on most
1294general areas. 1290general areas.
1295 1291
1296@ifinfo 1292@ifnottex
1297You may wish to print out a copy of the Calc Summary and keep notes on 1293You may wish to print out a copy of the Calc Summary and keep notes on
1298it as you learn Calc. @xref{About This Manual}, to see how to make a 1294it as you learn Calc. @xref{About This Manual}, to see how to make a
1299printed summary. @xref{Summary}. 1295printed summary. @xref{Summary}.
1300@end ifinfo 1296@end ifnottex
1301@iftex 1297@iftex
1302The Calc Summary at the end of the reference manual includes some blank 1298The Calc Summary at the end of the reference manual includes some blank
1303space for your own use. You may wish to keep notes there as you learn 1299space for your own use. You may wish to keep notes there as you learn
@@ -1334,13 +1330,13 @@ to control various modes of the Calculator.
1334@subsection RPN Calculations and the Stack 1330@subsection RPN Calculations and the Stack
1335 1331
1336@cindex RPN notation 1332@cindex RPN notation
1337@ifinfo 1333@ifnottex
1338@noindent 1334@noindent
1339Calc normally uses RPN notation. You may be familiar with the RPN 1335Calc normally uses RPN notation. You may be familiar with the RPN
1340system from Hewlett-Packard calculators, FORTH, or PostScript. 1336system from Hewlett-Packard calculators, FORTH, or PostScript.
1341(Reverse Polish Notation, RPN, is named after the Polish mathematician 1337(Reverse Polish Notation, RPN, is named after the Polish mathematician
1342Jan Lukasiewicz.) 1338Jan Lukasiewicz.)
1343@end ifinfo 1339@end ifnottex
1344@tex 1340@tex
1345\noindent 1341\noindent
1346Calc normally uses RPN notation. You may be familiar with the RPN 1342Calc normally uses RPN notation. You may be familiar with the RPN
@@ -1769,7 +1765,7 @@ is equivalent to
1769@noindent 1765@noindent
1770or, in large mathematical notation, 1766or, in large mathematical notation,
1771 1767
1772@ifinfo 1768@ifnottex
1773@example 1769@example
1774@group 1770@group
1775 3 * 4 * 5 1771 3 * 4 * 5
@@ -1778,7 +1774,7 @@ or, in large mathematical notation,
1778 6 * 7 1774 6 * 7
1779@end group 1775@end group
1780@end example 1776@end example
1781@end ifinfo 1777@end ifnottex
1782@tex 1778@tex
1783\turnoffactive 1779\turnoffactive
1784\beforedisplay 1780\beforedisplay
@@ -3325,7 +3321,7 @@ We can multiply these two matrices in either order to get an identity.
3325Matrix inverses are related to systems of linear equations in algebra. 3321Matrix inverses are related to systems of linear equations in algebra.
3326Suppose we had the following set of equations: 3322Suppose we had the following set of equations:
3327 3323
3328@ifinfo 3324@ifnottex
3329@group 3325@group
3330@example 3326@example
3331 a + 2b + 3c = 6 3327 a + 2b + 3c = 6
@@ -3333,7 +3329,7 @@ Suppose we had the following set of equations:
3333 7a + 6b = 3 3329 7a + 6b = 3
3334@end example 3330@end example
3335@end group 3331@end group
3336@end ifinfo 3332@end ifnottex
3337@tex 3333@tex
3338\turnoffactive 3334\turnoffactive
3339\beforedisplayh 3335\beforedisplayh
@@ -3352,7 +3348,7 @@ $$
3352@noindent 3348@noindent
3353This can be cast into the matrix equation, 3349This can be cast into the matrix equation,
3354 3350
3355@ifinfo 3351@ifnottex
3356@group 3352@group
3357@example 3353@example
3358 [ [ 1, 2, 3 ] [ [ a ] [ [ 6 ] 3354 [ [ 1, 2, 3 ] [ [ a ] [ [ 6 ]
@@ -3360,7 +3356,7 @@ This can be cast into the matrix equation,
3360 [ 7, 6, 0 ] ] [ c ] ] [ 3 ] ] 3356 [ 7, 6, 0 ] ] [ c ] ] [ 3 ] ]
3361@end example 3357@end example
3362@end group 3358@end group
3363@end ifinfo 3359@end ifnottex
3364@tex 3360@tex
3365\turnoffactive 3361\turnoffactive
3366\beforedisplay 3362\beforedisplay
@@ -3425,14 +3421,14 @@ vectors and matrices that include variables. Solve the following
3425system of equations to get expressions for @expr{x} and @expr{y} 3421system of equations to get expressions for @expr{x} and @expr{y}
3426in terms of @expr{a} and @expr{b}. 3422in terms of @expr{a} and @expr{b}.
3427 3423
3428@ifinfo 3424@ifnottex
3429@group 3425@group
3430@example 3426@example
3431 x + a y = 6 3427 x + a y = 6
3432 x + b y = 10 3428 x + b y = 10
3433@end example 3429@end example
3434@end group 3430@end group
3435@end ifinfo 3431@end ifnottex
3436@tex 3432@tex
3437\turnoffactive 3433\turnoffactive
3438\beforedisplay 3434\beforedisplay
@@ -3456,9 +3452,9 @@ you can't solve @expr{A X = B} directly because the matrix @expr{A}
3456is not square for an over-determined system. Matrix inversion works 3452is not square for an over-determined system. Matrix inversion works
3457only for square matrices. One common trick is to multiply both sides 3453only for square matrices. One common trick is to multiply both sides
3458on the left by the transpose of @expr{A}: 3454on the left by the transpose of @expr{A}:
3459@ifinfo 3455@ifnottex
3460@samp{trn(A)*A*X = trn(A)*B}. 3456@samp{trn(A)*A*X = trn(A)*B}.
3461@end ifinfo 3457@end ifnottex
3462@tex 3458@tex
3463\turnoffactive 3459\turnoffactive
3464$A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}. 3460$A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}.
@@ -3472,7 +3468,7 @@ solution, which can be regarded as the ``closest'' solution to the set
3472of equations. Use Calc to solve the following over-determined 3468of equations. Use Calc to solve the following over-determined
3473system: 3469system:
3474 3470
3475@ifinfo 3471@ifnottex
3476@group 3472@group
3477@example 3473@example
3478 a + 2b + 3c = 6 3474 a + 2b + 3c = 6
@@ -3481,7 +3477,7 @@ system:
3481 2a + 4b + 6c = 11 3477 2a + 4b + 6c = 11
3482@end example 3478@end example
3483@end group 3479@end group
3484@end ifinfo 3480@end ifnottex
3485@tex 3481@tex
3486\turnoffactive 3482\turnoffactive
3487\beforedisplayh 3483\beforedisplayh
@@ -3749,11 +3745,11 @@ stored value from the stack.)
3749 3745
3750In a least squares fit, the slope @expr{m} is given by the formula 3746In a least squares fit, the slope @expr{m} is given by the formula
3751 3747
3752@ifinfo 3748@ifnottex
3753@example 3749@example
3754m = (N sum(x y) - sum(x) sum(y)) / (N sum(x^2) - sum(x)^2) 3750m = (N sum(x y) - sum(x) sum(y)) / (N sum(x^2) - sum(x)^2)
3755@end example 3751@end example
3756@end ifinfo 3752@end ifnottex
3757@tex 3753@tex
3758\turnoffactive 3754\turnoffactive
3759\beforedisplay 3755\beforedisplay
@@ -3790,12 +3786,12 @@ this formula uses.
3790@end group 3786@end group
3791@end smallexample 3787@end smallexample
3792 3788
3793@ifinfo 3789@ifnottex
3794@noindent 3790@noindent
3795These are @samp{sum(x)}, @samp{sum(x^2)}, @samp{sum(y)}, and @samp{sum(x y)}, 3791These are @samp{sum(x)}, @samp{sum(x^2)}, @samp{sum(y)}, and @samp{sum(x y)},
3796respectively. (We could have used @kbd{*} to compute @samp{sum(x^2)} and 3792respectively. (We could have used @kbd{*} to compute @samp{sum(x^2)} and
3797@samp{sum(x y)}.) 3793@samp{sum(x y)}.)
3798@end ifinfo 3794@end ifnottex
3799@tex 3795@tex
3800\turnoffactive 3796\turnoffactive
3801These are $\sum x$, $\sum x^2$, $\sum y$, and $\sum x y$, 3797These are $\sum x$, $\sum x^2$, $\sum y$, and $\sum x y$,
@@ -3845,11 +3841,11 @@ Now we grind through the formula:
3845That gives us the slope @expr{m}. The y-intercept @expr{b} can now 3841That gives us the slope @expr{m}. The y-intercept @expr{b} can now
3846be found with the simple formula, 3842be found with the simple formula,
3847 3843
3848@ifinfo 3844@ifnottex
3849@example 3845@example
3850b = (sum(y) - m sum(x)) / N 3846b = (sum(y) - m sum(x)) / N
3851@end example 3847@end example
3852@end ifinfo 3848@end ifnottex
3853@tex 3849@tex
3854\turnoffactive 3850\turnoffactive
3855\beforedisplay 3851\beforedisplay
@@ -3987,14 +3983,14 @@ The @kbd{C-x * g} command accepts numbers separated by spaces or commas,
3987with or without surrounding vector brackets. 3983with or without surrounding vector brackets.
3988@xref{List Answer 3, 3}. (@bullet{}) 3984@xref{List Answer 3, 3}. (@bullet{})
3989 3985
3990@ifinfo 3986@ifnottex
3991As another example, a theorem about binomial coefficients tells 3987As another example, a theorem about binomial coefficients tells
3992us that the alternating sum of binomial coefficients 3988us that the alternating sum of binomial coefficients
3993@var{n}-choose-0 minus @var{n}-choose-1 plus @var{n}-choose-2, and so 3989@var{n}-choose-0 minus @var{n}-choose-1 plus @var{n}-choose-2, and so
3994on up to @var{n}-choose-@var{n}, 3990on up to @var{n}-choose-@var{n},
3995always comes out to zero. Let's verify this 3991always comes out to zero. Let's verify this
3996for @expr{n=6}. 3992for @expr{n=6}.
3997@end ifinfo 3993@end ifnottex
3998@tex 3994@tex
3999As another example, a theorem about binomial coefficients tells 3995As another example, a theorem about binomial coefficients tells
4000us that the alternating sum of binomial coefficients 3996us that the alternating sum of binomial coefficients
@@ -5193,12 +5189,12 @@ to be a better approximation than stairsteps. A third method is
5193that the steps are not required to be flat. Simpson's rule boils 5189that the steps are not required to be flat. Simpson's rule boils
5194down to the formula, 5190down to the formula,
5195 5191
5196@ifinfo 5192@ifnottex
5197@example 5193@example
5198(h/3) * (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + ... 5194(h/3) * (f(a) + 4 f(a+h) + 2 f(a+2h) + 4 f(a+3h) + ...
5199 + 2 f(a+(n-2)*h) + 4 f(a+(n-1)*h) + f(a+n*h)) 5195 + 2 f(a+(n-2)*h) + 4 f(a+(n-1)*h) + f(a+n*h))
5200@end example 5196@end example
5201@end ifinfo 5197@end ifnottex
5202@tex 5198@tex
5203\turnoffactive 5199\turnoffactive
5204\beforedisplay 5200\beforedisplay
@@ -5215,12 +5211,12 @@ is the width of each slice. These are 10 and 0.1 in our example.
5215For reference, here is the corresponding formula for the stairstep 5211For reference, here is the corresponding formula for the stairstep
5216method: 5212method:
5217 5213
5218@ifinfo 5214@ifnottex
5219@example 5215@example
5220h * (f(a) + f(a+h) + f(a+2h) + f(a+3h) + ... 5216h * (f(a) + f(a+h) + f(a+2h) + f(a+3h) + ...
5221 + f(a+(n-2)*h) + f(a+(n-1)*h)) 5217 + f(a+(n-2)*h) + f(a+(n-1)*h))
5222@end example 5218@end example
5223@end ifinfo 5219@end ifnottex
5224@tex 5220@tex
5225\turnoffactive 5221\turnoffactive
5226\beforedisplay 5222\beforedisplay
@@ -5657,11 +5653,11 @@ so that @expr{2 - 3 (x + y) + x y} is a sum of three terms.)
5657infinite series that exactly equals the value of that function at 5653infinite series that exactly equals the value of that function at
5658values of @expr{x} near zero. 5654values of @expr{x} near zero.
5659 5655
5660@ifinfo 5656@ifnottex
5661@example 5657@example
5662cos(x) = 1 - x^2 / 2! + x^4 / 4! - x^6 / 6! + ... 5658cos(x) = 1 - x^2 / 2! + x^4 / 4! - x^6 / 6! + ...
5663@end example 5659@end example
5664@end ifinfo 5660@end ifnottex
5665@tex 5661@tex
5666\turnoffactive 5662\turnoffactive
5667\beforedisplay 5663\beforedisplay
@@ -5675,11 +5671,11 @@ Calc represents the truncated Taylor series as a polynomial in @expr{x}.
5675Mathematicians often write a truncated series using a ``big-O'' notation 5671Mathematicians often write a truncated series using a ``big-O'' notation
5676that records what was the lowest term that was truncated. 5672that records what was the lowest term that was truncated.
5677 5673
5678@ifinfo 5674@ifnottex
5679@example 5675@example
5680cos(x) = 1 - x^2 / 2! + O(x^3) 5676cos(x) = 1 - x^2 / 2! + O(x^3)
5681@end example 5677@end example
5682@end ifinfo 5678@end ifnottex
5683@tex 5679@tex
5684\turnoffactive 5680\turnoffactive
5685\beforedisplay 5681\beforedisplay
@@ -6204,11 +6200,11 @@ equations numerically is @dfn{Newton's Method}. Given the equation
6204@expr{x_0} which is reasonably close to the desired solution, apply 6200@expr{x_0} which is reasonably close to the desired solution, apply
6205this formula over and over: 6201this formula over and over:
6206 6202
6207@ifinfo 6203@ifnottex
6208@example 6204@example
6209new_x = x - f(x)/f'(x) 6205new_x = x - f(x)/f'(x)
6210@end example 6206@end example
6211@end ifinfo 6207@end ifnottex
6212@tex 6208@tex
6213\beforedisplay 6209\beforedisplay
6214$$ x_{\rm new} = x - {f(x) \over f'(x)} $$ 6210$$ x_{\rm new} = x - {f(x) \over f'(x)} $$
@@ -6242,11 +6238,11 @@ is defined as the derivative of
6242@infoline @expr{ln(gamma(z))}. 6238@infoline @expr{ln(gamma(z))}.
6243For large values of @expr{z}, it can be approximated by the infinite sum 6239For large values of @expr{z}, it can be approximated by the infinite sum
6244 6240
6245@ifinfo 6241@ifnottex
6246@example 6242@example
6247psi(z) ~= ln(z) - 1/2z - sum(bern(2 n) / 2 n z^(2 n), n, 1, inf) 6243psi(z) ~= ln(z) - 1/2z - sum(bern(2 n) / 2 n z^(2 n), n, 1, inf)
6248@end example 6244@end example
6249@end ifinfo 6245@end ifnottex
6250@tex 6246@tex
6251\beforedisplay 6247\beforedisplay
6252$$ \psi(z) \approx \ln z - {1\over2z} - 6248$$ \psi(z) \approx \ln z - {1\over2z} -
@@ -6305,13 +6301,13 @@ a way to convert from this form back to the standard algebraic form.
6305(@bullet{}) @strong{Exercise 11.} The @dfn{Stirling numbers of the 6301(@bullet{}) @strong{Exercise 11.} The @dfn{Stirling numbers of the
6306first kind} are defined by the recurrences, 6302first kind} are defined by the recurrences,
6307 6303
6308@ifinfo 6304@ifnottex
6309@example 6305@example
6310s(n,n) = 1 for n >= 0, 6306s(n,n) = 1 for n >= 0,
6311s(n,0) = 0 for n > 0, 6307s(n,0) = 0 for n > 0,
6312s(n+1,m) = s(n,m-1) - n s(n,m) for n >= m >= 1. 6308s(n+1,m) = s(n,m-1) - n s(n,m) for n >= m >= 1.
6313@end example 6309@end example
6314@end ifinfo 6310@end ifnottex
6315@tex 6311@tex
6316\turnoffactive 6312\turnoffactive
6317\beforedisplay 6313\beforedisplay
@@ -6843,14 +6839,14 @@ get the row sum. Similarly, use @kbd{[1 1] r 4 *} to get the column sum.
6843@node Matrix Answer 2, Matrix Answer 3, Matrix Answer 1, Answers to Exercises 6839@node Matrix Answer 2, Matrix Answer 3, Matrix Answer 1, Answers to Exercises
6844@subsection Matrix Tutorial Exercise 2 6840@subsection Matrix Tutorial Exercise 2
6845 6841
6846@ifinfo 6842@ifnottex
6847@example 6843@example
6848@group 6844@group
6849 x + a y = 6 6845 x + a y = 6
6850 x + b y = 10 6846 x + b y = 10
6851@end group 6847@end group
6852@end example 6848@end example
6853@end ifinfo 6849@end ifnottex
6854@tex 6850@tex
6855\turnoffactive 6851\turnoffactive
6856\beforedisplay 6852\beforedisplay
@@ -6905,7 +6901,7 @@ now, we have a system
6905@infoline @expr{A2 * X = B2} 6901@infoline @expr{A2 * X = B2}
6906which we can solve using Calc's @samp{/} command. 6902which we can solve using Calc's @samp{/} command.
6907 6903
6908@ifinfo 6904@ifnottex
6909@example 6905@example
6910@group 6906@group
6911 a + 2b + 3c = 6 6907 a + 2b + 3c = 6
@@ -6914,7 +6910,7 @@ which we can solve using Calc's @samp{/} command.
6914 2a + 4b + 6c = 11 6910 2a + 4b + 6c = 11
6915@end group 6911@end group
6916@end example 6912@end example
6917@end ifinfo 6913@end ifnottex
6918@tex 6914@tex
6919\turnoffactive 6915\turnoffactive
6920\beforedisplayh 6916\beforedisplayh
@@ -7045,11 +7041,11 @@ vector.
7045Given @expr{x} and @expr{y} vectors in quick variables 1 and 2 as before, 7041Given @expr{x} and @expr{y} vectors in quick variables 1 and 2 as before,
7046the first job is to form the matrix that describes the problem. 7042the first job is to form the matrix that describes the problem.
7047 7043
7048@ifinfo 7044@ifnottex
7049@example 7045@example
7050 m*x + b*1 = y 7046 m*x + b*1 = y
7051@end example 7047@end example
7052@end ifinfo 7048@end ifnottex
7053@tex 7049@tex
7054\turnoffactive 7050\turnoffactive
7055\beforedisplay 7051\beforedisplay
@@ -7836,11 +7832,11 @@ Why does this work? Think about a two-step computation:
7836subtracting off enough 511's to put the result in the desired range. 7832subtracting off enough 511's to put the result in the desired range.
7837So the result when we take the modulo after every step is, 7833So the result when we take the modulo after every step is,
7838 7834
7839@ifinfo 7835@ifnottex
7840@example 7836@example
78413 (3 a + b - 511 m) + c - 511 n 78373 (3 a + b - 511 m) + c - 511 n
7842@end example 7838@end example
7843@end ifinfo 7839@end ifnottex
7844@tex 7840@tex
7845\turnoffactive 7841\turnoffactive
7846\beforedisplay 7842\beforedisplay
@@ -7852,11 +7848,11 @@ $$ 3 (3 a + b - 511 m) + c - 511 n $$
7852for some suitable integers @expr{m} and @expr{n}. Expanding out by 7848for some suitable integers @expr{m} and @expr{n}. Expanding out by
7853the distributive law yields 7849the distributive law yields
7854 7850
7855@ifinfo 7851@ifnottex
7856@example 7852@example
78579 a + 3 b + c - 511*3 m - 511 n 78539 a + 3 b + c - 511*3 m - 511 n
7858@end example 7854@end example
7859@end ifinfo 7855@end ifnottex
7860@tex 7856@tex
7861\turnoffactive 7857\turnoffactive
7862\beforedisplay 7858\beforedisplay
@@ -7870,11 +7866,11 @@ contribution it makes could just as easily be made by the @expr{n}
7870term. So we can take it out to get an equivalent formula with 7866term. So we can take it out to get an equivalent formula with
7871@expr{n' = 3m + n}, 7867@expr{n' = 3m + n},
7872 7868
7873@ifinfo 7869@ifnottex
7874@example 7870@example
78759 a + 3 b + c - 511 n' 78719 a + 3 b + c - 511 n'
7876@end example 7872@end example
7877@end ifinfo 7873@end ifnottex
7878@tex 7874@tex
7879\turnoffactive 7875\turnoffactive
7880\beforedisplay 7876\beforedisplay
@@ -11285,7 +11281,7 @@ from 1 to 8. Interval arithmetic is used to get a worst-case estimate
11285of the possible range of values a computation will produce, given the 11281of the possible range of values a computation will produce, given the
11286set of possible values of the input. 11282set of possible values of the input.
11287 11283
11288@ifinfo 11284@ifnottex
11289Calc supports several varieties of intervals, including @dfn{closed} 11285Calc supports several varieties of intervals, including @dfn{closed}
11290intervals of the type shown above, @dfn{open} intervals such as 11286intervals of the type shown above, @dfn{open} intervals such as
11291@samp{(2 ..@: 4)}, which represents the range of numbers from 2 to 4 11287@samp{(2 ..@: 4)}, which represents the range of numbers from 2 to 4
@@ -11296,7 +11292,7 @@ terms,
11296@samp{[2 ..@: 4)} represents @expr{2 <= x < 4}, 11292@samp{[2 ..@: 4)} represents @expr{2 <= x < 4},
11297@samp{(2 ..@: 4]} represents @expr{2 < x <= 4}, and 11293@samp{(2 ..@: 4]} represents @expr{2 < x <= 4}, and
11298@samp{(2 ..@: 4)} represents @expr{2 < x < 4}. 11294@samp{(2 ..@: 4)} represents @expr{2 < x < 4}.
11299@end ifinfo 11295@end ifnottex
11300@tex 11296@tex
11301Calc supports several varieties of intervals, including \dfn{closed} 11297Calc supports several varieties of intervals, including \dfn{closed}
11302intervals of the type shown above, \dfn{open} intervals such as 11298intervals of the type shown above, \dfn{open} intervals such as
@@ -11929,14 +11925,14 @@ commands, @kbd{t h} works only when Calc Trail is the selected window.
11929@pindex calc-trail-isearch-forward 11925@pindex calc-trail-isearch-forward
11930@kindex t r 11926@kindex t r
11931@pindex calc-trail-isearch-backward 11927@pindex calc-trail-isearch-backward
11932@ifinfo 11928@ifnottex
11933The @kbd{t s} (@code{calc-trail-isearch-forward}) and @kbd{t r} 11929The @kbd{t s} (@code{calc-trail-isearch-forward}) and @kbd{t r}
11934(@code{calc-trail-isearch-backward}) commands perform an incremental 11930(@code{calc-trail-isearch-backward}) commands perform an incremental
11935search forward or backward through the trail. You can press @key{RET} 11931search forward or backward through the trail. You can press @key{RET}
11936to terminate the search; the trail pointer moves to the current line. 11932to terminate the search; the trail pointer moves to the current line.
11937If you cancel the search with @kbd{C-g}, the trail pointer stays where 11933If you cancel the search with @kbd{C-g}, the trail pointer stays where
11938it was when the search began. 11934it was when the search began.
11939@end ifinfo 11935@end ifnottex
11940@tex 11936@tex
11941The @kbd{t s} (@code{calc-trail-isearch-forward}) and @kbd{t r} 11937The @kbd{t s} (@code{calc-trail-isearch-forward}) and @kbd{t r}
11942(@code{calc-trail-isearch-backward}) com\-mands perform an incremental 11938(@code{calc-trail-isearch-backward}) com\-mands perform an incremental
@@ -14237,10 +14233,10 @@ font information.
14237Also, the ``discretionary multiplication sign'' @samp{\*} is read 14233Also, the ``discretionary multiplication sign'' @samp{\*} is read
14238the same as @samp{*}. 14234the same as @samp{*}.
14239 14235
14240@ifinfo 14236@ifnottex
14241The @TeX{} version of this manual includes some printed examples at the 14237The @TeX{} version of this manual includes some printed examples at the
14242end of this section. 14238end of this section.
14243@end ifinfo 14239@end ifnottex
14244@iftex 14240@iftex
14245Here are some examples of how various Calc formulas are formatted in @TeX{}: 14241Here are some examples of how various Calc formulas are formatted in @TeX{}:
14246 14242
@@ -17656,7 +17652,7 @@ formulas below for symbolic arguments only when you use the @kbd{a "}
17656(@code{calc-expand-formula}) command, or when taking derivatives or 17652(@code{calc-expand-formula}) command, or when taking derivatives or
17657integrals or solving equations involving the functions. 17653integrals or solving equations involving the functions.
17658 17654
17659@ifinfo 17655@ifnottex
17660These formulas are shown using the conventions of Big display 17656These formulas are shown using the conventions of Big display
17661mode (@kbd{d B}); for example, the formula for @code{fv} written 17657mode (@kbd{d B}); for example, the formula for @code{fv} written
17662linearly is @samp{pmt * ((1 + rate)^n) - 1) / rate}. 17658linearly is @samp{pmt * ((1 + rate)^n) - 1) / rate}.
@@ -17736,7 +17732,7 @@ syd(cost, salv, life, per) = --------------------------------
17736ddb(cost, salv, life, per) = --------, book = cost - depreciation so far 17732ddb(cost, salv, life, per) = --------, book = cost - depreciation so far
17737 life 17733 life
17738@end example 17734@end example
17739@end ifinfo 17735@end ifnottex
17740@tex 17736@tex
17741\turnoffactive 17737\turnoffactive
17742$$ \code{fv}(r, n, p) = p { (1 + r)^n - 1 \over r } $$ 17738$$ \code{fv}(r, n, p) = p { (1 + r)^n - 1 \over r } $$
@@ -18385,14 +18381,14 @@ some authors, is computed by the @kbd{I f G} [@code{gammaQ}] command.
18385You can think of this as taking the other half of the integral, from 18381You can think of this as taking the other half of the integral, from
18386@expr{x} to infinity. 18382@expr{x} to infinity.
18387 18383
18388@ifinfo 18384@ifnottex
18389The functions corresponding to the integrals that define @expr{P(a,x)} 18385The functions corresponding to the integrals that define @expr{P(a,x)}
18390and @expr{Q(a,x)} but without the normalizing @expr{1/gamma(a)} 18386and @expr{Q(a,x)} but without the normalizing @expr{1/gamma(a)}
18391factor are called @expr{g(a,x)} and @expr{G(a,x)}, respectively 18387factor are called @expr{g(a,x)} and @expr{G(a,x)}, respectively
18392(where @expr{g} and @expr{G} represent the lower- and upper-case Greek 18388(where @expr{g} and @expr{G} represent the lower- and upper-case Greek
18393letter gamma). You can obtain these using the @kbd{H f G} [@code{gammag}] 18389letter gamma). You can obtain these using the @kbd{H f G} [@code{gammag}]
18394and @kbd{H I f G} [@code{gammaG}] commands. 18390and @kbd{H I f G} [@code{gammaG}] commands.
18395@end ifinfo 18391@end ifnottex
18396@tex 18392@tex
18397\turnoffactive 18393\turnoffactive
18398The functions corresponding to the integrals that define $P(a,x)$ 18394The functions corresponding to the integrals that define $P(a,x)$
@@ -18908,10 +18904,10 @@ real numbers by
18908@kindex H k c 18904@kindex H k c
18909@pindex calc-perm 18905@pindex calc-perm
18910@tindex perm 18906@tindex perm
18911@ifinfo 18907@ifnottex
18912The @kbd{H k c} (@code{calc-perm}) [@code{perm}] command computes the 18908The @kbd{H k c} (@code{calc-perm}) [@code{perm}] command computes the
18913number-of-permutations function @expr{N! / (N-M)!}. 18909number-of-permutations function @expr{N! / (N-M)!}.
18914@end ifinfo 18910@end ifnottex
18915@tex 18911@tex
18916The \kbd{H k c} (\code{calc-perm}) [\code{perm}] command computes the 18912The \kbd{H k c} (\code{calc-perm}) [\code{perm}] command computes the
18917number-of-perm\-utations function $N! \over (N-M)!\,$. 18913number-of-perm\-utations function $N! \over (N-M)!\,$.
@@ -23151,13 +23147,13 @@ integral of the expression on top of the stack. In this case, the
23151command will again prompt for an integration variable, then prompt for a 23147command will again prompt for an integration variable, then prompt for a
23152lower limit and an upper limit. 23148lower limit and an upper limit.
23153 23149
23154@ifinfo 23150@ifnottex
23155If you use the @code{integ} function directly in an algebraic formula, 23151If you use the @code{integ} function directly in an algebraic formula,
23156you can also write @samp{integ(f,x,v)} which expresses the resulting 23152you can also write @samp{integ(f,x,v)} which expresses the resulting
23157indefinite integral in terms of variable @code{v} instead of @code{x}. 23153indefinite integral in terms of variable @code{v} instead of @code{x}.
23158With four arguments, @samp{integ(f(x),x,a,b)} represents a definite 23154With four arguments, @samp{integ(f(x),x,a,b)} represents a definite
23159integral from @code{a} to @code{b}. 23155integral from @code{a} to @code{b}.
23160@end ifinfo 23156@end ifnottex
23161@tex 23157@tex
23162If you use the @code{integ} function directly in an algebraic formula, 23158If you use the @code{integ} function directly in an algebraic formula,
23163you can also write @samp{integ(f,x,v)} which expresses the resulting 23159you can also write @samp{integ(f,x,v)} which expresses the resulting
@@ -24038,14 +24034,14 @@ name only those and let the parameters use default names.
24038 24034
24039For example, suppose the data matrix 24035For example, suppose the data matrix
24040 24036
24041@ifinfo 24037@ifnottex
24042@example 24038@example
24043@group 24039@group
24044[ [ 1, 2, 3, 4, 5 ] 24040[ [ 1, 2, 3, 4, 5 ]
24045 [ 5, 7, 9, 11, 13 ] ] 24041 [ 5, 7, 9, 11, 13 ] ]
24046@end group 24042@end group
24047@end example 24043@end example
24048@end ifinfo 24044@end ifnottex
24049@tex 24045@tex
24050\turnoffactive 24046\turnoffactive
24051\turnoffactive 24047\turnoffactive
@@ -24102,11 +24098,11 @@ Calc has chosen a line that best approximates the data points using
24102the method of least squares. The idea is to define the @dfn{chi-square} 24098the method of least squares. The idea is to define the @dfn{chi-square}
24103error measure 24099error measure
24104 24100
24105@ifinfo 24101@ifnottex
24106@example 24102@example
24107chi^2 = sum((y_i - (a + b x_i))^2, i, 1, N) 24103chi^2 = sum((y_i - (a + b x_i))^2, i, 1, N)
24108@end example 24104@end example
24109@end ifinfo 24105@end ifnottex
24110@tex 24106@tex
24111\turnoffactive 24107\turnoffactive
24112\beforedisplay 24108\beforedisplay
@@ -24291,11 +24287,11 @@ then the
24291@infoline @expr{chi^2} 24287@infoline @expr{chi^2}
24292statistic is now, 24288statistic is now,
24293 24289
24294@ifinfo 24290@ifnottex
24295@example 24291@example
24296chi^2 = sum(((y_i - (a + b x_i)) / sigma_i)^2, i, 1, N) 24292chi^2 = sum(((y_i - (a + b x_i)) / sigma_i)^2, i, 1, N)
24297@end example 24293@end example
24298@end ifinfo 24294@end ifnottex
24299@tex 24295@tex
24300\turnoffactive 24296\turnoffactive
24301\beforedisplay 24297\beforedisplay
@@ -27613,9 +27609,9 @@ The unit @code{A} stands for Amperes; the name @code{Ang} is used
27613@tex 27609@tex
27614for \AA ngstroms. 27610for \AA ngstroms.
27615@end tex 27611@end tex
27616@ifinfo 27612@ifnottex
27617for Angstroms. 27613for Angstroms.
27618@end ifinfo 27614@end ifnottex
27619 27615
27620The unit @code{pt} stands for pints; the name @code{point} stands for 27616The unit @code{pt} stands for pints; the name @code{point} stands for
27621a typographical point, defined by @samp{72 point = 1 in}. This is 27617a typographical point, defined by @samp{72 point = 1 in}. This is
@@ -34535,9 +34531,9 @@ modification follow.
34535@iftex 34531@iftex
34536@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 34532@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
34537@end iftex 34533@end iftex
34538@ifinfo 34534@ifnottex
34539@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 34535@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
34540@end ifinfo 34536@end ifnottex
34541 34537
34542@enumerate 0 34538@enumerate 0
34543@item 34539@item
@@ -34760,9 +34756,9 @@ of promoting the sharing and reuse of software generally.
34760@iftex 34756@iftex
34761@heading NO WARRANTY 34757@heading NO WARRANTY
34762@end iftex 34758@end iftex
34763@ifinfo 34759@ifnottex
34764@center NO WARRANTY 34760@center NO WARRANTY
34765@end ifinfo 34761@end ifnottex
34766 34762
34767@item 34763@item
34768BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 34764BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
@@ -34790,9 +34786,9 @@ POSSIBILITY OF SUCH DAMAGES.
34790@iftex 34786@iftex
34791@heading END OF TERMS AND CONDITIONS 34787@heading END OF TERMS AND CONDITIONS
34792@end iftex 34788@end iftex
34793@ifinfo 34789@ifnottex
34794@center END OF TERMS AND CONDITIONS 34790@center END OF TERMS AND CONDITIONS
34795@end ifinfo 34791@end ifnottex
34796 34792
34797@page 34793@page
34798@unnumberedsec Appendix: How to Apply These Terms to Your New Programs 34794@unnumberedsec Appendix: How to Apply These Terms to Your New Programs