[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/man/calc.texi
From: |
Jay Belanger |
Subject: |
[Emacs-diffs] Changes to emacs/man/calc.texi |
Date: |
Fri, 11 Feb 2005 00:44:59 -0500 |
Index: emacs/man/calc.texi
diff -c emacs/man/calc.texi:1.46 emacs/man/calc.texi:1.47
*** emacs/man/calc.texi:1.46 Thu Feb 10 18:54:10 2005
--- emacs/man/calc.texi Fri Feb 11 05:44:58 2005
***************
*** 17,31 ****
@c $x$ in TeX, @samp{x} otherwise.
@iftex
! @macro texline{stuff}
! \stuff\
@end macro
@alias infoline=comment
! @tex
! \gdef\exprsetup{\tex \let\t\ttfont \turnoffactive}
! \gdef\expr{\exprsetup$\exprfinish}
! \gdef\exprfinish#1{#1$\endgroup}
! @end tex
@alias mathit=expr
@macro cpi{}
@address@hidden
--- 17,27 ----
@c $x$ in TeX, @samp{x} otherwise.
@iftex
! @macro texline
@end macro
@alias infoline=comment
! @alias expr=math
! @alias tfn=code
@alias mathit=expr
@macro cpi{}
@address@hidden
***************
*** 41,46 ****
--- 37,43 ----
\stuff\
@end macro
@alias expr=samp
+ @alias tfn=t
@alias mathit=i
@macro cpi{}
@expr{pi}
***************
*** 663,669 ****
``buttons'' using your left mouse button.
@noindent
! Click on @key{PI}, @key{2}, and @t{y^x}.
@noindent
Click on @key{INV}, then @key{ENTER} to swap the two results.
--- 660,666 ----
``buttons'' using your left mouse button.
@noindent
! Click on @key{PI}, @key{2}, and @tfn{y^x}.
@noindent
Click on @key{INV}, then @key{ENTER} to swap the two results.
***************
*** 9071,9079 ****
@starindex
@end ignore
@tindex nterms
! If @expr{x} is the sum @expr{a + b}, then address@hidden(address@hidden@t{)}'
must
! be address@hidden(address@hidden@t{)}' plus
address@hidden(address@hidden@t{)}'. If @expr{x}
! is not a sum, then address@hidden(address@hidden@t{)}' = 1.
@smallexample
@group
--- 9068,9076 ----
@starindex
@end ignore
@tindex nterms
! If @expr{x} is the sum @expr{a + b}, then
address@hidden(address@hidden@tfn{)}' must
! be address@hidden(address@hidden@tfn{)}' plus
address@hidden(address@hidden@tfn{)}'. If @expr{x}
! is not a sum, then address@hidden(address@hidden@tfn{)}' = 1.
@smallexample
@group
***************
*** 10872,10879 ****
notation; @pxref{Complex Formats}.
Polar complex numbers are displayed in the form
! @texline address@hidden(address@hidden@t{;address@hidden@t{)}'
! @infoline address@hidden(address@hidden@t{;address@hidden@t{)}'
where @var{r} is the nonnegative magnitude and
@texline @math{\theta}
@infoline @var{theta}
--- 10869,10876 ----
notation; @pxref{Complex Formats}.
Polar complex numbers are displayed in the form
! @texline address@hidden(address@hidden@tfn{;address@hidden@tfn{)}'
! @infoline address@hidden(address@hidden@tfn{;address@hidden@tfn{)}'
where @var{r} is the nonnegative magnitude and
@texline @math{\theta}
@infoline @var{theta}
***************
*** 11290,11296 ****
A @dfn{modulo form} is a real number which is taken modulo (i.e., within
an integer multiple of) some value @var{M}. Arithmetic modulo @var{M}
often arises in number theory. Modulo forms are written
! address@hidden @t{mod} @var{M}',
where @var{a} and @var{M} are real numbers or HMS forms, and
@texline @math{0 \le a < M}.
@infoline @expr{0 <= a < @var{M}}.
--- 11287,11293 ----
A @dfn{modulo form} is a real number which is taken modulo (i.e., within
an integer multiple of) some value @var{M}. Arithmetic modulo @var{M}
often arises in number theory. Modulo forms are written
! address@hidden @tfn{mod} @var{M}',
where @var{a} and @var{M} are real numbers or HMS forms, and
@texline @math{0 \le a < M}.
@infoline @expr{0 <= a < @var{M}}.
***************
*** 11314,11328 ****
actually computing the power and then reducing.)
@cindex Modulo division
! Two modulo forms address@hidden @t{mod} @var{M}' and address@hidden @t{mod}
@var{M}'
can be divided if @expr{a}, @expr{b}, and @expr{M} are all
integers. The result is the modulo form which, when multiplied by
! address@hidden @t{mod} @var{M}', produces address@hidden @t{mod} @var{M}'. If
there is no solution to this equation (which can happen only when
@expr{M} is non-prime), or if any of the arguments are non-integers, the
division is left in symbolic form. Other operations, such as square
roots, are not yet supported for modulo forms. (Note that, although
! @address@hidden(address@hidden @t{mod} @address@hidden)^.5}'} will compute a
``modulo square root''
in the sense of reducing
@texline @math{\sqrt a}
@infoline @expr{sqrt(a)}
--- 11311,11325 ----
actually computing the power and then reducing.)
@cindex Modulo division
! Two modulo forms address@hidden @tfn{mod} @var{M}' and address@hidden
@tfn{mod} @var{M}'
can be divided if @expr{a}, @expr{b}, and @expr{M} are all
integers. The result is the modulo form which, when multiplied by
! address@hidden @tfn{mod} @var{M}', produces address@hidden @tfn{mod}
@var{M}'. If
there is no solution to this equation (which can happen only when
@expr{M} is non-prime), or if any of the arguments are non-integers, the
division is left in symbolic form. Other operations, such as square
roots, are not yet supported for modulo forms. (Note that, although
! @address@hidden(address@hidden @tfn{mod} @address@hidden)^.5}'} will compute
a ``modulo square root''
in the sense of reducing
@texline @math{\sqrt a}
@infoline @expr{sqrt(a)}
***************
*** 11374,11381 ****
@cindex Standard deviations
An @dfn{error form} is a number with an associated standard
deviation, as in @samp{2.3 +/- 0.12}. The notation
! @texline address@hidden @t{+/-} @math{\sigma}'
! @infoline address@hidden @t{+/-} sigma'
stands for an uncertain value which follows
a normal or Gaussian distribution of mean @expr{x} and standard
deviation or ``error''
--- 11371,11378 ----
@cindex Standard deviations
An @dfn{error form} is a number with an associated standard
deviation, as in @samp{2.3 +/- 0.12}. The notation
! @texline address@hidden @tfn{+/-} @math{\sigma}'
! @infoline address@hidden @tfn{+/-} sigma'
stands for an uncertain value which follows
a normal or Gaussian distribution of mean @expr{x} and standard
deviation or ``error''
***************
*** 11421,11431 ****
of standard deviations. Actual errors often are neither Gaussian-distributed
nor uncorrelated, and the above formulas are valid only when errors
are small. As an example, the error arising from
! @texline address@hidden(address@hidden @t{+/-} @address@hidden)}'
! @infoline address@hidden(address@hidden @t{+/-} @address@hidden)}'
is
! @texline address@hidden @t{abs(cos(address@hidden@t{))}'.
! @infoline address@hidden @t{abs(cos(address@hidden@t{))}'.
When @expr{x} is close to zero,
@texline @math{\cos x}
@infoline @expr{cos(x)}
--- 11418,11428 ----
of standard deviations. Actual errors often are neither Gaussian-distributed
nor uncorrelated, and the above formulas are valid only when errors
are small. As an example, the error arising from
! @texline address@hidden(address@hidden @tfn{+/-} @address@hidden)}'
! @infoline address@hidden(address@hidden @tfn{+/-} @address@hidden)}'
is
! @texline address@hidden @tfn{abs(cos(address@hidden@tfn{))}'.
! @infoline address@hidden @tfn{abs(cos(address@hidden@tfn{))}'.
When @expr{x} is close to zero,
@texline @math{\cos x}
@infoline @expr{cos(x)}
***************
*** 11557,11570 ****
While it may seem that intervals and error forms are similar, they are
based on entirely different concepts of inexact quantities. An error
form
! @texline address@hidden @t{+/-} @math{\sigma}'
! @infoline address@hidden @t{+/-} @var{sigma}'
means a variable is random, and its value could
be anything but is ``probably'' within one
@texline @math{\sigma}
@infoline @var{sigma}
of the mean value @expr{x}. An interval
! address@hidden@var{a} @t{..@:} @address@hidden' means a
variable's value is unknown, but guaranteed to lie in the specified
range. Error forms are statistical or ``average case'' approximations;
interval arithmetic tends to produce ``worst case'' bounds on an
--- 11554,11567 ----
While it may seem that intervals and error forms are similar, they are
based on entirely different concepts of inexact quantities. An error
form
! @texline address@hidden @tfn{+/-} @math{\sigma}'
! @infoline address@hidden @tfn{+/-} @var{sigma}'
means a variable is random, and its value could
be anything but is ``probably'' within one
@texline @math{\sigma}
@infoline @var{sigma}
of the mean value @expr{x}. An interval
! address@hidden@var{a} @tfn{..@:} @address@hidden' means a
variable's value is unknown, but guaranteed to lie in the specified
range. Error forms are statistical or ``average case'' approximations;
interval arithmetic tends to produce ``worst case'' bounds on an
***************
*** 12742,12750 ****
default simplifications for all formulas. This includes many easy and
fast algebraic simplifications such as @expr{a+0} to @expr{a}, and
@expr{a + 2 a} to @expr{3 a}, as well as evaluating functions like
! @texline @address@hidden(x^2,x)}
! @infoline @address@hidden(x^2, x)}
! to @expr{2 x}.
@kindex m B
@pindex calc-bin-simplify-mode
--- 12739,12745 ----
default simplifications for all formulas. This includes many easy and
fast algebraic simplifications such as @expr{a+0} to @expr{a}, and
@expr{a + 2 a} to @expr{3 a}, as well as evaluating functions like
! @address@hidden(x^2, x)} to @expr{2 x}.
@kindex m B
@pindex calc-bin-simplify-mode
***************
*** 16512,16518 ****
@cindex Fractional part of a number
To compute the fractional part of a number (i.e., the amount which, when
! added to address@hidden(address@hidden@t{)}', will produce @var{n}) just take
@var{n}
modulo 1 using the @code{%} command.
Note also the @kbd{\} (integer quotient), @kbd{f I} (integer logarithm),
--- 16507,16513 ----
@cindex Fractional part of a number
To compute the fractional part of a number (i.e., the amount which, when
! added to address@hidden(address@hidden@tfn{)}', will produce @var{n}) just
take @var{n}
modulo 1 using the @code{%} command.
Note also the @kbd{\} (integer quotient), @kbd{f I} (integer logarithm),
***************
*** 16539,16546 ****
The @kbd{G} (@code{calc-argument}) address@hidden command computes the
``argument'' or polar angle of a complex number. For a number in polar
notation, this is simply the second component of the pair
! @texline address@hidden(address@hidden@t{;address@hidden@t{)}'.
! @infoline address@hidden(address@hidden@t{;address@hidden@t{)}'.
The result is expressed according to the current angular mode and will
be in the range @mathit{-180} degrees (exclusive) to @mathit{+180} degrees
(inclusive), or the equivalent range in radians.
--- 16534,16541 ----
The @kbd{G} (@code{calc-argument}) address@hidden command computes the
``argument'' or polar angle of a complex number. For a number in polar
notation, this is simply the second component of the pair
! @texline address@hidden(address@hidden@tfn{;address@hidden@tfn{)}'.
! @infoline address@hidden(address@hidden@tfn{;address@hidden@tfn{)}'.
The result is expressed according to the current angular mode and will
be in the range @mathit{-180} degrees (exclusive) to @mathit{+180} degrees
(inclusive), or the equivalent range in radians.
***************
*** 18808,18814 ****
are both real numbers, the result uses a Gaussian distribution with mean
@var{m} and standard deviation
@texline @math{\sigma}.
! @var{s}.
If @expr{M} is an interval form, the lower and upper bounds specify the
acceptable limits of the random numbers. If both bounds are integers,
--- 18803,18809 ----
are both real numbers, the result uses a Gaussian distribution with mean
@var{m} and standard deviation
@texline @math{\sigma}.
! @infoline @var{s}.
If @expr{M} is an interval form, the lower and upper bounds specify the
acceptable limits of the random numbers. If both bounds are integers,
***************
*** 20488,20494 ****
weight is completely negligible.)
This function also works for distributions (error forms or
! intervals). The mean of an error form address@hidden @t{+/-} @var{b}' is
simply
@expr{a}. The mean of an interval is the mean of the minimum
and maximum values of the interval.
--- 20483,20489 ----
weight is completely negligible.)
This function also works for distributions (error forms or
! intervals). The mean of an error form address@hidden @tfn{+/-} @var{b}' is
simply
@expr{a}. The mean of an interval is the mean of the minimum
and maximum values of the interval.
***************
*** 22260,22276 ****
back on.
The most basic default simplification is the evaluation of functions.
! For example, @expr{2 + 3} is evaluated to @expr{5}, and @address@hidden(9)}
is evaluated to @expr{3}. Evaluation does not occur if the arguments
! to a function are somehow of the wrong type @address@hidden([2,3,4])}),
! range (@address@hidden(90)}), or number (@address@hidden(3,5)}),
! or if the function name is not recognized (@address@hidden(5)}), or if
Symbolic mode (@pxref{Symbolic Mode}) prevents evaluation
! (@address@hidden(2)}).
Calc simplifies (evaluates) the arguments to a function before it
! simplifies the function itself. Thus @address@hidden(5+4)} is
! simplified to @address@hidden(9)} before the @code{sqrt} function
itself is applied. There are very few exceptions to this rule:
@code{quote}, @code{lambda}, and @code{condition} (the @code{::}
operator) do not evaluate their arguments, @code{if} (the @code{? :}
--- 22255,22271 ----
back on.
The most basic default simplification is the evaluation of functions.
! For example, @expr{2 + 3} is evaluated to @expr{5}, and @address@hidden(9)}
is evaluated to @expr{3}. Evaluation does not occur if the arguments
! to a function are somehow of the wrong type @address@hidden([2,3,4])}),
! range (@address@hidden(90)}), or number (@address@hidden(3,5)}),
! or if the function name is not recognized (@address@hidden(5)}), or if
Symbolic mode (@pxref{Symbolic Mode}) prevents evaluation
! (@address@hidden(2)}).
Calc simplifies (evaluates) the arguments to a function before it
! simplifies the function itself. Thus @address@hidden(5+4)} is
! simplified to @address@hidden(9)} before the @code{sqrt} function
itself is applied. There are very few exceptions to this rule:
@code{quote}, @code{lambda}, and @code{condition} (the @code{::}
operator) do not evaluate their arguments, @code{if} (the @code{? :}
***************
*** 22395,22401 ****
@texline @math{x^{a+b}}
@infoline @expr{x^(a+b)}
where @expr{a} is a number, or an implicit 1 (as in @expr{x}),
! or the implicit one-half of @address@hidden(x)}, and similarly for
@expr{b}. The result is written using @samp{sqrt} or @samp{1/sqrt}
if the sum of the powers is @expr{1/2} or @expr{-1/2}, respectively.
If the sum of the powers is zero, the product is simplified to
--- 22390,22396 ----
@texline @math{x^{a+b}}
@infoline @expr{x^(a+b)}
where @expr{a} is a number, or an implicit 1 (as in @expr{x}),
! or the implicit one-half of @address@hidden(x)}, and similarly for
@expr{b}. The result is written using @samp{sqrt} or @samp{1/sqrt}
if the sum of the powers is @expr{1/2} or @expr{-1/2}, respectively.
If the sum of the powers is zero, the product is simplified to
***************
*** 22486,22505 ****
is not.) @xref{Declarations}, for ways to inform Calc that your
variables satisfy these requirements.
! As a special case of this rule, @address@hidden(x)^n} is simplified to
@texline @math{x^{n/2}}
@infoline @expr{x^(n/2)}
only for even integers @expr{n}.
If @expr{a} is known to be real, @expr{b} is an even integer, and
@expr{c} is a half- or quarter-integer, then @expr{(a^b)^c} is
! simplified to @address@hidden(a^(b c))}.
Also, @expr{(-a)^b} is simplified to @expr{a^b} if @expr{b} is an
even integer, or to @expr{-(a^b)} if @expr{b} is an odd integer,
for any negative-looking expression @expr{-a}.
! Square roots @address@hidden(x)} generally act like one-half powers
@texline @math{x^{1:2}}
@infoline @expr{x^1:2}
for the purposes of the above-listed simplifications.
--- 22481,22500 ----
is not.) @xref{Declarations}, for ways to inform Calc that your
variables satisfy these requirements.
! As a special case of this rule, @address@hidden(x)^n} is simplified to
@texline @math{x^{n/2}}
@infoline @expr{x^(n/2)}
only for even integers @expr{n}.
If @expr{a} is known to be real, @expr{b} is an even integer, and
@expr{c} is a half- or quarter-integer, then @expr{(a^b)^c} is
! simplified to @address@hidden(a^(b c))}.
Also, @expr{(-a)^b} is simplified to @expr{a^b} if @expr{b} is an
even integer, or to @expr{-(a^b)} if @expr{b} is an odd integer,
for any negative-looking expression @expr{-a}.
! Square roots @address@hidden(x)} generally act like one-half powers
@texline @math{x^{1:2}}
@infoline @expr{x^1:2}
for the purposes of the above-listed simplifications.
***************
*** 22510,22530 ****
is changed to
@texline @math{x^{-1:2}},
@infoline @expr{x^(-1:2)},
! but @expr{1 / @t{sqrt}(x)} is left alone.
@tex
\bigskip
@end tex
Generic identity matrices (@pxref{Matrix Mode}) are simplified by the
! following rules: @address@hidden(a) + b} to @expr{a + b} if @expr{b}
is provably scalar, or expanded out if @expr{b} is a matrix;
! @address@hidden(a) + @t{idn}(b)} to @address@hidden(a + b)};
! @address@hidden(a)} to @address@hidden(-a)}; @expr{a @t{idn}(b)} to
! @address@hidden(a b)} if @expr{a} is provably scalar, or to @expr{a b}
! if @expr{a} is provably non-scalar; @address@hidden(a) @t{idn}(b)} to
! @address@hidden(a b)}; analogous simplifications for quotients involving
! @code{idn}; and @address@hidden(a)^n} to @address@hidden(a^n)} where
@expr{n} is an integer.
@tex
--- 22505,22525 ----
is changed to
@texline @math{x^{-1:2}},
@infoline @expr{x^(-1:2)},
! but @expr{1 / @tfn{sqrt}(x)} is left alone.
@tex
\bigskip
@end tex
Generic identity matrices (@pxref{Matrix Mode}) are simplified by the
! following rules: @address@hidden(a) + b} to @expr{a + b} if @expr{b}
is provably scalar, or expanded out if @expr{b} is a matrix;
! @address@hidden(a) + @tfn{idn}(b)} to @address@hidden(a + b)};
! @address@hidden(a)} to @address@hidden(-a)}; @expr{a @tfn{idn}(b)} to
! @address@hidden(a b)} if @expr{a} is provably scalar, or to @expr{a b}
! if @expr{a} is provably non-scalar; @address@hidden(a) @tfn{idn}(b)} to
! @address@hidden(a b)}; analogous simplifications for quotients involving
! @code{idn}; and @address@hidden(a)^n} to @address@hidden(a^n)} where
@expr{n} is an integer.
@tex
***************
*** 22533,22559 ****
The @code{floor} function and other integer truncation functions
vanish if the argument is provably integer-valued, so that
! @address@hidden(@t{round}(x))} simplifies to @address@hidden(x)}.
Also, combinations of @code{float}, @code{floor} and its friends,
and @code{ffloor} and its friends, are simplified in appropriate
ways. @xref{Integer Truncation}.
! The expression @address@hidden(-x)} changes to @address@hidden(x)}.
! The expression @address@hidden(@t{abs}(x))} changes to
! @address@hidden(x)}; in fact, @address@hidden(x)} changes to @expr{x} or
@expr{-x} if @expr{x} is provably nonnegative or nonpositive
(@pxref{Declarations}).
While most functions do not recognize the variable @code{i} as an
imaginary number, the @code{arg} function does handle the two cases
! @address@hidden(@t{i})} and @address@hidden(address@hidden)} just for
convenience.
! The expression @address@hidden(@t{conj}(x))} simplifies to @expr{x}.
Various other expressions involving @code{conj}, @code{re}, and
@code{im} are simplified, especially if some of the arguments are
provably real or involve the constant @code{i}. For example,
! @address@hidden(a + b i)} is changed to
! @address@hidden(a) - @t{conj}(b) i}, or to @expr{a - b i} if @expr{a}
and @expr{b} are known to be real.
Functions like @code{sin} and @code{arctan} generally don't have
--- 22528,22554 ----
The @code{floor} function and other integer truncation functions
vanish if the argument is provably integer-valued, so that
! @address@hidden(@tfn{round}(x))} simplifies to @address@hidden(x)}.
Also, combinations of @code{float}, @code{floor} and its friends,
and @code{ffloor} and its friends, are simplified in appropriate
ways. @xref{Integer Truncation}.
! The expression @address@hidden(-x)} changes to @address@hidden(x)}.
! The expression @address@hidden(@tfn{abs}(x))} changes to
! @address@hidden(x)}; in fact, @address@hidden(x)} changes to @expr{x} or
@expr{-x} if @expr{x} is provably nonnegative or nonpositive
(@pxref{Declarations}).
While most functions do not recognize the variable @code{i} as an
imaginary number, the @code{arg} function does handle the two cases
! @address@hidden(@tfn{i})} and @address@hidden(address@hidden)} just for
convenience.
! The expression @address@hidden(@tfn{conj}(x))} simplifies to @expr{x}.
Various other expressions involving @code{conj}, @code{re}, and
@code{im} are simplified, especially if some of the arguments are
provably real or involve the constant @code{i}. For example,
! @address@hidden(a + b i)} is changed to
! @address@hidden(a) - @tfn{conj}(b) i}, or to @expr{a - b i} if @expr{a}
and @expr{b} are known to be real.
Functions like @code{sin} and @code{arctan} generally don't have
***************
*** 22563,22575 ****
these functions, though.
One important simplification that does occur is that
! @address@hidden(@t{e})} is simplified to 1, and @address@hidden(@t{e}^x)} is
simplified to @expr{x} for any @expr{x}. This occurs even if you have
stored a different value in the Calc variable @samp{e}; but this would
be a bad idea in any case if you were also using natural logarithms!
! Among the logical functions, @t{(@var{a} <= @var{b})} changes to
! @address@hidden > @var{b}} and so on. Equations and inequalities where both
sides
are either negative-looking or zero are simplified by negating both sides
and reversing the inequality. While it might seem reasonable to simplify
@expr{!!x} to @expr{x}, this would not be valid in general because
--- 22558,22570 ----
these functions, though.
One important simplification that does occur is that
! @address@hidden(@tfn{e})} is simplified to 1, and @address@hidden(@tfn{e}^x)}
is
simplified to @expr{x} for any @expr{x}. This occurs even if you have
stored a different value in the Calc variable @samp{e}; but this would
be a bad idea in any case if you were also using natural logarithms!
! Among the logical functions, @tfn{(@var{a} <= @var{b})} changes to
! @address@hidden > @var{b}} and so on. Equations and inequalities where both
sides
are either negative-looking or zero are simplified by negating both sides
and reversing the inequality. While it might seem reasonable to simplify
@expr{!!x} to @expr{x}, this would not be valid in general because
***************
*** 22693,22709 ****
Square roots of integer or rational arguments are simplified in
several ways. (Note that these will be left unevaluated only in
Symbolic mode.) First, square integer or rational factors are
! pulled out so that @address@hidden(8)} is rewritten as
! @texline @math{2\,\t{sqrt}(2)}.
@infoline @expr{2 sqrt(2)}.
Conceptually speaking this implies factoring the argument into primes
and moving pairs of primes out of the square root, but for reasons of
efficiency Calc only looks for primes up to 29.
Square roots in the denominator of a quotient are moved to the
! numerator: @expr{1 / @t{sqrt}(3)} changes to @address@hidden(3) / 3}.
The same effect occurs for the square root of a fraction:
! @address@hidden(2:3)} changes to @address@hidden(6) / 3}.
@tex
\bigskip
--- 22688,22704 ----
Square roots of integer or rational arguments are simplified in
several ways. (Note that these will be left unevaluated only in
Symbolic mode.) First, square integer or rational factors are
! pulled out so that @address@hidden(8)} is rewritten as
! @texline @math{2\,@tfn{sqrt}(2)}.
@infoline @expr{2 sqrt(2)}.
Conceptually speaking this implies factoring the argument into primes
and moving pairs of primes out of the square root, but for reasons of
efficiency Calc only looks for primes up to 29.
Square roots in the denominator of a quotient are moved to the
! numerator: @expr{1 / @tfn{sqrt}(3)} changes to @address@hidden(3) / 3}.
The same effect occurs for the square root of a fraction:
! @address@hidden(2:3)} changes to @address@hidden(6) / 3}.
@tex
\bigskip
***************
*** 22736,22751 ****
@end tex
Trigonometric functions are simplified in several ways. First,
! @address@hidden(@t{arcsin}(x))} is simplified to @expr{x}, and
similarly for @code{cos} and @code{tan}. If the argument to
@code{sin} is negative-looking, it is simplified to
! @address@hidden(x),}, and similarly for @code{cos} and @code{tan}.
Finally, certain special values of the argument are recognized;
@pxref{Trigonometric and Hyperbolic Functions}.
Trigonometric functions of inverses of different trigonometric
! functions can also be simplified, as in @address@hidden(@t{arccos}(x))}
! to @address@hidden(1 - x^2)}.
Hyperbolic functions of their inverses and of negative-looking
arguments are also handled, as are exponentials of inverse
--- 22731,22746 ----
@end tex
Trigonometric functions are simplified in several ways. First,
! @address@hidden(@tfn{arcsin}(x))} is simplified to @expr{x}, and
similarly for @code{cos} and @code{tan}. If the argument to
@code{sin} is negative-looking, it is simplified to
! @address@hidden(x),}, and similarly for @code{cos} and @code{tan}.
Finally, certain special values of the argument are recognized;
@pxref{Trigonometric and Hyperbolic Functions}.
Trigonometric functions of inverses of different trigonometric
! functions can also be simplified, as in @address@hidden(@tfn{arccos}(x))}
! to @address@hidden(1 - x^2)}.
Hyperbolic functions of their inverses and of negative-looking
arguments are also handled, as are exponentials of inverse
***************
*** 22754,22782 ****
No simplifications for inverse trigonometric and hyperbolic
functions are known, except for negative arguments of @code{arcsin},
@code{arctan}, @code{arcsinh}, and @code{arctanh}. Note that
! @address@hidden(@t{sin}(x))} can @emph{not} safely change to
@expr{x}, since this only correct within an integer multiple of
@texline @math{2 \pi}
@infoline @expr{2 pi}
! radians or 360 degrees. However, @address@hidden(@t{sinh}(x))} is
simplified to @expr{x} if @expr{x} is known to be real.
Several simplifications that apply to logarithms and exponentials
! are that @address@hidden(@t{ln}(x))},
! @texline @address@hidden(x)}},
! @infoline @address@hidden(x)},
and
@texline @math{10^{{\rm log10}(x)}}
! @infoline @address@hidden(x)}
! all reduce to @expr{x}. Also, @address@hidden(@t{exp}(x))}, etc., can
reduce to @expr{x} if @expr{x} is provably real. The form
! @address@hidden(x)^y} is simplified to @address@hidden(x y)}. If @expr{x}
is a suitable multiple of
@texline @math{\pi i}
@infoline @expr{pi i}
(as described above for the trigonometric functions), then
! @address@hidden(x)} or @expr{e^x} will be expanded. Finally,
! @address@hidden(x)} is simplified to a form involving @code{pi} and
@code{i} where @expr{x} is provably negative, positive imaginary, or
negative imaginary.
--- 22749,22777 ----
No simplifications for inverse trigonometric and hyperbolic
functions are known, except for negative arguments of @code{arcsin},
@code{arctan}, @code{arcsinh}, and @code{arctanh}. Note that
! @address@hidden(@tfn{sin}(x))} can @emph{not} safely change to
@expr{x}, since this only correct within an integer multiple of
@texline @math{2 \pi}
@infoline @expr{2 pi}
! radians or 360 degrees. However, @address@hidden(@tfn{sinh}(x))} is
simplified to @expr{x} if @expr{x} is known to be real.
Several simplifications that apply to logarithms and exponentials
! are that @address@hidden(@tfn{ln}(x))},
! @texline @address@hidden(x)}},
! @infoline @address@hidden(x)},
and
@texline @math{10^{{\rm log10}(x)}}
! @infoline @address@hidden(x)}
! all reduce to @expr{x}. Also, @address@hidden(@tfn{exp}(x))}, etc., can
reduce to @expr{x} if @expr{x} is provably real. The form
! @address@hidden(x)^y} is simplified to @address@hidden(x y)}. If @expr{x}
is a suitable multiple of
@texline @math{\pi i}
@infoline @expr{pi i}
(as described above for the trigonometric functions), then
! @address@hidden(x)} or @expr{e^x} will be expanded. Finally,
! @address@hidden(x)} is simplified to a form involving @code{pi} and
@code{i} where @expr{x} is provably negative, positive imaginary, or
negative imaginary.
***************
*** 22848,22856 ****
Inverse trigonometric or hyperbolic functions, called with their
corresponding non-inverse functions as arguments, are simplified
! by @kbd{a e}. For example, @address@hidden(@t{sin}(x))} changes
! to @expr{x}. Also, @address@hidden(@t{cos}(x))} and
! @address@hidden(@t{sin}(x))} both change to @address@hidden/2 - x}.
These simplifications are unsafe because they are valid only for
values of @expr{x} in a certain range; outside that range, values
are folded down to the 360-degree range that the inverse trigonometric
--- 22843,22851 ----
Inverse trigonometric or hyperbolic functions, called with their
corresponding non-inverse functions as arguments, are simplified
! by @kbd{a e}. For example, @address@hidden(@tfn{sin}(x))} changes
! to @expr{x}. Also, @address@hidden(@tfn{cos}(x))} and
! @address@hidden(@tfn{sin}(x))} both change to @address@hidden/2 - x}.
These simplifications are unsafe because they are valid only for
values of @expr{x} in a certain range; outside that range, values
are folded down to the 360-degree range that the inverse trigonometric
***************
*** 22866,22887 ****
the powers cancel to get @expr{x}, which is valid for positive values
of @expr{x} but not for negative or complex values.
! Similarly, @address@hidden(x^a)} and @address@hidden(x)^a} are both
simplified (possibly unsafely) to
@texline @math{x^{a/2}}.
@infoline @expr{x^(a/2)}.
! Forms like @address@hidden(1 - sin(x)^2)} are simplified to, e.g.,
! @address@hidden(x)}. Calc has identities of this sort for @code{sin},
@code{cos}, @code{tan}, @code{sinh}, and @code{cosh}.
Arguments of square roots are partially factored to look for
squared terms that can be extracted. For example,
! @address@hidden(a^2 b^3 + a^3 b^2)} simplifies to
! @expr{a b @t{sqrt}(a+b)}.
! The simplifications of @address@hidden(@t{exp}(x))},
! @address@hidden(@t{e}^x)}, and @address@hidden(10^x)} to @expr{x} are also
unsafe because of problems with principal values (although these
simplifications are safe if @expr{x} is known to be real).
--- 22861,22882 ----
the powers cancel to get @expr{x}, which is valid for positive values
of @expr{x} but not for negative or complex values.
! Similarly, @address@hidden(x^a)} and @address@hidden(x)^a} are both
simplified (possibly unsafely) to
@texline @math{x^{a/2}}.
@infoline @expr{x^(a/2)}.
! Forms like @address@hidden(1 - sin(x)^2)} are simplified to, e.g.,
! @address@hidden(x)}. Calc has identities of this sort for @code{sin},
@code{cos}, @code{tan}, @code{sinh}, and @code{cosh}.
Arguments of square roots are partially factored to look for
squared terms that can be extracted. For example,
! @address@hidden(a^2 b^3 + a^3 b^2)} simplifies to
! @expr{a b @tfn{sqrt}(a+b)}.
! The simplifications of @address@hidden(@tfn{exp}(x))},
! @address@hidden(@tfn{e}^x)}, and @address@hidden(10^x)} to @expr{x} are also
unsafe because of problems with principal values (although these
simplifications are safe if @expr{x} is known to be real).
***************
*** 24433,24440 ****
or all be plain numbers. Error forms can go anywhere but generally
go on the numbers in the last row of the data matrix. If the last
row contains error forms
! @texline address@hidden@w{ @t{+/-} address@hidden',
! @infoline address@hidden@w{ @t{+/-} address@hidden',
then the
@texline @math{\chi^2}
@infoline @expr{chi^2}
--- 24428,24435 ----
or all be plain numbers. Error forms can go anywhere but generally
go on the numbers in the last row of the data matrix. If the last
row contains error forms
! @texline address@hidden@w{ @tfn{+/-} address@hidden',
! @infoline address@hidden@w{ @tfn{+/-} address@hidden',
then the
@texline @math{\chi^2}
@infoline @expr{chi^2}
***************
*** 24586,24602 ****
@item 2-9
Polynomials. @mathit{a + b x + c x^2 + d x^3}.
@item e
! Exponential. @mathit{a} @address@hidden(b x)} @address@hidden(c y)}.
@item E
! Base-10 exponential. @mathit{a} @address@hidden(b x)} @address@hidden(c y)}.
@item x
! Exponential (alternate notation). @address@hidden(a + b x + c y)}.
@item X
! Base-10 exponential (alternate). @address@hidden(a + b x + c y)}.
@item l
! Logarithmic. @mathit{a + b} @address@hidden(x) + c} @address@hidden(y)}.
@item L
! Base-10 logarithmic. @mathit{a + b} @address@hidden(x) + c}
@address@hidden(y)}.
@item ^
General exponential. @mathit{a b^x c^y}.
@item p
--- 24581,24597 ----
@item 2-9
Polynomials. @mathit{a + b x + c x^2 + d x^3}.
@item e
! Exponential. @mathit{a} @address@hidden(b x)} @address@hidden(c y)}.
@item E
! Base-10 exponential. @mathit{a} @address@hidden(b x)} @address@hidden(c y)}.
@item x
! Exponential (alternate notation). @address@hidden(a + b x + c y)}.
@item X
! Base-10 exponential (alternate). @address@hidden(a + b x + c y)}.
@item l
! Logarithmic. @mathit{a + b} @address@hidden(x) + c} @address@hidden(y)}.
@item L
! Base-10 logarithmic. @mathit{a + b} @address@hidden(x) + c}
@address@hidden(y)}.
@item ^
General exponential. @mathit{a b^x c^y}.
@item p
***************
*** 34783,34789 ****
@r{ @: . @:number @: @:@:0.number}
@r{ @: _ @:number @: @:-@:number}
@r{ @: e @:number @: @:@:1e number}
! @r{ @: # @:number @: @:@:address@hidden
@r{ @: P @:(in number) @: @:+/-@:}
@r{ @: M @:(in number) @: @:mod@:}
@r{ @: @@ ' " @: (in number)@: @:@:HMS form}
--- 34778,34784 ----
@r{ @: . @:number @: @:@:0.number}
@r{ @: _ @:number @: @:-@:number}
@r{ @: e @:number @: @:@:1e number}
! @r{ @: # @:number @: @:@:address@hidden
@r{ @: P @:(in number) @: @:+/-@:}
@r{ @: M @:(in number) @: @:mod@:}
@r{ @: @@ ' " @: (in number)@: @:@:HMS form}
***************
*** 35343,35350 ****
@r{ @: s & @:var @: 29,47 @:calc-store-inv@: (v^-1)}
@r{ @: s [ @:var @: 29,47 @:calc-store-decr@: (v-1)}
@r{ @: s ] @:var @: 29,47 @:calc-store-incr@:
(v-(-1))}
! @r{ a b@: s : @: @: 2 @:assign@:(a,b) a @t{:=} b}
! @r{ a@: s = @: @: 1 @:evalto@:(a,b) a @t{=>}}
@c
@r{ @: t [ @: @: 4 @:calc-trail-first@:}
--- 35338,35345 ----
@r{ @: s & @:var @: 29,47 @:calc-store-inv@: (v^-1)}
@r{ @: s [ @:var @: 29,47 @:calc-store-decr@: (v-1)}
@r{ @: s ] @:var @: 29,47 @:calc-store-incr@:
(v-(-1))}
! @r{ a b@: s : @: @: 2 @:assign@:(a,b) a @tfn{:=}
b}
! @r{ a@: s = @: @: 1 @:evalto@:(a,b) a @tfn{=>}}
@c
@r{ @: t [ @: @: 4 @:calc-trail-first@:}