diff options
| author | Jay Belanger | 2012-07-29 22:38:24 -0500 |
|---|---|---|
| committer | Jay Belanger | 2012-07-29 22:38:24 -0500 |
| commit | d2bd74ff3e3f88027c4a7de0dcdb7dfb3e12716e (patch) | |
| tree | e7ac1574fa2658e71dc12dd1878ed358945026a6 /doc | |
| parent | 4514c2522dc0d5a65698b5a2d397e53102b247eb (diff) | |
| download | emacs-d2bd74ff3e3f88027c4a7de0dcdb7dfb3e12716e.tar.gz emacs-d2bd74ff3e3f88027c4a7de0dcdb7dfb3e12716e.zip | |
doc/misc/calc.texi (Getting Started, Tutorial): Change simulated
Calc output to match actual output.
(Simplifying Formulas): Mention that algebraic simplification is now
the default.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/misc/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/misc/calc.texi | 401 |
2 files changed, 194 insertions, 214 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index fe7687424ca..d0f60c60234 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-07-30 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 2 | |||
| 3 | * calc.texi (Getting Started, Tutorial): Change simulated | ||
| 4 | Calc output to match actual output. | ||
| 5 | (Simplifying Formulas): Mention that algebraic simplification is now | ||
| 6 | the default. | ||
| 7 | |||
| 1 | 2012-07-28 Eli Zaretskii <eliz@gnu.org> | 8 | 2012-07-28 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | * faq.texi (Right-to-left alphabets): Update for Emacs 24. | 10 | * faq.texi (Right-to-left alphabets): Update for Emacs 24. |
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index fe11cedce5d..301866ad65c 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -910,12 +910,12 @@ The derivative of | |||
| 910 | 910 | ||
| 911 | is | 911 | is |
| 912 | 912 | ||
| 913 | 1 / ln(x) x | 913 | 1 / x ln(x) |
| 914 | @end group | 914 | @end group |
| 915 | @end smallexample | 915 | @end smallexample |
| 916 | 916 | ||
| 917 | (Note that by default, Calc gives division lower precedence than multiplication, | 917 | (Note that by default, Calc gives division lower precedence than multiplication, |
| 918 | so that @samp{1 / ln(x) x} is equivalent to @samp{1 / (ln(x) x)}.) | 918 | so that @samp{1 / x ln(x)} is equivalent to @samp{1 / (x ln(x))}.) |
| 919 | 919 | ||
| 920 | To make this look nicer, you might want to press @kbd{d =} to center | 920 | To make this look nicer, you might want to press @kbd{d =} to center |
| 921 | the formula, and even @kbd{d B} to use Big display mode. | 921 | the formula, and even @kbd{d B} to use Big display mode. |
| @@ -932,7 +932,7 @@ is | |||
| 932 | 932 | ||
| 933 | 1 | 933 | 1 |
| 934 | ------- | 934 | ------- |
| 935 | ln(x) x | 935 | x ln(x) |
| 936 | @end group | 936 | @end group |
| 937 | @end smallexample | 937 | @end smallexample |
| 938 | 938 | ||
| @@ -964,7 +964,9 @@ and keyboard will revert to the way they were before. | |||
| 964 | The related command @kbd{C-x * w} operates on a single word, which | 964 | The related command @kbd{C-x * w} operates on a single word, which |
| 965 | generally means a single number, inside text. It searches for an | 965 | generally means a single number, inside text. It searches for an |
| 966 | expression which ``looks'' like a number containing the point. | 966 | expression which ``looks'' like a number containing the point. |
| 967 | Here's an example of its use: | 967 | Here's an example of its use (before you try this, remove the Calc |
| 968 | annotations or use a new buffer so that the extra settings in the | ||
| 969 | annotations don't take effect): | ||
| 968 | 970 | ||
| 969 | @smallexample | 971 | @smallexample |
| 970 | A slope of one-third corresponds to an angle of 1 degrees. | 972 | A slope of one-third corresponds to an angle of 1 degrees. |
| @@ -1175,15 +1177,16 @@ turned out to be more open-ended than one might have expected. | |||
| 1175 | 1177 | ||
| 1176 | Emacs Lisp didn't have built-in floating point math (now it does), so | 1178 | Emacs Lisp didn't have built-in floating point math (now it does), so |
| 1177 | this had to be simulated in software. In fact, Emacs integers would | 1179 | this had to be simulated in software. In fact, Emacs integers would |
| 1178 | only comfortably fit six decimal digits or so---not enough for a decent | 1180 | only comfortably fit six decimal digits or so (at the time)---not |
| 1179 | calculator. So I had to write my own high-precision integer code as | 1181 | enough for a decent calculator. So I had to write my own |
| 1180 | well, and once I had this I figured that arbitrary-size integers were | 1182 | high-precision integer code as well, and once I had this I figured |
| 1181 | just as easy as large integers. Arbitrary floating-point precision was | 1183 | that arbitrary-size integers were just as easy as large integers. |
| 1182 | the logical next step. Also, since the large integer arithmetic was | 1184 | Arbitrary floating-point precision was the logical next step. Also, |
| 1183 | there anyway it seemed only fair to give the user direct access to it, | 1185 | since the large integer arithmetic was there anyway it seemed only |
| 1184 | which in turn made it practical to support fractions as well as floats. | 1186 | fair to give the user direct access to it, which in turn made it |
| 1185 | All these features inspired me to look around for other data types that | 1187 | practical to support fractions as well as floats. All these features |
| 1186 | might be worth having. | 1188 | inspired me to look around for other data types that might be worth |
| 1189 | having. | ||
| 1187 | 1190 | ||
| 1188 | Around this time, my friend Rick Koshi showed me his nifty new HP-28 | 1191 | Around this time, my friend Rick Koshi showed me his nifty new HP-28 |
| 1189 | calculator. It allowed the user to manipulate formulas as well as | 1192 | calculator. It allowed the user to manipulate formulas as well as |
| @@ -1359,15 +1362,14 @@ to control various modes of the Calculator. | |||
| 1359 | @subsection RPN Calculations and the Stack | 1362 | @subsection RPN Calculations and the Stack |
| 1360 | 1363 | ||
| 1361 | @cindex RPN notation | 1364 | @cindex RPN notation |
| 1362 | @ifnottex | ||
| 1363 | @noindent | 1365 | @noindent |
| 1366 | @ifnottex | ||
| 1364 | Calc normally uses RPN notation. You may be familiar with the RPN | 1367 | Calc normally uses RPN notation. You may be familiar with the RPN |
| 1365 | system from Hewlett-Packard calculators, FORTH, or PostScript. | 1368 | system from Hewlett-Packard calculators, FORTH, or PostScript. |
| 1366 | (Reverse Polish Notation, RPN, is named after the Polish mathematician | 1369 | (Reverse Polish Notation, RPN, is named after the Polish mathematician |
| 1367 | Jan Lukasiewicz.) | 1370 | Jan Lukasiewicz.) |
| 1368 | @end ifnottex | 1371 | @end ifnottex |
| 1369 | @tex | 1372 | @tex |
| 1370 | \noindent | ||
| 1371 | Calc normally uses RPN notation. You may be familiar with the RPN | 1373 | Calc normally uses RPN notation. You may be familiar with the RPN |
| 1372 | system from Hewlett-Packard calculators, FORTH, or PostScript. | 1374 | system from Hewlett-Packard calculators, FORTH, or PostScript. |
| 1373 | (Reverse Polish Notation, RPN, is named after the Polish mathematician | 1375 | (Reverse Polish Notation, RPN, is named after the Polish mathematician |
| @@ -1473,7 +1475,7 @@ multiplication.) Figure it out by hand, then try it with Calc to see | |||
| 1473 | if you're right. @xref{RPN Answer 1, 1}. (@bullet{}) | 1475 | if you're right. @xref{RPN Answer 1, 1}. (@bullet{}) |
| 1474 | 1476 | ||
| 1475 | (@bullet{}) @strong{Exercise 2.} Compute | 1477 | (@bullet{}) @strong{Exercise 2.} Compute |
| 1476 | @texline @math{(2\times4) + (7\times9.4) + {5\over4}} | 1478 | @texline @math{(2\times4) + (7\times9.5) + {5\over4}} |
| 1477 | @infoline @expr{2*4 + 7*9.5 + 5/4} | 1479 | @infoline @expr{2*4 + 7*9.5 + 5/4} |
| 1478 | using the stack. @xref{RPN Answer 2, 2}. (@bullet{}) | 1480 | using the stack. @xref{RPN Answer 2, 2}. (@bullet{}) |
| 1479 | 1481 | ||
| @@ -1964,7 +1966,7 @@ values are left alone, even when you evaluate the formula. | |||
| 1964 | 1966 | ||
| 1965 | @smallexample | 1967 | @smallexample |
| 1966 | @group | 1968 | @group |
| 1967 | 1: 2 a + 2 b 1: 34 + 2 b | 1969 | 1: 2 a + 2 b 1: 2 b + 34 |
| 1968 | . . | 1970 | . . |
| 1969 | 1971 | ||
| 1970 | ' 2a+2b @key{RET} = | 1972 | ' 2a+2b @key{RET} = |
| @@ -1976,7 +1978,7 @@ alone, as are calls for which the value is undefined. | |||
| 1976 | 1978 | ||
| 1977 | @smallexample | 1979 | @smallexample |
| 1978 | @group | 1980 | @group |
| 1979 | 1: 2 + log10(0) + log10(x) + log10(5, 6) + foo(3) | 1981 | 1: log10(0) + log10(x) + log10(5, 6) + foo(3) + 2 |
| 1980 | . | 1982 | . |
| 1981 | 1983 | ||
| 1982 | ' log10(100) + log10(0) + log10(x) + log10(5,6) + foo(3) @key{RET} | 1984 | ' log10(100) + log10(0) + log10(x) + log10(5,6) + foo(3) @key{RET} |
| @@ -4588,7 +4590,7 @@ that arises in the second one. | |||
| 4588 | @cindex Fermat, primality test of | 4590 | @cindex Fermat, primality test of |
| 4589 | (@bullet{}) @strong{Exercise 10.} A theorem of Pierre de Fermat | 4591 | (@bullet{}) @strong{Exercise 10.} A theorem of Pierre de Fermat |
| 4590 | says that | 4592 | says that |
| 4591 | @texline @w{@math{x^{n-1} \bmod n = 1}} | 4593 | @texline @math{x^{n-1} \bmod n = 1} |
| 4592 | @infoline @expr{x^(n-1) mod n = 1} | 4594 | @infoline @expr{x^(n-1) mod n = 1} |
| 4593 | if @expr{n} is a prime number and @expr{x} is an integer less than | 4595 | if @expr{n} is a prime number and @expr{x} is an integer less than |
| 4594 | @expr{n}. If @expr{n} is @emph{not} a prime number, this will | 4596 | @expr{n}. If @expr{n} is @emph{not} a prime number, this will |
| @@ -4704,19 +4706,17 @@ for them. | |||
| 4704 | 4706 | ||
| 4705 | @smallexample | 4707 | @smallexample |
| 4706 | @group | 4708 | @group |
| 4707 | 1: 20 degF 1: 11.1111 degC 1: -20:3 degC 1: -6.666 degC | 4709 | 1: 20 degF 1: 11.1111 degC 1: -6.666 degC |
| 4708 | . . . . | 4710 | . . . . |
| 4709 | 4711 | ||
| 4710 | ' 20 degF @key{RET} u c degC @key{RET} U u t degC @key{RET} c f | 4712 | ' 20 degF @key{RET} u c degC @key{RET} U u t degC @key{RET} |
| 4711 | @end group | 4713 | @end group |
| 4712 | @end smallexample | 4714 | @end smallexample |
| 4713 | 4715 | ||
| 4714 | @noindent | 4716 | @noindent |
| 4715 | First we convert a change of 20 degrees Fahrenheit into an equivalent | 4717 | First we convert a change of 20 degrees Fahrenheit into an equivalent |
| 4716 | change in degrees Celsius (or Centigrade). Then, we convert the | 4718 | change in degrees Celsius (or Centigrade). Then, we convert the |
| 4717 | absolute temperature 20 degrees Fahrenheit into Celsius. Since | 4719 | absolute temperature 20 degrees Fahrenheit into Celsius. |
| 4718 | this comes out as an exact fraction, we then convert to floating-point | ||
| 4719 | for easier comparison with the other result. | ||
| 4720 | 4720 | ||
| 4721 | For simple unit conversions, you can put a plain number on the stack. | 4721 | For simple unit conversions, you can put a plain number on the stack. |
| 4722 | Then @kbd{u c} and @kbd{u t} will prompt for both old and new units. | 4722 | Then @kbd{u c} and @kbd{u t} will prompt for both old and new units. |
| @@ -4775,7 +4775,7 @@ formulas as regular data objects. | |||
| 4775 | 4775 | ||
| 4776 | @smallexample | 4776 | @smallexample |
| 4777 | @group | 4777 | @group |
| 4778 | 1: 2 x^2 - 6 1: 6 - 2 x^2 1: (6 - 2 x^2) (3 x^2 + y) | 4778 | 1: 2 x^2 - 6 1: 6 - 2 x^2 1: (3 x^2 + y) (6 - 2 x^2) |
| 4779 | . . . | 4779 | . . . |
| 4780 | 4780 | ||
| 4781 | ' 2x^2-6 @key{RET} n ' 3x^2+y @key{RET} * | 4781 | ' 2x^2-6 @key{RET} n ' 3x^2+y @key{RET} * |
| @@ -4791,7 +4791,7 @@ formulas. Continuing with the formula from the last example, | |||
| 4791 | 4791 | ||
| 4792 | @smallexample | 4792 | @smallexample |
| 4793 | @group | 4793 | @group |
| 4794 | 1: 18 x^2 + 6 y - 6 x^4 - 2 x^2 y 1: (18 - 2 y) x^2 - 6 x^4 + 6 y | 4794 | 1: 18 x^2 - 6 x^4 + 6 y - 2 y x^2 1: (18 - 2 y) x^2 - 6 x^4 + 6 y |
| 4795 | . . | 4795 | . . |
| 4796 | 4796 | ||
| 4797 | a x a c x @key{RET} | 4797 | a x a c x @key{RET} |
| @@ -4849,17 +4849,17 @@ the other root(s), let's divide through by @expr{x} and then solve: | |||
| 4849 | 4849 | ||
| 4850 | @smallexample | 4850 | @smallexample |
| 4851 | @group | 4851 | @group |
| 4852 | 1: (34 x - 24 x^3) / x 1: 34 x / x - 24 x^3 / x 1: 34 - 24 x^2 | 4852 | 1: (34 x - 24 x^3) / x 1: 34 - 24 x^2 |
| 4853 | . . . | 4853 | . . |
| 4854 | 4854 | ||
| 4855 | ' x @key{RET} / a x a s | 4855 | ' x @key{RET} / a x |
| 4856 | 4856 | ||
| 4857 | @end group | 4857 | @end group |
| 4858 | @end smallexample | 4858 | @end smallexample |
| 4859 | @noindent | 4859 | @noindent |
| 4860 | @smallexample | 4860 | @smallexample |
| 4861 | @group | 4861 | @group |
| 4862 | 1: 34 - 24 x^2 = 0 1: x = 1.19023 | 4862 | 1: 0.70588 x^2 = 1 1: x = 1.19023 |
| 4863 | . . | 4863 | . . |
| 4864 | 4864 | ||
| 4865 | 0 a = s 3 a S x @key{RET} | 4865 | 0 a = s 3 a S x @key{RET} |
| @@ -4867,10 +4867,6 @@ the other root(s), let's divide through by @expr{x} and then solve: | |||
| 4867 | @end smallexample | 4867 | @end smallexample |
| 4868 | 4868 | ||
| 4869 | @noindent | 4869 | @noindent |
| 4870 | Notice the use of @kbd{a s} to ``simplify'' the formula. When the | ||
| 4871 | default algebraic simplifications don't do enough, you can use | ||
| 4872 | @kbd{a s} to tell Calc to spend more time on the job. | ||
| 4873 | |||
| 4874 | Now we compute the second derivative and plug in our values of @expr{x}: | 4870 | Now we compute the second derivative and plug in our values of @expr{x}: |
| 4875 | 4871 | ||
| 4876 | @smallexample | 4872 | @smallexample |
| @@ -4905,7 +4901,7 @@ has a maximum value at @expr{x = 1.19023}. (The function also has a | |||
| 4905 | local @emph{minimum} at @expr{x = 0}.) | 4901 | local @emph{minimum} at @expr{x = 0}.) |
| 4906 | 4902 | ||
| 4907 | When we solved for @expr{x}, we got only one value even though | 4903 | When we solved for @expr{x}, we got only one value even though |
| 4908 | @expr{34 - 24 x^2 = 0} is a quadratic equation that ought to have | 4904 | @expr{0.70588 x^2 = 1} is a quadratic equation that ought to have |
| 4909 | two solutions. The reason is that @w{@kbd{a S}} normally returns a | 4905 | two solutions. The reason is that @w{@kbd{a S}} normally returns a |
| 4910 | single ``principal'' solution. If it needs to come up with an | 4906 | single ``principal'' solution. If it needs to come up with an |
| 4911 | arbitrary sign (as occurs in the quadratic formula) it picks @expr{+}. | 4907 | arbitrary sign (as occurs in the quadratic formula) it picks @expr{+}. |
| @@ -4914,7 +4910,7 @@ solution by pressing @kbd{H} (the Hyperbolic flag) before @kbd{a S}. | |||
| 4914 | 4910 | ||
| 4915 | @smallexample | 4911 | @smallexample |
| 4916 | @group | 4912 | @group |
| 4917 | 1: 34 - 24 x^2 = 0 1: x = 1.19023 s1 1: x = -1.19023 | 4913 | 1: 0.70588 x^2 = 1 1: x = 1.19023 s1 1: x = -1.19023 |
| 4918 | . . . | 4914 | . . . |
| 4919 | 4915 | ||
| 4920 | r 3 H a S x @key{RET} s 5 1 n s l s1 @key{RET} | 4916 | r 3 H a S x @key{RET} s 5 1 n s l s1 @key{RET} |
| @@ -5135,7 +5131,7 @@ also have used plain @kbd{v x} as follows: @kbd{v x 10 @key{RET} 9 + .1 *}.) | |||
| 5135 | @smallexample | 5131 | @smallexample |
| 5136 | @group | 5132 | @group |
| 5137 | 2: [1, 1.1, ... ] 1: [0., 0.084941, 0.16993, ... ] | 5133 | 2: [1, 1.1, ... ] 1: [0., 0.084941, 0.16993, ... ] |
| 5138 | 1: sin(x) ln(x) . | 5134 | 1: ln(x) sin(x) . |
| 5139 | . | 5135 | . |
| 5140 | 5136 | ||
| 5141 | ' sin(x) ln(x) @key{RET} s 1 m r p 5 @key{RET} V M $ @key{RET} | 5137 | ' sin(x) ln(x) @key{RET} s 1 m r p 5 @key{RET} V M $ @key{RET} |
| @@ -5168,7 +5164,7 @@ we're not doing too well. Let's try another approach. | |||
| 5168 | 5164 | ||
| 5169 | @smallexample | 5165 | @smallexample |
| 5170 | @group | 5166 | @group |
| 5171 | 1: sin(x) ln(x) 1: 0.84147 x - 0.84147 + 0.11957 (x - 1)^2 - ... | 5167 | 1: ln(x) sin(x) 1: 0.84147 x + 0.11957 (x - 1)^2 - ... |
| 5172 | . . | 5168 | . . |
| 5173 | 5169 | ||
| 5174 | r 1 a t x=1 @key{RET} 4 @key{RET} | 5170 | r 1 a t x=1 @key{RET} 4 @key{RET} |
| @@ -5277,60 +5273,43 @@ Suppose we want to simplify this trigonometric formula: | |||
| 5277 | 5273 | ||
| 5278 | @smallexample | 5274 | @smallexample |
| 5279 | @group | 5275 | @group |
| 5280 | 1: 2 / cos(x)^2 - 2 tan(x)^2 | 5276 | 1: 2 sec(x)^2 / tan(x)^2 - 2 / tan(x)^2 |
| 5281 | . | 5277 | . |
| 5282 | 5278 | ||
| 5283 | ' 2/cos(x)^2 - 2tan(x)^2 @key{RET} s 1 | 5279 | ' 2sec(x)^2/tan(x)^2 - 2/tan(x)^2 @key{RET} s 1 |
| 5284 | @end group | 5280 | @end group |
| 5285 | @end smallexample | 5281 | @end smallexample |
| 5286 | 5282 | ||
| 5287 | @noindent | 5283 | @noindent |
| 5288 | If we were simplifying this by hand, we'd probably replace the | 5284 | If we were simplifying this by hand, we'd probably combine over the common |
| 5289 | @samp{tan} with a @samp{sin/cos} first, then combine over a common | 5285 | denominator. The @kbd{a n} algebra command will do this, but we'll do |
| 5290 | denominator. The @kbd{I a s} command will do the former and the @kbd{a n} | 5286 | it with a rewrite rule just for practice. |
| 5291 | algebra command will do the latter, but we'll do both with rewrite | ||
| 5292 | rules just for practice. | ||
| 5293 | 5287 | ||
| 5294 | Rewrite rules are written with the @samp{:=} symbol. | 5288 | Rewrite rules are written with the @samp{:=} symbol. |
| 5295 | 5289 | ||
| 5296 | @smallexample | 5290 | @smallexample |
| 5297 | @group | 5291 | @group |
| 5298 | 1: 2 / cos(x)^2 - 2 sin(x)^2 / cos(x)^2 | 5292 | 1: (2 sec(x)^2 - 2) / tan(x)^2 |
| 5299 | . | 5293 | . |
| 5300 | 5294 | ||
| 5301 | a r tan(a) := sin(a)/cos(a) @key{RET} | 5295 | a r a/x + b/x := (a+b)/x @key{RET} |
| 5302 | @end group | 5296 | @end group |
| 5303 | @end smallexample | 5297 | @end smallexample |
| 5304 | 5298 | ||
| 5305 | @noindent | 5299 | @noindent |
| 5306 | (The ``assignment operator'' @samp{:=} has several uses in Calc. All | 5300 | (The ``assignment operator'' @samp{:=} has several uses in Calc. All |
| 5307 | by itself the formula @samp{tan(a) := sin(a)/cos(a)} doesn't do anything, | 5301 | by itself the formula @samp{a/x + b/x := (a+b)/x} doesn't do anything, |
| 5308 | but when it is given to the @kbd{a r} command, that command interprets | 5302 | but when it is given to the @kbd{a r} command, that command interprets |
| 5309 | it as a rewrite rule.) | 5303 | it as a rewrite rule.) |
| 5310 | 5304 | ||
| 5311 | The lefthand side, @samp{tan(a)}, is called the @dfn{pattern} of the | 5305 | The lefthand side, @samp{a/x + b/x}, is called the @dfn{pattern} of the |
| 5312 | rewrite rule. Calc searches the formula on the stack for parts that | 5306 | rewrite rule. Calc searches the formula on the stack for parts that |
| 5313 | match the pattern. Variables in a rewrite pattern are called | 5307 | match the pattern. Variables in a rewrite pattern are called |
| 5314 | @dfn{meta-variables}, and when matching the pattern each meta-variable | 5308 | @dfn{meta-variables}, and when matching the pattern each meta-variable |
| 5315 | can match any sub-formula. Here, the meta-variable @samp{a} matched | 5309 | can match any sub-formula. Here, the meta-variable @samp{a} matched |
| 5316 | the actual variable @samp{x}. | 5310 | the expression @samp{2 sec(x)^2}, the meta-variable @samp{b} matched |
| 5317 | 5311 | the constant @samp{-2} and the meta-variable @samp{x} matched | |
| 5318 | When the pattern part of a rewrite rule matches a part of the formula, | 5312 | the expression @samp{tan(x)^2}. |
| 5319 | that part is replaced by the righthand side with all the meta-variables | ||
| 5320 | substituted with the things they matched. So the result is | ||
| 5321 | @samp{sin(x) / cos(x)}. Calc's normal algebraic simplifications then | ||
| 5322 | mix this in with the rest of the original formula. | ||
| 5323 | |||
| 5324 | To merge over a common denominator, we can use another simple rule: | ||
| 5325 | |||
| 5326 | @smallexample | ||
| 5327 | @group | ||
| 5328 | 1: (2 - 2 sin(x)^2) / cos(x)^2 | ||
| 5329 | . | ||
| 5330 | |||
| 5331 | a r a/x + b/x := (a+b)/x @key{RET} | ||
| 5332 | @end group | ||
| 5333 | @end smallexample | ||
| 5334 | 5313 | ||
| 5335 | This rule points out several interesting features of rewrite patterns. | 5314 | This rule points out several interesting features of rewrite patterns. |
| 5336 | First, if a meta-variable appears several times in a pattern, it must | 5315 | First, if a meta-variable appears several times in a pattern, it must |
| @@ -5340,13 +5319,18 @@ denominators. | |||
| 5340 | 5319 | ||
| 5341 | Second, meta-variable names are independent from variables in the | 5320 | Second, meta-variable names are independent from variables in the |
| 5342 | target formula. Notice that the meta-variable @samp{x} here matches | 5321 | target formula. Notice that the meta-variable @samp{x} here matches |
| 5343 | the subformula @samp{cos(x)^2}; Calc never confuses the two meanings of | 5322 | the subformula @samp{tan(x)^2}; Calc never confuses the two meanings of |
| 5344 | @samp{x}. | 5323 | @samp{x}. |
| 5345 | 5324 | ||
| 5346 | And third, rewrite patterns know a little bit about the algebraic | 5325 | And third, rewrite patterns know a little bit about the algebraic |
| 5347 | properties of formulas. The pattern called for a sum of two quotients; | 5326 | properties of formulas. The pattern called for a sum of two quotients; |
| 5348 | Calc was able to match a difference of two quotients by matching | 5327 | Calc was able to match a difference of two quotients by matching |
| 5349 | @samp{a = 2}, @samp{b = -2 sin(x)^2}, and @samp{x = cos(x)^2}. | 5328 | @samp{a = 2 sec(x)^2}, @samp{b = -2}, and @samp{x = tan(x)^2}. |
| 5329 | |||
| 5330 | When the pattern part of a rewrite rule matches a part of the formula, | ||
| 5331 | that part is replaced by the righthand side with all the meta-variables | ||
| 5332 | substituted with the things they matched. So the result is | ||
| 5333 | @samp{(2 sec(x)^2 - 2) / tan(x)^2}. | ||
| 5350 | 5334 | ||
| 5351 | @c [fix-ref Algebraic Properties of Rewrite Rules] | 5335 | @c [fix-ref Algebraic Properties of Rewrite Rules] |
| 5352 | We could just as easily have written @samp{a/x - b/x := (a-b)/x} for | 5336 | We could just as easily have written @samp{a/x - b/x := (a-b)/x} for |
| @@ -5356,19 +5340,19 @@ we could have used the @code{plain} symbol. @xref{Algebraic Properties | |||
| 5356 | of Rewrite Rules}, for some examples of this.) | 5340 | of Rewrite Rules}, for some examples of this.) |
| 5357 | 5341 | ||
| 5358 | One more rewrite will complete the job. We want to use the identity | 5342 | One more rewrite will complete the job. We want to use the identity |
| 5359 | @samp{sin(x)^2 + cos(x)^2 = 1}, but of course we must first rearrange | 5343 | @samp{tan(x)^2 + 1 = sec(x)^2}, but of course we must first rearrange |
| 5360 | the identity in a way that matches our formula. The obvious rule | 5344 | the identity in a way that matches our formula. The obvious rule |
| 5361 | would be @samp{@w{2 - 2 sin(x)^2} := 2 cos(x)^2}, but a little thought shows | 5345 | would be @samp{@w{2 sec(x)^2 - 2} := 2 tan(x)^2}, but a little thought shows |
| 5362 | that the rule @samp{sin(x)^2 := 1 - cos(x)^2} will also work. The | 5346 | that the rule @samp{sec(x)^2 := 1 + tan(x)^2} will also work. The |
| 5363 | latter rule has a more general pattern so it will work in many other | 5347 | latter rule has a more general pattern so it will work in many other |
| 5364 | situations, too. | 5348 | situations, too. |
| 5365 | 5349 | ||
| 5366 | @smallexample | 5350 | @smallexample |
| 5367 | @group | 5351 | @group |
| 5368 | 1: (2 + 2 cos(x)^2 - 2) / cos(x)^2 1: 2 | 5352 | 1: 2 |
| 5369 | . . | 5353 | . |
| 5370 | 5354 | ||
| 5371 | a r sin(x)^2 := 1 - cos(x)^2 @key{RET} a s | 5355 | a r sec(x)^2 := 1 + tan(x)^2 @key{RET} |
| 5372 | @end group | 5356 | @end group |
| 5373 | @end smallexample | 5357 | @end smallexample |
| 5374 | 5358 | ||
| @@ -5383,14 +5367,13 @@ having to retype it. | |||
| 5383 | 5367 | ||
| 5384 | @smallexample | 5368 | @smallexample |
| 5385 | @group | 5369 | @group |
| 5386 | ' tan(x) := sin(x)/cos(x) @key{RET} s t tsc @key{RET} | 5370 | ' a/x + b/x := (a+b)/x @key{RET} s t merge @key{RET} |
| 5387 | ' a/x + b/x := (a+b)/x @key{RET} s t merge @key{RET} | 5371 | ' sec(x)^2 := 1 + tan(x)^2 @key{RET} s t secsqr @key{RET} |
| 5388 | ' sin(x)^2 := 1 - cos(x)^2 @key{RET} s t sinsqr @key{RET} | ||
| 5389 | 5372 | ||
| 5390 | 1: 2 / cos(x)^2 - 2 tan(x)^2 1: 2 | 5373 | 1: 2 sec(x)^2 / tan(x)^2 - 2 / tan(x)^2 1: 2 |
| 5391 | . . | 5374 | . . |
| 5392 | 5375 | ||
| 5393 | r 1 a r tsc @key{RET} a r merge @key{RET} a r sinsqr @key{RET} a s | 5376 | r 1 a r merge @key{RET} a r secsqr @key{RET} |
| 5394 | @end group | 5377 | @end group |
| 5395 | @end smallexample | 5378 | @end smallexample |
| 5396 | 5379 | ||
| @@ -5420,20 +5403,20 @@ a variable containing a vector of rules. | |||
| 5420 | 5403 | ||
| 5421 | @smallexample | 5404 | @smallexample |
| 5422 | @group | 5405 | @group |
| 5423 | 1: [tsc, merge, sinsqr] 1: [tan(x) := sin(x) / cos(x), ... ] | 5406 | 1: [merge, secsqr] 1: [a/x + b/x := (a + b)/x, ... ] |
| 5424 | . . | 5407 | . . |
| 5425 | 5408 | ||
| 5426 | ' [tsc,merge,sinsqr] @key{RET} = | 5409 | ' [merge,sinsqr] @key{RET} = |
| 5427 | 5410 | ||
| 5428 | @end group | 5411 | @end group |
| 5429 | @end smallexample | 5412 | @end smallexample |
| 5430 | @noindent | 5413 | @noindent |
| 5431 | @smallexample | 5414 | @smallexample |
| 5432 | @group | 5415 | @group |
| 5433 | 1: 1 / cos(x) - sin(x) tan(x) 1: cos(x) | 5416 | 1: 2 sec(x)^2 / tan(x)^2 - 2 / tan(x)^2 1: 2 |
| 5434 | . . | 5417 | . . |
| 5435 | 5418 | ||
| 5436 | s t trig @key{RET} r 1 a r trig @key{RET} a s | 5419 | s t trig @key{RET} r 1 a r trig @key{RET} |
| 5437 | @end group | 5420 | @end group |
| 5438 | @end smallexample | 5421 | @end smallexample |
| 5439 | 5422 | ||
| @@ -5451,10 +5434,10 @@ only one rewrite at a time. | |||
| 5451 | 5434 | ||
| 5452 | @smallexample | 5435 | @smallexample |
| 5453 | @group | 5436 | @group |
| 5454 | 1: 1 / cos(x) - sin(x)^2 / cos(x) 1: (1 - sin(x)^2) / cos(x) | 5437 | 1: (2 sec(x)^2 - 2) / tan(x)^2 1: 2 |
| 5455 | . . | 5438 | . . |
| 5456 | 5439 | ||
| 5457 | r 1 M-1 a r trig @key{RET} M-1 a r trig @key{RET} | 5440 | r 1 M-1 a r trig @key{RET} M-1 a r trig @key{RET} |
| 5458 | @end group | 5441 | @end group |
| 5459 | @end smallexample | 5442 | @end smallexample |
| 5460 | 5443 | ||
| @@ -5466,20 +5449,20 @@ with a @samp{::} symbol and the desired condition. For example, | |||
| 5466 | 5449 | ||
| 5467 | @smallexample | 5450 | @smallexample |
| 5468 | @group | 5451 | @group |
| 5469 | 1: exp(2 pi i) + exp(3 pi i) + exp(4 pi i) | 5452 | 1: sin(x + 2 pi) + sin(x + 3 pi) + sin(x + 4 pi) |
| 5470 | . | 5453 | . |
| 5471 | 5454 | ||
| 5472 | ' exp(2 pi i) + exp(3 pi i) + exp(4 pi i) @key{RET} | 5455 | ' sin(x+2pi) + sin(x+3pi) + sin(x+4pi) @key{RET} |
| 5473 | 5456 | ||
| 5474 | @end group | 5457 | @end group |
| 5475 | @end smallexample | 5458 | @end smallexample |
| 5476 | @noindent | 5459 | @noindent |
| 5477 | @smallexample | 5460 | @smallexample |
| 5478 | @group | 5461 | @group |
| 5479 | 1: 1 + exp(3 pi i) + 1 | 5462 | 1: sin(x + 3 pi) + 2 sin(x) |
| 5480 | . | 5463 | . |
| 5481 | 5464 | ||
| 5482 | a r exp(k pi i) := 1 :: k % 2 = 0 @key{RET} | 5465 | a r sin(a + k pi) := sin(a) :: k % 2 = 0 @key{RET} |
| 5483 | @end group | 5466 | @end group |
| 5484 | @end smallexample | 5467 | @end smallexample |
| 5485 | 5468 | ||
| @@ -5487,10 +5470,10 @@ with a @samp{::} symbol and the desired condition. For example, | |||
| 5487 | (Recall, @samp{k % 2} is the remainder from dividing @samp{k} by 2, | 5470 | (Recall, @samp{k % 2} is the remainder from dividing @samp{k} by 2, |
| 5488 | which will be zero only when @samp{k} is an even integer.) | 5471 | which will be zero only when @samp{k} is an even integer.) |
| 5489 | 5472 | ||
| 5490 | An interesting point is that the variables @samp{pi} and @samp{i} | 5473 | An interesting point is that the variable @samp{pi} was matched |
| 5491 | were matched literally rather than acting as meta-variables. | 5474 | literally rather than acting as a meta-variable. |
| 5492 | This is because they are special-constant variables. The special | 5475 | This is because it is a special-constant variable. The special |
| 5493 | constants @samp{e}, @samp{phi}, and so on also match literally. | 5476 | constants @samp{e}, @samp{i}, @samp{phi}, and so on also match literally. |
| 5494 | A common error with rewrite | 5477 | A common error with rewrite |
| 5495 | rules is to write, say, @samp{f(a,b,c,d,e) := g(a+b+c+d+e)}, expecting | 5478 | rules is to write, say, @samp{f(a,b,c,d,e) := g(a+b+c+d+e)}, expecting |
| 5496 | to match any @samp{f} with five arguments but in fact matching | 5479 | to match any @samp{f} with five arguments but in fact matching |
| @@ -5541,7 +5524,7 @@ Now: | |||
| 5541 | 5524 | ||
| 5542 | @smallexample | 5525 | @smallexample |
| 5543 | @group | 5526 | @group |
| 5544 | 1: fib(6) + fib(x) + fib(0) 1: 8 + fib(x) + fib(0) | 5527 | 1: fib(6) + fib(x) + fib(0) 1: fib(x) + fib(0) + 8 |
| 5545 | . . | 5528 | . . |
| 5546 | 5529 | ||
| 5547 | ' fib(6)+fib(x)+fib(0) @key{RET} a r fib @key{RET} | 5530 | ' fib(6)+fib(x)+fib(0) @key{RET} a r fib @key{RET} |
| @@ -5707,10 +5690,10 @@ power series represented as @samp{@var{polynomial} + O(@var{var}^@var{n})}. | |||
| 5707 | For example, given @samp{1 - x^2 / 2 + O(x^3)} and @samp{x - x^3 / 6 + O(x^4)} | 5690 | For example, given @samp{1 - x^2 / 2 + O(x^3)} and @samp{x - x^3 / 6 + O(x^4)} |
| 5708 | on the stack, we want to be able to type @kbd{*} and get the result | 5691 | on the stack, we want to be able to type @kbd{*} and get the result |
| 5709 | @samp{x - 2:3 x^3 + O(x^4)}. Don't worry if the terms of the sum are | 5692 | @samp{x - 2:3 x^3 + O(x^4)}. Don't worry if the terms of the sum are |
| 5710 | rearranged or if @kbd{a s} needs to be typed after rewriting. (This one | 5693 | rearranged. (This one is rather tricky; the solution at the end of |
| 5711 | is rather tricky; the solution at the end of this chapter uses 6 rewrite | 5694 | this chapter uses 6 rewrite rules. Hint: The @samp{constant(x)} |
| 5712 | rules. Hint: The @samp{constant(x)} condition tests whether @samp{x} is | 5695 | condition tests whether @samp{x} is a number.) @xref{Rewrites Answer |
| 5713 | a number.) @xref{Rewrites Answer 6, 6}. (@bullet{}) | 5696 | 6, 6}. (@bullet{}) |
| 5714 | 5697 | ||
| 5715 | Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}. | 5698 | Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}. |
| 5716 | What happens? (Be sure to remove this rule afterward, or you might get | 5699 | What happens? (Be sure to remove this rule afterward, or you might get |
| @@ -5737,7 +5720,7 @@ case @kbd{z} prefix. | |||
| 5737 | 5720 | ||
| 5738 | @smallexample | 5721 | @smallexample |
| 5739 | @group | 5722 | @group |
| 5740 | 1: 1 + x + x^2 / 2 + x^3 / 6 1: 1 + x + x^2 / 2 + x^3 / 6 | 5723 | 1: x + x^2 / 2 + x^3 / 6 + 1 1: x + x^2 / 2 + x^3 / 6 + 1 |
| 5741 | . . | 5724 | . . |
| 5742 | 5725 | ||
| 5743 | ' 1 + x + x^2/2! + x^3/3! @key{RET} Z F e myexp @key{RET} @key{RET} @key{RET} y | 5726 | ' 1 + x + x^2/2! + x^3/3! @key{RET} Z F e myexp @key{RET} @key{RET} @key{RET} y |
| @@ -5808,7 +5791,7 @@ you may wish to program a keyboard macro to type this for you. | |||
| 5808 | 5791 | ||
| 5809 | ' y=sqrt(x) @key{RET} C-x ( H a S x @key{RET} C-x ) | 5792 | ' y=sqrt(x) @key{RET} C-x ( H a S x @key{RET} C-x ) |
| 5810 | 5793 | ||
| 5811 | 1: y = cos(x) 1: x = s1 arccos(y) + 2 pi n1 | 5794 | 1: y = cos(x) 1: x = s1 arccos(y) + 2 n1 pi |
| 5812 | . . | 5795 | . . |
| 5813 | 5796 | ||
| 5814 | ' y=cos(x) @key{RET} X | 5797 | ' y=cos(x) @key{RET} X |
| @@ -6874,7 +6857,7 @@ matrix as usual. | |||
| 6874 | 6857 | ||
| 6875 | @smallexample | 6858 | @smallexample |
| 6876 | @group | 6859 | @group |
| 6877 | 1: [6, 10] 2: [6, 10] 1: [6 - 4 a / (b - a), 4 / (b - a) ] | 6860 | 1: [6, 10] 2: [6, 10] 1: [4 a / (a - b) + 6, 4 / (b - a) ] |
| 6878 | . 1: [ [ 1, a ] . | 6861 | . 1: [ [ 1, a ] . |
| 6879 | [ 1, b ] ] | 6862 | [ 1, b ] ] |
| 6880 | . | 6863 | . |
| @@ -6888,9 +6871,9 @@ mode: | |||
| 6888 | 6871 | ||
| 6889 | @smallexample | 6872 | @smallexample |
| 6890 | @group | 6873 | @group |
| 6891 | 4 a 4 | 6874 | 4 a 4 |
| 6892 | 1: [6 - -----, -----] | 6875 | 1: [----- + 6, -----] |
| 6893 | b - a b - a | 6876 | a - b b - a |
| 6894 | @end group | 6877 | @end group |
| 6895 | @end smallexample | 6878 | @end smallexample |
| 6896 | 6879 | ||
| @@ -8442,11 +8425,11 @@ to the other? | |||
| 8442 | 8425 | ||
| 8443 | @smallexample | 8426 | @smallexample |
| 8444 | @group | 8427 | @group |
| 8445 | 1: 3.3356 ns 1: 0.81356 ns / ns 1: 0.81356 | 8428 | 1: 3.3356 ns 1: 0.81356 |
| 8446 | 2: 4.1 ns . . | 8429 | 2: 4.1 ns . |
| 8447 | . | 8430 | . |
| 8448 | 8431 | ||
| 8449 | ' 4.1 ns @key{RET} / u s | 8432 | ' 4.1 ns @key{RET} / |
| 8450 | @end group | 8433 | @end group |
| 8451 | @end smallexample | 8434 | @end smallexample |
| 8452 | 8435 | ||
| @@ -8523,7 +8506,7 @@ familiar form. | |||
| 8523 | @noindent | 8506 | @noindent |
| 8524 | @smallexample | 8507 | @smallexample |
| 8525 | @group | 8508 | @group |
| 8526 | 1: [x - 1.19023, x + 1.19023, x] 1: (x - 1.19023) (x + 1.19023) x | 8509 | 1: [x - 1.19023, x + 1.19023, x] 1: x*(x + 1.19023) (x - 1.19023) |
| 8527 | . . | 8510 | . . |
| 8528 | 8511 | ||
| 8529 | V M ' x-$ @key{RET} V R * | 8512 | V M ' x-$ @key{RET} V R * |
| @@ -8549,7 +8532,7 @@ same as the original polynomial. | |||
| 8549 | 8532 | ||
| 8550 | @smallexample | 8533 | @smallexample |
| 8551 | @group | 8534 | @group |
| 8552 | 1: x sin(pi x) 1: (sin(pi x) - pi x cos(pi x)) / pi^2 | 8535 | 1: x sin(pi x) 1: sin(pi x) / pi^2 - x cos(pi x) / pi |
| 8553 | . . | 8536 | . . |
| 8554 | 8537 | ||
| 8555 | ' x sin(pi x) @key{RET} m r a i x @key{RET} | 8538 | ' x sin(pi x) @key{RET} m r a i x @key{RET} |
| @@ -8560,7 +8543,7 @@ same as the original polynomial. | |||
| 8560 | @smallexample | 8543 | @smallexample |
| 8561 | @group | 8544 | @group |
| 8562 | 1: [y, 1] | 8545 | 1: [y, 1] |
| 8563 | 2: (sin(pi x) - pi x cos(pi x)) / pi^2 | 8546 | 2: sin(pi x) / pi^2 - x cos(pi x) / pi |
| 8564 | . | 8547 | . |
| 8565 | 8548 | ||
| 8566 | ' [y,1] @key{RET} @key{TAB} | 8549 | ' [y,1] @key{RET} @key{TAB} |
| @@ -8570,7 +8553,7 @@ same as the original polynomial. | |||
| 8570 | @noindent | 8553 | @noindent |
| 8571 | @smallexample | 8554 | @smallexample |
| 8572 | @group | 8555 | @group |
| 8573 | 1: [(sin(pi y) - pi y cos(pi y)) / pi^2, (sin(pi) - pi cos(pi)) / pi^2] | 8556 | 1: [sin(pi y) / pi^2 - y cos(pi y) / pi, 1 / pi] |
| 8574 | . | 8557 | . |
| 8575 | 8558 | ||
| 8576 | V M $ @key{RET} | 8559 | V M $ @key{RET} |
| @@ -8580,7 +8563,7 @@ same as the original polynomial. | |||
| 8580 | @noindent | 8563 | @noindent |
| 8581 | @smallexample | 8564 | @smallexample |
| 8582 | @group | 8565 | @group |
| 8583 | 1: (sin(pi y) - pi y cos(pi y)) / pi^2 + (pi cos(pi) - sin(pi)) / pi^2 | 8566 | 1: sin(pi y) / pi^2 - y cos(pi y) / pi - 1 / pi |
| 8584 | . | 8567 | . |
| 8585 | 8568 | ||
| 8586 | V R - | 8569 | V R - |
| @@ -8590,7 +8573,7 @@ same as the original polynomial. | |||
| 8590 | @noindent | 8573 | @noindent |
| 8591 | @smallexample | 8574 | @smallexample |
| 8592 | @group | 8575 | @group |
| 8593 | 1: (sin(3.14159 y) - 3.14159 y cos(3.14159 y)) / 9.8696 - 0.3183 | 8576 | 1: sin(3.14159 y) / 9.8696 - y cos(3.14159 y) / 3.14159 - 0.3183 |
| 8594 | . | 8577 | . |
| 8595 | 8578 | ||
| 8596 | = | 8579 | = |
| @@ -8685,11 +8668,11 @@ We'll use Big mode to make the formulas more readable. | |||
| 8685 | 8668 | ||
| 8686 | @smallexample | 8669 | @smallexample |
| 8687 | @group | 8670 | @group |
| 8688 | ___ | 8671 | ___ |
| 8689 | 2 + V 2 | 8672 | V 2 + 2 |
| 8690 | 1: (2 + sqrt(2)) / (1 + sqrt(2)) 1: -------- | 8673 | 1: (2 + sqrt(2)) / (1 + sqrt(2)) 1: --------- |
| 8691 | . ___ | 8674 | . ___ |
| 8692 | 1 + V 2 | 8675 | V 2 + 1 |
| 8693 | 8676 | ||
| 8694 | . | 8677 | . |
| 8695 | 8678 | ||
| @@ -8713,11 +8696,11 @@ Multiplying by the conjugate helps because @expr{(a+b) (a-b) = a^2 - b^2}. | |||
| 8713 | @noindent | 8696 | @noindent |
| 8714 | @smallexample | 8697 | @smallexample |
| 8715 | @group | 8698 | @group |
| 8716 | ___ ___ | 8699 | ___ |
| 8717 | 1: 2 + V 2 - 2 1: V 2 | 8700 | 1: V 2 |
| 8718 | . . | 8701 | . |
| 8719 | 8702 | ||
| 8720 | a r a*(b+c) := a*b + a*c a s | 8703 | a r a*(b+c) := a*b + a*c |
| 8721 | @end group | 8704 | @end group |
| 8722 | @end smallexample | 8705 | @end smallexample |
| 8723 | 8706 | ||
| @@ -12601,7 +12584,11 @@ followed by a shifted letter. | |||
| 12601 | The @kbd{m O} (@code{calc-no-simplify-mode}) command turns off all optional | 12584 | The @kbd{m O} (@code{calc-no-simplify-mode}) command turns off all optional |
| 12602 | simplifications. These would leave a formula like @expr{2+3} alone. In | 12585 | simplifications. These would leave a formula like @expr{2+3} alone. In |
| 12603 | fact, nothing except simple numbers are ever affected by normalization | 12586 | fact, nothing except simple numbers are ever affected by normalization |
| 12604 | in this mode. | 12587 | in this mode. Explicit simplification commands, such as @kbd{=} or |
| 12588 | @kbd{a s}, can still be given to simplify any formulas. | ||
| 12589 | @xref{Algebraic Definitions}, for a sample use of | ||
| 12590 | No-Simplification mode. | ||
| 12591 | |||
| 12605 | 12592 | ||
| 12606 | @kindex m N | 12593 | @kindex m N |
| 12607 | @pindex calc-num-simplify-mode | 12594 | @pindex calc-num-simplify-mode |
| @@ -12616,29 +12603,27 @@ A constant is a number or other numeric object (such as a constant | |||
| 12616 | error form or modulo form), or a vector all of whose | 12603 | error form or modulo form), or a vector all of whose |
| 12617 | elements are constant. | 12604 | elements are constant. |
| 12618 | 12605 | ||
| 12619 | @kindex m D | 12606 | @kindex m L |
| 12620 | @pindex calc-default-simplify-mode | 12607 | @pindex calc-limited-simplify-mode |
| 12621 | The @kbd{m D} (@code{calc-default-simplify-mode}) command restores the | 12608 | The @kbd{m L} (@code{calc-limited-simplify-mode}) command does limited |
| 12622 | default simplifications for all formulas. This includes many easy and | 12609 | simplifications for all formulas. This includes many easy and |
| 12623 | fast algebraic simplifications such as @expr{a+0} to @expr{a}, and | 12610 | fast algebraic simplifications such as @expr{a+0} to @expr{a}, and |
| 12624 | @expr{a + 2 a} to @expr{3 a}, as well as evaluating functions like | 12611 | @expr{a + 2 a} to @expr{3 a}, as well as evaluating functions like |
| 12625 | @expr{@tfn{deriv}(x^2, x)} to @expr{2 x}. | 12612 | @expr{@tfn{deriv}(x^2, x)} to @expr{2 x}. |
| 12626 | 12613 | ||
| 12627 | @kindex m B | 12614 | @kindex m B |
| 12628 | @pindex calc-bin-simplify-mode | 12615 | @pindex calc-bin-simplify-mode |
| 12629 | The @kbd{m B} (@code{calc-bin-simplify-mode}) mode applies the default | 12616 | The @kbd{m B} (@code{calc-bin-simplify-mode}) mode applies the limited |
| 12630 | simplifications to a result and then, if the result is an integer, | 12617 | simplifications to a result and then, if the result is an integer, |
| 12631 | uses the @kbd{b c} (@code{calc-clip}) command to clip the integer according | 12618 | uses the @kbd{b c} (@code{calc-clip}) command to clip the integer according |
| 12632 | to the current binary word size. @xref{Binary Functions}. Real numbers | 12619 | to the current binary word size. @xref{Binary Functions}. Real numbers |
| 12633 | are rounded to the nearest integer and then clipped; other kinds of | 12620 | are rounded to the nearest integer and then clipped; other kinds of |
| 12634 | results (after the default simplifications) are left alone. | 12621 | results (after the default simplifications) are left alone. |
| 12635 | 12622 | ||
| 12636 | @kindex m A | 12623 | @kindex m D |
| 12637 | @pindex calc-alg-simplify-mode | 12624 | @pindex calc-default-simplify-mode |
| 12638 | The @kbd{m A} (@code{calc-alg-simplify-mode}) mode does algebraic | 12625 | The @kbd{m D} (@code{calc-default-simplify-mode}) mode does standard |
| 12639 | simplification; it applies all the default simplifications, and also | 12626 | algebraic simplifications. @xref{Algebraic Simplifications}. |
| 12640 | the more powerful (and slower) simplifications made by @kbd{a s} | ||
| 12641 | (@code{calc-simplify}). @xref{Algebraic Simplifications}. | ||
| 12642 | 12627 | ||
| 12643 | @kindex m E | 12628 | @kindex m E |
| 12644 | @pindex calc-ext-simplify-mode | 12629 | @pindex calc-ext-simplify-mode |
| @@ -12658,9 +12643,7 @@ are simplified with their unit definitions in mind. | |||
| 12658 | A common technique is to set the simplification mode down to the lowest | 12643 | A common technique is to set the simplification mode down to the lowest |
| 12659 | amount of simplification you will allow to be applied automatically, then | 12644 | amount of simplification you will allow to be applied automatically, then |
| 12660 | use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to | 12645 | use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to |
| 12661 | perform higher types of simplifications on demand. @xref{Algebraic | 12646 | perform higher types of simplifications on demand. |
| 12662 | Definitions}, for another sample use of No-Simplification mode. | ||
| 12663 | |||
| 12664 | @node Declarations, Display Modes, Simplification Modes, Mode Settings | 12647 | @node Declarations, Display Modes, Simplification Modes, Mode Settings |
| 12665 | @section Declarations | 12648 | @section Declarations |
| 12666 | 12649 | ||
| @@ -15893,8 +15876,8 @@ Default simplifications for numeric arguments only (@kbd{m N}). | |||
| 15893 | @item BinSimp@var{w} | 15876 | @item BinSimp@var{w} |
| 15894 | Binary-integer simplification mode; word size @var{w} (@kbd{m B}, @kbd{b w}). | 15877 | Binary-integer simplification mode; word size @var{w} (@kbd{m B}, @kbd{b w}). |
| 15895 | 15878 | ||
| 15896 | @item AlgSimp | 15879 | @item LimSimp |
| 15897 | Algebraic simplification mode (@kbd{m A}). | 15880 | Limited simplification mode (@kbd{m L}). |
| 15898 | 15881 | ||
| 15899 | @item ExtSimp | 15882 | @item ExtSimp |
| 15900 | Extended algebraic simplification mode (@kbd{m E}). | 15883 | Extended algebraic simplification mode (@kbd{m E}). |
| @@ -16733,9 +16716,9 @@ produced!) Integers and fractions are generally unaffected by this | |||
| 16733 | operation. Vectors and formulas are cleaned by cleaning each component | 16716 | operation. Vectors and formulas are cleaned by cleaning each component |
| 16734 | number (i.e., pervasively). | 16717 | number (i.e., pervasively). |
| 16735 | 16718 | ||
| 16736 | If the simplification mode is set below the default level, it is raised | 16719 | If the simplification mode is set below the limited level, it is raised |
| 16737 | to the default level for the purposes of this command. Thus, @kbd{c c} | 16720 | to the limited level for the purposes of this command. Thus, @kbd{c c} |
| 16738 | applies the default simplifications even if their automatic application | 16721 | applies the limited simplifications even if their automatic application |
| 16739 | is disabled. @xref{Simplification Modes}. | 16722 | is disabled. @xref{Simplification Modes}. |
| 16740 | 16723 | ||
| 16741 | @cindex Roundoff errors, correcting | 16724 | @cindex Roundoff errors, correcting |
| @@ -18336,7 +18319,7 @@ of the current angular mode. @xref{Basic Operations on Units}. | |||
| 18336 | 18319 | ||
| 18337 | Also, the symbolic variable @code{pi} is not ordinarily recognized in | 18320 | Also, the symbolic variable @code{pi} is not ordinarily recognized in |
| 18338 | arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but | 18321 | arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but |
| 18339 | the @kbd{a s} (@code{calc-simplify}) command recognizes many such | 18322 | the default algebraic simplifications recognize many such |
| 18340 | formulas when the current angular mode is Radians @emph{and} Symbolic | 18323 | formulas when the current angular mode is Radians @emph{and} Symbolic |
| 18341 | mode is enabled; this example would be replaced by @samp{sqrt(2) / 2}. | 18324 | mode is enabled; this example would be replaced by @samp{sqrt(2) / 2}. |
| 18342 | @xref{Symbolic Mode}. Beware, this simplification occurs even if you | 18325 | @xref{Symbolic Mode}. Beware, this simplification occurs even if you |
| @@ -22075,8 +22058,8 @@ as well as equations. | |||
| 22075 | @pindex calc-sel-div-both-sides | 22058 | @pindex calc-sel-div-both-sides |
| 22076 | The @kbd{j *} (@code{calc-sel-mult-both-sides}) command prompts for a | 22059 | The @kbd{j *} (@code{calc-sel-mult-both-sides}) command prompts for a |
| 22077 | formula using algebraic entry, then multiplies both sides of the | 22060 | formula using algebraic entry, then multiplies both sides of the |
| 22078 | selected quotient or equation by that formula. It simplifies each | 22061 | selected quotient or equation by that formula. It performs the |
| 22079 | side with @kbd{a s} (@code{calc-simplify}) before re-forming the | 22062 | default algebraic simplifications before re-forming the |
| 22080 | quotient or equation. You can suppress this simplification by | 22063 | quotient or equation. You can suppress this simplification by |
| 22081 | providing a prefix argument: @kbd{C-u j *}. There is also a @kbd{j /} | 22064 | providing a prefix argument: @kbd{C-u j *}. There is also a @kbd{j /} |
| 22082 | (@code{calc-sel-div-both-sides}) which is similar to @kbd{j *} but | 22065 | (@code{calc-sel-div-both-sides}) which is similar to @kbd{j *} but |
| @@ -22143,15 +22126,15 @@ now to take the cosine of the selected part.) | |||
| 22143 | @kindex j v | 22126 | @kindex j v |
| 22144 | @pindex calc-sel-evaluate | 22127 | @pindex calc-sel-evaluate |
| 22145 | The @kbd{j v} (@code{calc-sel-evaluate}) command performs the | 22128 | The @kbd{j v} (@code{calc-sel-evaluate}) command performs the |
| 22146 | normal default simplifications on the selected sub-formula. | 22129 | limited simplifications on the selected sub-formula. |
| 22147 | These are the simplifications that are normally done automatically | 22130 | These simplifications would normally be done automatically |
| 22148 | on all results, but which may have been partially inhibited by | 22131 | on all results, but may have been partially inhibited by |
| 22149 | previous selection-related operations, or turned off altogether | 22132 | previous selection-related operations, or turned off altogether |
| 22150 | by the @kbd{m O} command. This command is just an auto-selecting | 22133 | by the @kbd{m O} command. This command is just an auto-selecting |
| 22151 | version of the @w{@kbd{a v}} command (@pxref{Algebraic Manipulation}). | 22134 | version of the @w{@kbd{a v}} command (@pxref{Algebraic Manipulation}). |
| 22152 | 22135 | ||
| 22153 | With a numeric prefix argument of 2, @kbd{C-u 2 j v} applies | 22136 | With a numeric prefix argument of 2, @kbd{C-u 2 j v} applies |
| 22154 | the @kbd{a s} (@code{calc-simplify}) command to the selected | 22137 | the default algebraic simplifications to the selected |
| 22155 | sub-formula. With a prefix argument of 3 or more, e.g., @kbd{C-u j v} | 22138 | sub-formula. With a prefix argument of 3 or more, e.g., @kbd{C-u j v} |
| 22156 | applies the @kbd{a e} (@code{calc-simplify-extended}) command. | 22139 | applies the @kbd{a e} (@code{calc-simplify-extended}) command. |
| 22157 | @xref{Simplifying Formulas}. With a negative prefix argument | 22140 | @xref{Simplifying Formulas}. With a negative prefix argument |
| @@ -22340,15 +22323,8 @@ turn the default simplifications off first (with @kbd{m O}). | |||
| 22340 | @kindex H a s | 22323 | @kindex H a s |
| 22341 | @pindex calc-simplify | 22324 | @pindex calc-simplify |
| 22342 | @tindex simplify | 22325 | @tindex simplify |
| 22343 | The @kbd{a s} (@code{calc-simplify}) [@code{simplify}] command applies | 22326 | |
| 22344 | various algebraic rules to simplify a formula. This includes rules which | 22327 | The sections below describe all the various kinds of |
| 22345 | are not part of the default simplifications because they may be too slow | ||
| 22346 | to apply all the time, or may not be desirable all of the time. For | ||
| 22347 | example, non-adjacent terms of sums are combined, as in @samp{a + b + 2 a} | ||
| 22348 | to @samp{b + 3 a}, and some formulas like @samp{sin(arcsin(x))} are | ||
| 22349 | simplified to @samp{x}. | ||
| 22350 | |||
| 22351 | The sections below describe all the various kinds of algebraic | ||
| 22352 | simplifications Calc provides in full detail. None of Calc's | 22328 | simplifications Calc provides in full detail. None of Calc's |
| 22353 | simplification commands are designed to pull rabbits out of hats; | 22329 | simplification commands are designed to pull rabbits out of hats; |
| 22354 | they simply apply certain specific rules to put formulas into | 22330 | they simply apply certain specific rules to put formulas into |
| @@ -22358,8 +22334,10 @@ and rewrite rules. @xref{Rearranging with Selections}. | |||
| 22358 | @xref{Rewrite Rules}. | 22334 | @xref{Rewrite Rules}. |
| 22359 | 22335 | ||
| 22360 | @xref{Simplification Modes}, for commands to control what level of | 22336 | @xref{Simplification Modes}, for commands to control what level of |
| 22361 | simplification occurs automatically. Normally only the ``default | 22337 | simplification occurs automatically. Normally only the default |
| 22362 | simplifications'' occur. | 22338 | algebraic simplifications occur. If you have turned on a |
| 22339 | simplification mode which does not do these default simplifications, | ||
| 22340 | you can still perform them on a formula with the @kbd{a s} command. | ||
| 22363 | 22341 | ||
| 22364 | There are some simplifications that, while sometimes useful, are never | 22342 | There are some simplifications that, while sometimes useful, are never |
| 22365 | done automatically. For example, the @kbd{I} prefix can be given to | 22343 | done automatically. For example, the @kbd{I} prefix can be given to |
| @@ -22379,29 +22357,23 @@ combinations of @samp{sinh}s and @samp{cosh}s before simplifying. | |||
| 22379 | 22357 | ||
| 22380 | 22358 | ||
| 22381 | @menu | 22359 | @menu |
| 22382 | * Default Simplifications:: | 22360 | * Limited Simplifications:: |
| 22383 | * Algebraic Simplifications:: | 22361 | * Algebraic Simplifications:: |
| 22384 | * Unsafe Simplifications:: | 22362 | * Unsafe Simplifications:: |
| 22385 | * Simplification of Units:: | 22363 | * Simplification of Units:: |
| 22386 | @end menu | 22364 | @end menu |
| 22387 | 22365 | ||
| 22388 | @node Default Simplifications, Algebraic Simplifications, Simplifying Formulas, Simplifying Formulas | 22366 | @node Limited Simplifications, Algebraic Simplifications, Simplifying Formulas, Simplifying Formulas |
| 22389 | @subsection Default Simplifications | 22367 | @subsection Limited Simplifications |
| 22390 | 22368 | ||
| 22391 | @noindent | 22369 | @noindent |
| 22392 | @cindex Default simplifications | 22370 | @cindex Limited simplifications |
| 22393 | This section describes the ``default simplifications,'' those which are | 22371 | This section describes a limited set of simplifications. These, as |
| 22394 | normally applied to all results. For example, if you enter the variable | 22372 | well as those described in the next section, are normally applied to |
| 22395 | @expr{x} on the stack twice and push @kbd{+}, Calc's default | 22373 | all results. You can type @kbd{m L} to restrict the simplifications |
| 22396 | simplifications automatically change @expr{x + x} to @expr{2 x}. | 22374 | done on the stack to this limited set. |
| 22397 | |||
| 22398 | The @kbd{m O} command turns off the default simplifications, so that | ||
| 22399 | @expr{x + x} will remain in this form unless you give an explicit | ||
| 22400 | ``simplify'' command like @kbd{=} or @kbd{a v}. @xref{Algebraic | ||
| 22401 | Manipulation}. The @kbd{m D} command turns the default simplifications | ||
| 22402 | back on. | ||
| 22403 | 22375 | ||
| 22404 | The most basic default simplification is the evaluation of functions. | 22376 | The most basic simplification is the evaluation of functions. |
| 22405 | For example, @expr{2 + 3} is evaluated to @expr{5}, and @expr{@tfn{sqrt}(9)} | 22377 | For example, @expr{2 + 3} is evaluated to @expr{5}, and @expr{@tfn{sqrt}(9)} |
| 22406 | is evaluated to @expr{3}. Evaluation does not occur if the arguments | 22378 | is evaluated to @expr{3}. Evaluation does not occur if the arguments |
| 22407 | to a function are somehow of the wrong type @expr{@tfn{tan}([2,3,4])}), | 22379 | to a function are somehow of the wrong type @expr{@tfn{tan}([2,3,4])}), |
| @@ -22419,16 +22391,17 @@ operator) do not evaluate their arguments, @code{if} (the @code{? :} | |||
| 22419 | operator) does not evaluate all of its arguments, and @code{evalto} | 22391 | operator) does not evaluate all of its arguments, and @code{evalto} |
| 22420 | does not evaluate its lefthand argument. | 22392 | does not evaluate its lefthand argument. |
| 22421 | 22393 | ||
| 22422 | Most commands apply the default simplifications to all arguments they | 22394 | Most commands apply at least these limited simplifications to all |
| 22423 | take from the stack, perform a particular operation, then simplify | 22395 | arguments they take from the stack, perform a particular operation, |
| 22424 | the result before pushing it back on the stack. In the common special | 22396 | then simplify the result before pushing it back on the stack. In the |
| 22425 | case of regular arithmetic commands like @kbd{+} and @kbd{Q} [@code{sqrt}], | 22397 | common special case of regular arithmetic commands like @kbd{+} and |
| 22426 | the arguments are simply popped from the stack and collected into a | 22398 | @kbd{Q} [@code{sqrt}], the arguments are simply popped from the stack |
| 22427 | suitable function call, which is then simplified (the arguments being | 22399 | and collected into a suitable function call, which is then simplified |
| 22428 | simplified first as part of the process, as described above). | 22400 | (the arguments being simplified first as part of the process, as |
| 22429 | 22401 | described above). | |
| 22430 | The default simplifications are too numerous to describe completely | 22402 | |
| 22431 | here, but this section will describe the ones that apply to the | 22403 | Even the limited set of simplifications are too numerous to describe |
| 22404 | completely here, but this section will describe the ones that apply to the | ||
| 22432 | major arithmetic operators. This list will be rather technical in | 22405 | major arithmetic operators. This list will be rather technical in |
| 22433 | nature, and will probably be interesting to you only if you are | 22406 | nature, and will probably be interesting to you only if you are |
| 22434 | a serious user of Calc's algebra facilities. | 22407 | a serious user of Calc's algebra facilities. |
| @@ -22446,7 +22419,7 @@ will also be applied before any built-in default simplifications. | |||
| 22446 | \bigskip | 22419 | \bigskip |
| 22447 | @end tex | 22420 | @end tex |
| 22448 | 22421 | ||
| 22449 | And now, on with the default simplifications: | 22422 | And now, on with the limited set of simplifications: |
| 22450 | 22423 | ||
| 22451 | Arithmetic operators like @kbd{+} and @kbd{*} always take two | 22424 | Arithmetic operators like @kbd{+} and @kbd{*} always take two |
| 22452 | arguments in Calc's internal form. Sums and products of three or | 22425 | arguments in Calc's internal form. Sums and products of three or |
| @@ -22720,29 +22693,29 @@ Most other Calc functions have few if any default simplifications | |||
| 22720 | defined, aside of course from evaluation when the arguments are | 22693 | defined, aside of course from evaluation when the arguments are |
| 22721 | suitable numbers. | 22694 | suitable numbers. |
| 22722 | 22695 | ||
| 22723 | @node Algebraic Simplifications, Unsafe Simplifications, Default Simplifications, Simplifying Formulas | 22696 | @node Algebraic Simplifications, Unsafe Simplifications, Limited Simplifications, Simplifying Formulas |
| 22724 | @subsection Algebraic Simplifications | 22697 | @subsection Algebraic Simplifications |
| 22725 | 22698 | ||
| 22726 | @noindent | 22699 | @noindent |
| 22727 | @cindex Algebraic simplifications | 22700 | @cindex Algebraic simplifications |
| 22728 | The @kbd{a s} command makes simplifications that may be too slow to | 22701 | @kindex a s |
| 22729 | do all the time, or that may not be desirable all of the time. | 22702 | @kindex I a s |
| 22730 | If you find these simplifications are worthwhile, you can type | 22703 | @kindex H a s |
| 22731 | @kbd{m A} to have Calc apply them automatically. | 22704 | @pindex calc-simplify |
| 22732 | 22705 | @tindex simplify | |
| 22733 | This section describes all simplifications that are performed by | 22706 | This section describes all simplifications that are performed by |
| 22734 | the @kbd{a s} command. Note that these occur in addition to the | 22707 | the default algebraic simplification mode. If you have switched to a different |
| 22735 | default simplifications; even if the default simplifications have | 22708 | simplification mode, you can switch back with the @kbd{m D} command. |
| 22736 | been turned off by an @kbd{m O} command, @kbd{a s} will turn them | 22709 | Even in other simplification modes, the @kbd{a s} command will use |
| 22737 | back on temporarily while it simplifies the formula. | 22710 | these algebraic simplifications to simplifies the formula. |
| 22738 | 22711 | ||
| 22739 | There is a variable, @code{AlgSimpRules}, in which you can put rewrites | 22712 | There is a variable, @code{AlgSimpRules}, in which you can put rewrites |
| 22740 | to be applied by @kbd{a s}. Its use is analogous to @code{EvalRules}, | 22713 | to be applied. Its use is analogous to @code{EvalRules}, |
| 22741 | but without the special restrictions. Basically, the simplifier does | 22714 | but without the special restrictions. Basically, the simplifier does |
| 22742 | @samp{@w{a r} AlgSimpRules} with an infinite repeat count on the whole | 22715 | @samp{@w{a r} AlgSimpRules} with an infinite repeat count on the whole |
| 22743 | expression being simplified, then it traverses the expression applying | 22716 | expression being simplified, then it traverses the expression applying |
| 22744 | the built-in rules described below. If the result is different from | 22717 | the built-in rules described below. If the result is different from |
| 22745 | the original expression, the process repeats with the default | 22718 | the original expression, the process repeats with the limited |
| 22746 | simplifications (including @code{EvalRules}), then @code{AlgSimpRules}, | 22719 | simplifications (including @code{EvalRules}), then @code{AlgSimpRules}, |
| 22747 | then the built-in simplifications, and so on. | 22720 | then the built-in simplifications, and so on. |
| 22748 | 22721 | ||
| @@ -22767,11 +22740,11 @@ non-adjacent ones. | |||
| 22767 | 22740 | ||
| 22768 | Products are sorted into a canonical order using the commutative | 22741 | Products are sorted into a canonical order using the commutative |
| 22769 | law. For example, @expr{b c a} is commuted to @expr{a b c}. | 22742 | law. For example, @expr{b c a} is commuted to @expr{a b c}. |
| 22770 | This allows easier comparison of products; for example, the default | 22743 | This allows easier comparison of products; for example, the limited |
| 22771 | simplifications will not change @expr{x y + y x} to @expr{2 x y}, | 22744 | simplifications will not change @expr{x y + y x} to @expr{2 x y}, |
| 22772 | but @kbd{a s} will; it first rewrites the sum to @expr{x y + x y}, | 22745 | but the algebraic simplifications; it first rewrites the sum to |
| 22773 | and then the default simplifications are able to recognize a sum | 22746 | @expr{x y + x y} which can then be recognized as a sum of identical |
| 22774 | of identical terms. | 22747 | terms. |
| 22775 | 22748 | ||
| 22776 | The canonical ordering used to sort terms of products has the | 22749 | The canonical ordering used to sort terms of products has the |
| 22777 | property that real-valued numbers, interval forms and infinities | 22750 | property that real-valued numbers, interval forms and infinities |
| @@ -22813,10 +22786,11 @@ as described above.) If there is any common integer or fractional | |||
| 22813 | factor in the numerator and denominator, it is canceled out; | 22786 | factor in the numerator and denominator, it is canceled out; |
| 22814 | for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. | 22787 | for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. |
| 22815 | 22788 | ||
| 22816 | Non-constant common factors are not found even by @kbd{a s}. To | 22789 | Non-constant common factors are not found even by algebraic |
| 22817 | cancel the factor @expr{a} in @expr{(a x + a) / a^2} you could first | 22790 | simplifications. To cancel the factor @expr{a} in |
| 22818 | use @kbd{j M} on the product @expr{a x} to Merge the numerator to | 22791 | @expr{(a x + a) / a^2} you could first use @kbd{j M} on the product |
| 22819 | @expr{a (1+x)}, which can then be simplified successfully. | 22792 | @expr{a x} to Merge the numerator to @expr{a (1+x)}, which can then be |
| 22793 | simplified successfully. | ||
| 22820 | 22794 | ||
| 22821 | @tex | 22795 | @tex |
| 22822 | \bigskip | 22796 | \bigskip |
| @@ -22825,11 +22799,10 @@ use @kbd{j M} on the product @expr{a x} to Merge the numerator to | |||
| 22825 | Integer powers of the variable @code{i} are simplified according | 22799 | Integer powers of the variable @code{i} are simplified according |
| 22826 | to the identity @expr{i^2 = -1}. If you store a new value other | 22800 | to the identity @expr{i^2 = -1}. If you store a new value other |
| 22827 | than the complex number @expr{(0,1)} in @code{i}, this simplification | 22801 | than the complex number @expr{(0,1)} in @code{i}, this simplification |
| 22828 | will no longer occur. This is done by @kbd{a s} instead of by default | 22802 | will no longer occur. This is not done by the limited |
| 22829 | in case someone (unwisely) uses the name @code{i} for a variable | 22803 | simplifications; in case someone (unwisely) wants to use the name |
| 22830 | unrelated to complex numbers; it would be unfortunate if Calc | 22804 | @code{i} for a variable unrelated to complex numbers, they can use |
| 22831 | quietly and automatically changed this formula for reasons the | 22805 | limited simplifications. |
| 22832 | user might not have been thinking of. | ||
| 22833 | 22806 | ||
| 22834 | Square roots of integer or rational arguments are simplified in | 22807 | Square roots of integer or rational arguments are simplified in |
| 22835 | several ways. (Note that these will be left unevaluated only in | 22808 | several ways. (Note that these will be left unevaluated only in |
| @@ -28800,7 +28773,7 @@ Edit @code{AlgSimpRules}. @xref{Algebraic Simplifications}. | |||
| 28800 | @item s D | 28773 | @item s D |
| 28801 | Edit @code{Decls}. @xref{Declarations}. | 28774 | Edit @code{Decls}. @xref{Declarations}. |
| 28802 | @item s E | 28775 | @item s E |
| 28803 | Edit @code{EvalRules}. @xref{Default Simplifications}. | 28776 | Edit @code{EvalRules}. @xref{Limited Simplifications}. |
| 28804 | @item s F | 28777 | @item s F |
| 28805 | Edit @code{FitRules}. @xref{Curve Fitting}. | 28778 | Edit @code{FitRules}. @xref{Curve Fitting}. |
| 28806 | @item s G | 28779 | @item s G |