Calculator
Calculator
2022/09/15
                                                   Abstract
            The calculator package allows us to use LATEX as a calculator, with which we can perform
        many of the common scientific calculations (with the limitation in accuracy imposed by the
        TEX arithmetic).
            This package introduces several new instructions that allow you to do several calculations
        with integer and decimal numbers using LATEX. Apart from add, multiply or divide, we can
        calculate powers, square roots, logarithms, trigonometric and hyperbolic functions . . .
            In addition, the calculator package supports some elementary calculations with vectors
        in two and three dimensions and square 2 × 2 and 3 × 3 matrices.
            The calculus package adds to the calculator package several utilities to use and define
        various functions and their derivatives, including elementary functions, operations with
        functions, polar coordinates and vector-valued real functions.
            Version 2.0 adds new capabilities to both packages. Specifically, now, calculator and
        calculus can evaluate the inverse trigonometric and the inverse hyperbolic functions (so that
        we can work with all the classic elementary functions), and also can do some additional
        calculation with vectors (such as the cross product and the angle between two vectors).
            Version 2.1 fixes some bugs and calculation problems.1
Contents
1      Introduction
The calculator package defines some instructions which allow us to realize algebraic operations
(and to evaluate elementary functions) in our documents. The operations implemented by the
calculator package include routines of assignment of variables, arithmetical calculations with
real and integer numbers, two and three dimensional vector and matrix arithmetics and the
computation of square roots, trigonometrical, exponential,
                                               √           logarithmic and hyperbolic functions.
In addition, some important numbers, such as 2, π or e, are predefined.
    ∗ This   document corresponds to calculator v.2.1 and calculus v.2.1, dated 2022/09/15.
    1 Thanks   to Schmitz Manuel, Thorsten Wolterin, Jim Cline, Schremmer Alain and July Tikhonov.
                                                       1
    The name of all these commands is spelled in capital letters (with very few exceptions: the
commands \DEGtoRAD and \RADtoDEG and the control sequences that define special numbers,
as \numberPI) and, in general, they all need one or more mandatory arguments, the first one(s)
of which is(are) number(s) and the last one(s) is(are) the name(s) of the command(s) where the
results will be stored.2 The new commands defined in this way work in any LATEX mode.
    By example, this instruction
    \MAX{3}{5}{\solution}
Observe that, in this example, we have followed exactly the same steps that we would do to
           2.52
calculate √  12
                + e3.4 with a standard calculator: We would calculate the square, the root and
the exponential and, finally, we would divide and add the results.
    It does not matter if the arguments results are or not predefined. But these commands act
as declarations, so that its scope is local in environments and groups.
  2 Logically,   the control sequences that represent special numbers (as \numberPI) does not need any argument.
                                                        2
Ex. 2                                                \SQUARE{5}\sol
                                                     The \texttt{\textbackslash sol}
  The \sol command contains the square               command contains the square of $5$:
of 5:                                                \[5^2=\sol\]
               52 = 25                               \begin{center}
                                                     \SQUAREROOT{5}\sol
    Now, the \sol command is the square              Now, the \texttt{\textbackslash sol}
                 root of 5:                          command is the square root of $5$:
                                                     \[\sqrt{5}=\sol\]
               √
                 5 = 2.23605                         \end{center}
                                                     On having gone out of the \texttt{center}
On having gone out of the center environ-            environment,
ment, the command recovers its previous              the command recovers its previous value:
                                                     \sol
value: 25
    The calculus package goes a step further and allows us to define and use in a user-friendly
manner various functions and their derivatives.
    For exemple, using the calculus package, you can define the f (t) = t2 et − cos 2t function as
follows:
%       \PRODUCTfunction{\SQUAREfunction}{\EXPfunction}{\tempfunctionA}
%       \SCALEVARIABLEfunction{2}{\COSfunction}{\tempfunctionB}
%       \SUBTRACTfunction{\tempfunctionA}{\tempfunctionB}{\Ffunction}
     Then you cau compute any value of the new function \Ffunction and its derivative: typing
       \Ffunction{hnumi}{h\sol i}{h\Dsol i}
the values of f (num) and f 0 (num) will be stored in \sol and \Dsol .
Part I
The calculator package
2      Predefined numbers
The calculator package predefines the following numbers:
      \numberPI               3.14159 ≈ π           \numberHALFPI         1.57079 ≈ π/2
      \numberTHREEHALFPI      4.71237 ≈ 3π/2        \numberTHIRDPI        1.0472 ≈ π/3
      \numberQUARTERPI        0.78539 ≈ π/4         \numberFIFTHPI        0.62831 ≈ π/5
      \numberSIXTHPI          0.52359 ≈ π/6         \numberTWOPI          6.28317 ≈ 2π
      \numberE                2.71828 ≈ e           \numberINVE           0.36787 ≈ 1/e
      \numberETWO             7.38902 ≈ e2          \numberINVETWO        0.13533 ≈ 1/e2
      \numberLOGTEN           2.30258 ≈ log 10
      \numberGOLD             1.61803 ≈ φ
                                        √           \numberINVGOLD        0.61803 ≈ 1/φ
                                                                                    √
      \numberSQRTTWO          1.41421 ≈ √2          \numberSQRTTHREE      1.73205 ≈ 3
      \numberSQRTFIVE         2.23607 ≈ 5
      \numberCOSXXX           0.86603 ≈ cos π/6     \numberCOSXLV         0.70711 ≈ cos π/4
                                                3
3       Operations with numbers
3.1     Assignments and comparisons
The first command we describe here is used to store a number in a control sequence. The other
two commands in this section determine the maximum and minimum of a pair of numbers.
\COPY{hnumi}{h\cmd i} stores the number num to the command \cmd .
        Ex. 3                                        \COPY{-1.256}{\sol}
                                                     \sol
         -1.256
\MAX{hnum1 i}{hnum2 i}{h\cmd i} stores in \cmd the maximum of the numbers num1 and
     num2 .
        Ex. 4                                        \MAX{1.256}{3.214}{\sol}
                                                     \[\max(1.256,3.214)=\sol\]
\MIN{hnum1 i}{hnum2 i}{h\cmd i} stores in \cmd the minimum of num1 and num2 .
        Ex. 5                                        \MIN{1.256}{3.214}{\sol}
                                                     \sol
         1.256
        Ex. 6                                        \ADD{1.256}{3.214}{\sol}
                                                     $1.256+3.214=\sol$
         1.256 + 3.214 = 4.47
        Ex. 7                                        \SUBTRACT{1.256}{3.214}{\sol}
                                                     $1.256-3.214=\sol$
         1.256 − 3.214 = −1.95801
                                             4
\MULTIPLY{hnum1 i}{hnum2 i}{h\cmd i} Product num1 ×num2 .
        Ex. 8                                                   \MULTIPLY{1.256}{3.214}{\sol}
                                                                $1.256\times3.214=\sol$
           1.256 × 3.214 = 4.03677
        Ex. 9                                                   \DIVIDE{1.256}{3.214}{\sol}
                                                                $1.256/3.214=\sol$
           1.256/3.214 = 0.39078
        Ex. 10                                                  \SQUARE{-1.256}{\sol}
                                                                $(-1.256)^2=\sol$
           (−1.256)2 = 1.57751
        Ex. 11                                                  \CUBE{-1.256}{\sol}
                                                                $(-1.256)^3=\sol$
           (−1.256)3 = −1.98134
        Ex. 12                                                  \POWER{-1.256}{-5}{\sola}
                                                                \POWER{-1.256}{5}{\solb}
                                                                \POWER{-1.256}{0}{\solc}
                  (−1.256)−5 = −0.31989                         \[
                                                                \begin{aligned}
                   (−1.256)5 = −3.1256
                                                                (-1.256)^{-5}&=\sola
                   (−1.256)0 = 1                                \\
                                                                (-1.256)^{5}&=\solb
                                                                \\
                                                                (-1.256)^{0}&=\solc
                                                                \end{aligned}
                                                                \]
3 This command uses a modified version of the division algorithm of Claudio Beccari.
                                                       5
3.2.3      Absolute value, integer part and fractional part
\ABSVALUE{hnumi}{h\cmd i} Absolute value of num .
        Ex. 13                                                \ABSVALUE{-1.256}{\sol}
                                                              $\left\vert-1.256\right\vert=\sol$
           |−1.256| = 1.256
        Ex. 14                                                \INTEGERPART{1.256}{\sola}
                                                              \INTEGERPART{-1.256}{\solb}
          The integer part of 1.256 is 1, but the             The integer part of $1.256$ is $\sola$,
        integer part of −1.256 is −2.                         but the integer part of $-1.256$ is $\solb$.
        Ex. 15                                                \FLOOR{1.256}{\sol}
                                                              The integer part of $1.256$ is $\sol$.
           The integer part of 1.256 is 1.
        Ex. 16                                                \FRACTIONALPART{1.256}{\sol}
                                                              \sol
           0.256
           0.744                                              \FRACTIONALPART{-1.256}{\sol}
                                                              \sol
        Ex. 17                                                \TRUNCATE[0]{1.25688}{\sol}
                                                              \sol
           1
           1.25                                               \TRUNCATE[2]{1.25688}{\sol}
           1.2568                                             \sol
                                                              \TRUNCATE[4]{1.25688}{\sol}
                                                              \sol
  4 The integer part of x is the largest integer that is less than or equal to x.
  5 code modified in version 2.1 (thanks to July Tikhonov who reported a bug and suggested the solution).
  6 code modified in version 2.1 (thanks to Jim Cline and Schremmer Alain who reported a bug).
  7 Note than \TRUNCATE[0] is equivalent to \INTEGERPART only for non-negative numbers.
                                                     6
        Ex. 18                                                 \ROUND[0]{1.25688}{\sol}
                                                               \sol
         1
         1.26                                                  \ROUND[2]{1.25688}{\sol}
         1.2569                                                \sol
                                                               \ROUND[4]{1.25688}{\sol}
                                                               \sol
3.3     Integers
The operations described here are subject to the same restrictions as those referring to decimal
numbers. In particular, although TEX does not have this restriction in its integer arithmetic,
the largest integer that can be used is 16383.
        Ex. 19                                                 \INTEGERDIVISION{435}{27}{\sola}{\solb}
                                                               $435=27\times\sola+\solb$
         435 = 27 × 16 + 3
         27 = 435 × 0 + 27                                     \INTEGERDIVISION{27}{435}{\sola}{\solb}
         −435 = 27 × (−17) + 24                                $27=435\times\sola+\solb$
         435 = −27 × (−16) + 3
                                                               \INTEGERDIVISION{-435}{27}{\sola}{\solb}
         −435 = −27 × 17 + 24                                  $-435=27\times(\sola)+\solb$
                                                               \INTEGERDIVISION{435}{-27}{\sola}{\solb}
                                                               $435=-27\times(\sola)+\solb$
                                                               \INTEGERDIVISION{-435}{-27}{\sola}{\solb}
                                                               $-435=-27\times\sola+\solb$
negative residue —especially when the divisor is negative—. However, the most reasonable definition of integer
quotient is this one: the quotient of the division D/d is the largest number q for which dq ≤ D. With this
definition, the remainder r = D − qd is a non-negative number.
                                                      7
        Ex. 20                                    \INTEGERQUOTIENT{435}{27}{\sol}
                                                  \sol
         16
         0                                        \INTEGERQUOTIENT{27}{435}{\sol}
         -17                                      \sol
                                                  \INTEGERQUOTIENT{-43.5}{2.7}{\sol}
                                                  \sol
\MODULO{hnum1 i}{hnum2 i}{h\cmd i} Remainder of the integer division of num1 and num2 .
        Ex. 21                                    \MODULO{435}{27}{\sol}
                                                  \[
                                                  435 \equiv \sol \pmod{27}
                  435 ≡ 3    (mod 27)             \]
                                                  \MODULO{-435}{27}{\sol}
                 −435 ≡ 24     (mod 27)           \[
                                                  -435 \equiv \sol \pmod{27}
                                                  \]
        Ex. 22                                    \GCD{435}{27}{\sol}
                                                  $\gcd(435,27)=\sol$
         gcd(435, 27) = 3
        Ex. 23                                    \newcommand{\lcm}{\operatorname{lcm}}
                                                  \LCM{435}{27}{\sol}
         lcm(435, 27) = 3915                      $\lcm(435,27)=\sol$
        Ex. 24                                    \FRACTIONSIMPLIFY{435}{27}{\sola}{\solb}
                                                  $435/27=\sola/\solb$
         435/27 = 145/9
                                           8
3.4      Elementary functions
3.4.1       Square roots
\SQUAREROOT {hnumi}{h\cmd i} Square root of the number num .
        Ex. 25                                                   \SQUAREROOT{1.44}{\sol}
                                                                 $\sqrt{1.44}=\sol$
         √
             1.44 = 1.2
        Ex. 26                                                   \EXP{0.5}{\sol}
                                                                 $\exp(0.5)=\sol$
         exp(0.5) = 1.64871
                                                                             9
        The argument num must be in the interval [−9.704, 9.704].
        Moreover, the \EXP command accepts an optional argument, to compute expressions such
        as ax :
\EXP [hnum1 i]{hnum2 i}{h\cmd i} Exponential with base num1 of num2 . num1 must be a
     positive number.
        Ex. 27                                                   \EXP[10]{1.3}{\sol}
                                                                 $10^{1.3}=\sol$
         101.3 = 19.95209
         21/3 = 1.25989                                          \EXP[2]{0.33333}{\sol}
                                                                 $2^{1/3}=\sol$
        Ex. 28                                                   \LOG{0.5}{\sol}
                                                                 $\log 0.5=\sol$
         log 0.5 = −0.69315
9 9.704 is the logarithm of 16383, the largest number that supports the TEX’s arithmetic.
                                                        9
\LOG [hnum1 i]{hnum2 i}{h\cmd i} Logarithm in base num1 of num2 .
        Ex. 29                                         \LOG[10]{0.5}{\sol}
                                                       $\log_{10} 0.5=\sol$
         log10 0.5 = −0.30103
        Ex. 30                                         \SIN{\numberTHIRDPI}{\sol}
                                                       $\sin \pi/3=\sol$
         sin π/3 = 0.86601
         cos π/3 = 0.5                                 \COS{\numberTHIRDPI}{\sol}
         tan π/3 = 1.73201                             $\cos \pi/3=\sol$
         cot π/3 = 0.57736
                                                       \TAN{\numberTHIRDPI}{\sol}
                                                       $\tan \pi/3=\sol$
                                                       \COT{\numberTHIRDPI}{\sol}
                                                       $\cot \pi/3=\sol$
        Ex. 31                                         \DEGREESSIN{60}{\sol}
                                                       $\sin 60^{\textrm o}=\sol$
         sin 60o = 0.86601
         cos 60o = 0.49998                             \DEGREESCOS{60}{\sol}
         tan 60o = 1.73201                             $\cos 60^{\textrm o}=\sol$
         cot 60o = 0.57736
                                                       \DEGREESTAN{60}{\sol}
                                                       $\tan 60^{\textrm o}=\sol$
                                                       \DEGREESCOT{60}{\sol}
                                                       $\cot 60^{\textrm o}=\sol$
                                               10
   The latter commands support an optional argument that allows us to divide the circle in an
arbitrary number of degrees (not necessarily 360).
\DEGREESSIN [hdegreesi]{hnumi}{h\cmd i}
\DEGREESCOS [hdegreesi]{hnumi}{h\cmd i}
\DEGREESTAN [hdegreesi]{hnumi}{h\cmd i}
\DEGREESCOT [hdegreesi]{hnumi}{h\cmd i}
   By example, \DEGREESCOS[400]{50} computes the cosine of 50 gradians (a right angle has
100 gradians, the whole circle has 400 gradians), which are equivalent to 45 (sexagesimal) degrees
or π/4 radians. Or to 1 degree, if we divide the circle into 8 parts!
Ex. 32                                               \DEGREESCOS[400]{50}{\sol}
                                                     \sol
  0.70709
  0.70709                                            \DEGREESCOS{45}{\sol}
  0.7071                                             \sol
  0.70709
                                                     \COS{\numberQUARTERPI}{\sol}
                                                     \sol
                                                     \DEGREESCOS[8]{1}{\sol}
                                                     \sol
      Ex. 33                                            \DEGtoRAD{60}{\sol}
                                                        \sol
         1.0472
      Ex. 34                                            \MULTIPLY{\numberTWOPI}{10}{\TWENTYPI}
                                                        \ADD{\numberPI}{\TWENTYPI}{\TWENTYONEPI}
         3.14159                                        \REDUCERADIANSANGLE{\TWENTYONEPI}{\sol}
         90                                             \sol
                                                        \REDUCEDEGREESANGLE{3690}{\sol}
                                                        \sol
                                               11
3.4.4    Hyperbolic functions
\SINH {hnumi}{h\cmd i} stores in \cmd the hyperbolic sine of num .
\COSH {hnumi}{h\cmd i} Hyperbolic cosine of num .
\TANH {hnumi}{h\cmd i} Hyperbolic tangent of num .
\COTH {hnumi}{h\cmd i} Hyperbolic cotangent of num .
        Ex. 35                                       \SINH{1.256}{\sol}
                                                     \sol
         1.61328
         1.89807                                     \COSH{1.256}{\sol}
         0.84995                                     \sol
         1.17651
                                                     \TANH{1.256}{\sol}
                                                     \sol
                                                     \COTH{1.256}{\sol}
                                                     \sol
        Ex. 36                                       \ARCSIN{0.5}{\sol}
                                                     \sol
         0.5236
         1.04718                                     \ARCCOS{0.5}{\sol}
         1.04718                                     \sol
         2.35619
                                                     \ARCTAN{\numberSQRTTHREE}{\sol}
                                                     \sol
                                                     \ARCCOT{-1}{\sol}
                                                     \sol
                                             12
\ARCOTH {hnumi}{h\cmd i} arcoth of num .
      Ex. 37                                       \ARSINH{1}{\sol}
                                                   \sol
          0.88138
          0                                        \ARCOSH{1}{\sol}
          0.5493                                   \sol
          0.5493
                                                   \ARTANH{0.5}{\sol}
                                                   \sol
                                                   \ARCOTH{2}{\sol}
                                                   \sol
      Ex. 38                                       \LENGTHDIVIDE{1in}{1cm}{\sol}
                                                   One inch equals $\sol$ centimeters.
          One inch equals 2.54 centimeters.
     Commands \LENGTHADD and \LENGTHSUBTRACT return the sum and the difference of two
     lengths (new in version 2.0).
\LENGTHADD{hlength1 i}{hlength2 i}{h\cmd i}
\LENGTHSUBTRACT{hlength1 i}{hlength2 i}{h\cmd i}
     (\cmd must be a predefined length).
      Ex. 39                                       \newlength{\mylength}
                                                   \LENGTHADD{1in}{1cm}{\mylength}
          1in + 1cm = 100.72273pt.                 $1in+1cm=\the\mylength$.
          1in − 1cm = 43.81725pt.
                                                   \LENGTHSUBTRACT{1in}{1cm}{\mylength}
                                                   $1in-1cm=\the\mylength$.
5    Matrix arithmetic
The calculator package defines the commands described below to operate on vectors and
matrices. We only work with two or three-dimensional vectors and 2 × 2 and 3 × 3 ma-
trices. Vectors are represented in the form (a1,a2) or (a1,a2,a3);10 and, in the case
of matrices, columns are separated à la matlab by semicolons: (a11,a12;a21,a22) or
(a11,a12,a13;a21,a22,a23;a31,a32,a33).
 10 But   they are column vectors.
                                              13
5.1     Vector operations
5.1.1    Assignments
\VECTORCOPY(hx,y i)(h\cmd1,\cmd2 i) copy the entries of vector (hx,yi) to the \cmd1 and
     \cmd2 commands.
\VECTORCOPY(hx,y,z i)(h\cmd1,\cmd2,\cmd3 i) copy the entries of vector (x ,y ,z ) to the
     \cmd1 , \cmd2 and \cmd3 commands.
        Ex. 40                                        \VECTORCOPY(1,-1)(\sola,\solb)
                                                      $(\sola,\solb)$
         (1, −1)
         (1, −1, 2)                                   \VECTORCOPY(1,-1,2)(\sola,\solb,\solc)
                                                      $(\sola,\solb,\solc)$
        Ex. 41                                        \VECTORADD(1,-1,2)(3,5,-1)(\sola,\solb,\solc)
                                                      $(1,-1,2)+(3,5,-1)=(\sola,\solb,\solc)$
         (1, −1, 2) + (3, 5, −1) = (4, 4, 1)
         (1, −1, 2) − (3, 5, −1) = (−2, −6, 3)        \VECTORSUB(1,-1,2)(3,5,-1)(\sola,\solb,\solc)
                                                      $(1,-1,2)-(3,5,-1)=(\sola,\solb,\solc)$
\SCALARVECTORPRODUCT{hnumi}(hx,y,z i) (h\cmd1,\cmd2,\cmd3 i)
        Ex. 42                                        \SCALARVECTORPRODUCT{2}(3,5)(\sola,\solb)
                                                      $2(3,5)=(\sola,\solb)$
         2(3, 5) = (6, 10)
         2(3, 5, −1) = (6, 10, −2)                    \SCALARVECTORPRODUCT{2}(3,5,-1)(%
                                                                             \sola,\solb,\solc)
                                                      $2(3,5,-1)=(\sola,\solb,\solc)$
                                                 14
5.1.4    Scalar (dot) product and euclidean norm
\SCALARPRODUCT(hx1,y1 i)(hx2,y2 i){h\cmd i}
\SCALARPRODUCT(hx1,y1,z1 i)(hx2,y2,z2 i){h\cmd i}
\DOTPRODUCT is an alias of \SCALARPRODUCT (new in version 2.0).
\VECTORNORM(hx,y i){h\cmd i}
\VECTORNORM(hx,y,z i){h\cmd i}
        Ex. 43                                       \SCALARPRODUCT(1,-1)(3,5){\sol}
                                                     $(1,-1)\cdot(3,5)=\sol$
         (1, −1) · (3, 5) = −2
         (1, −1, 2) · (3, 5, −1) = −4                \DOTPRODUCT(1,-1,2)(3,5,-1){\sol}
         k(3, 4)k = 5                                $(1,-1,2)\cdot(3,5,-1)=\sol$
         k(1, 2, −2)k = 3
                                                     \VECTORNORM(3,4)\sol
                                                     $\left\|(3,4)\right\|=\sol$
                                                     \VECTORNORM(1,2,-2)\sol
                                                     $\left\|(1,2,-2)\right\|=\sol$
        Ex. 44                                       \CROSSPRODUCT(1,-1,2)(3,5,-1)%
                                                                  (\sola,\solb,\solc)
         (1, −1, 2) × (3, 5, −1) = (−9, 7, 8)        $(1,-1,2)\times(3,5,-1)=(\sola,\solb,\solc)$
         (1, −1, 2) × (−3, 3, −6) = (0, 0, 0)
                                                     \VECTORPRODUCT(1,-1,2)(-3,3,-6)%
                                                                  (\sola,\solb,\solc)
                                                     $(1,-1,2)\times(-3,3,-6)=(\sola,\solb,\solc)$
        Ex. 45                                       \UNITVECTOR(3,4)(\sola,\solb)
                                                     $(\sola,\solb)$
         (0.59999, 0.79999)
         (0.33333, 0.66666, −0.66666)                \UNITVECTOR(1,2,-2)(\sola,\solb,\solc)
                                                     $(\sola,\solb,\solc)$
                                                15
5.1.7    Absolute value (in each entry of a given vector)
\VECTORABSVALUE(hx,y i)(h\cmd1,\cmd2 i)
\VECTORABSVALUE(hx,y,z i)(h\cmd1,\cmd2,\cmd3 i)
        Ex. 46                                        \VECTORABSVALUE(3,-4)(\sola,\solb)
                                                      $(\sola,\solb)$
         (3, 4)
         (3, 4, 1)                                    \VECTORABSVALUE(3,-4,-1)(\sola,\solb,\solc)
                                                      $(\sola,\solb,\solc)$
        Ex. 47                                        \TWOVECTORSANGLE(1,1)(0,1){\sol}
                                                      $\sol$ radians
         0.78537 radians (or 44.99837 degrees)        \RADtoDEG{\sol}{\degsol}
         1.57079 (or 89.99937 degrees)                (or $\degsol$ degrees)
                                                      \TWOVECTORSANGLE(1,0,0)(0,1,0){\sol}
                                                      $\sol$
                                                      \RADtoDEG{\sol}{\degsol}
                                                      (or $\degsol$ degrees)
                                                 16
    Henceforth, we will present only the syntax for commands operating with 2 × 2 matrices. In
all cases, the syntax is similar if we work with 3 × 3 matrices. In the examples, we will work
with either 2 × 2 or 3 × 3 matrices.
        Ex. 49                                        \TRANSPOSEMATRIX(1,-1;3,0)%
                                                                (\sola,\solb;\solc,\sold)
                  T                               $\begin{bmatrix}
          1   −1           1    3
                        =                                    1 & -1 \\ 3 & 0
          3    0          −1    0                          \end{bmatrix}^T=\begin{bmatrix}
                                                             \sola & \solb \\ \solc & \sold
                                                           \end{bmatrix}$
        Ex. 50                                        \MATRIXADD(1,-1;3,0)(3,5;-3,2)%
                                                                (\sola,\solb;\solc,\sold)
                                 
          1   −1     3         5   4 4                $\begin{bmatrix}
                  +              =                           1 & -1 \\ 3 & 0
          3    0    −3         2   0 2
                                                     \end{bmatrix}+
          1   −1     3         5   −2 −6
                  −              =                    \begin{bmatrix}
          3    0    −3         2    6 −2                     3 & 5 \\ -3 & 2
                                                           \end{bmatrix}=\begin{bmatrix}
                                                             \sola & \solb \\ \solc & \sold
                                                           \end{bmatrix}$
                                                      \MATRIXSUB(1,-1;3,0)(3,5;-3,2)%
                                                                (\sola,\solb;\solc,\sold)
                                                      $\begin{bmatrix}
                                                             1 & -1 \\ 3 & 0
                                                           \end{bmatrix}-
                                                      \begin{bmatrix}
                                                             3 & 5 \\ -3 & 2
                                                           \end{bmatrix}=\begin{bmatrix}
                                                             \sola & \solb \\ \solc & \sold
                                                           \end{bmatrix}$
                                             17
5.2.4    Scalar-matrix product
\SCALARMATRIXPRODUCT{hnumi} (ha11,a12;a21,a22 i) (h\cmd11,\cmd12;\cmd21,\cmd22 i)
        Ex. 51                                     \SCALARMATRIXPRODUCT{3}(1,-1,2;
                                                                           3, 0,5;
                                       
            1      −1   2      3   −3   6                                 -1, 1,4)%
         3 3       0   5 =  9    0   15                              (\sola,\solb,\solc;
                                                                          \sold,\sole,\solf;
           −1       1   4     −3    3   12
                                                                          \solg,\solh,\soli)
                                                   $3\begin{bmatrix}
                                                        1 & -1 & 2 \\ 3 & 0 & 5 \\ -1 & 1 & 4
                                                    \end{bmatrix}
                                                     =\begin{bmatrix}
                                                          \sola & \solb & \solc \\
                                                          \sold & \sole & \solf \\
                                                          \solg & \solh & \soli
                                                      \end{bmatrix}$
        Ex. 52                                     \MATRIXVECTORPRODUCT(1,-1;
                                                                        0, 2)(3,5)(\sola,\solb)
                     
          1   −1     3   −2                        $\begin{bmatrix}
                       =                                1 & -1 \\ 0 & 2
          0    2     5   10
                                                    \end{bmatrix}
                                                    \begin{bmatrix}
                                                         3 \\ 5
                                                    \end{bmatrix}
                                                     =\begin{bmatrix}
                                                            \sola \\ \solb
                                                      \end{bmatrix}$
                                              18
        Ex. 53                                          \MATRIXPRODUCT(1,-1,2;3,0,5;-1,1,4)%
                                                                      (3,5,-1;-3,2,-5;1,-2,3)%
                                                                        (\sola,\solb,\solc;
                                                                         \sold,\sole,\solf;
                                        
            1    −1        2    3     5 −1                               \solg,\solh,\soli)
          3      0        5 −3 2 −5                 \begin{multline*}
           −1     1        4    1 −2 3                  \begin{bmatrix}
                                                             1 & -1 & 2 \\ 3 & 0 & 5 \\ -1 & 1 & 4
                                    8   −1 10                \end{bmatrix}
                               =  14    5   12        \begin{bmatrix}
                                  −2 −11 8                     3 & 5 & -1 \\ -3 & 2 & -5 \\ 1 & -2 & 3
                                                             \end{bmatrix}\\
                                                        =\begin{bmatrix}
                                                               \sola & \solb & \solc \\
                                                               \sold & \sole & \solf \\
                                                               \solg & \solh & \soli
                                                        \end{bmatrix}
                                                        \end{multline*}
5.2.7     Determinant
\DETERMINANT (ha11,a12;a21,a22 i) {h\cmd i}
        Ex. 54                                          \DETERMINANT(1,-1,2;3,0,5;-1,1,4){\sol}
                                                        \SpecialUsageIndex{\DETERMINANT}%
           1     −1       2                             $\begin{vmatrix}
           3      0       5 = 18                               1 & -1 & 2 \\ 3 & 0 & 5 \\ -1 & 1 & 4
                                                             \end{vmatrix}=\sol$
          −1      1       4
        Ex. 55                                          \INVERSEMATRIX(1,-1;3,5)(%
                                                                    \sola,\solb;\solc,\sold)
                   −1                               $\begin{bmatrix}
          1    −1            0.625   0.125
                          =                                    1 & -1 \\ 3 & 5
          3     5           −0.375   0.125
                                                         \end{bmatrix}^{-1}=
                                                         \begin{bmatrix}
                                                               \sola & \solb \\ \solc & \sold
                                                         \end{bmatrix}$
        If the given matrix is singular, the calculator package returns a warning message and the
        \cmd11 , . . . , commands are marqued as undefined.
                                                   19
5.2.9      Absolute value (in each entry)
\MATRIXABSVALUE (ha11,a12;a21,a22 i) (h\cmd11,\cmd12;\cmd21,\cmd22 i)
        Ex. 56                                                 \MATRIXABSVALUE(1,-1,2;3,0,5;-1,1,4)%
                                                                         (\sola,\solb,\solc;
                     
            1   1   2                                                     \sold,\sole,\solf;
           3   0   5                                                    \solg,\solh,\soli)
                                                               $\begin{bmatrix}
            1   1   4
                                                                      \sola & \solb & \solc \\
                                                                      \sold & \sole & \solf \\
                                                                      \solg & \solh & \soli
                                                                \end{bmatrix}$
        Ex. 57                                                 \SOLVELINEARSYSTEM(1,-1,2;3,0,5;-1,1,4)%
                                                                                 (-4,4,-2)%
           Solving the    linear system                                          (\sola,\solb,\solc)
                                                           Solving the linear system
                   1      −1 2          −4                     \[
                3          0 5 X =  4                      \begin{bmatrix}
                  −1        1 4         −2                           1 & -1 & 2 \\ 3 & 0 & 5 \\ -1 & 1 & 4
                                                                    \end{bmatrix}\mathsf{X}=\begin{bmatrix}
                        3
                          
                                                                    -4\\4\\-2
                                                                    \end{bmatrix}
        we obtain X =  5 
                                                               \]
                       −1                                      we obtain
                                                               $\mathsf{X}=\begin{bmatrix}
                                                                      \sola \\ \solb\\ \solc
                                                                    \end{bmatrix}$
        If the given matrix is singular, the package calculator returns a warning message. When
        system is indeterminate, in the bi-dimensional case one of the solutions is computed; if the
        system is incompatible, then the \sola, . . . , commands are marqued as undefined. For
        three equations systems, only determinate systems are solved.11
11 This is the only command that does not behave the same way with 2 × 2 and 3 × 3 matrices.
                                                      20
Part II
The calculus package
6       What is a function?
From the point of view of this package, a function f is a pair of formulae: the first one calculates
f (t); the other, f 0 (t). Therefore, any function is applied using three arguments: the value of the
variable t, and two command names where f (t) and f 0 (t) will be stored. For example,
        \SQUAREfunction{hnumi}{h\sol i}{h\Dsol i}
computes f (t) = t2 and f 0 (t) = 2t (where t =num), and stores the results in the commands \sol
and \Dsol.12
Ex. 58                                                      \SQUAREfunction{3}{\sol}{\Dsol}
                                                            If $f(t)=t^2$, then
    If f (t) = t2 , then                                    \[
                                                               f(3)=\sol \mbox{ and } f’(3)=\Dsol
             f (3) = 9 and f 0 (3) = 6                      \]
For all functions defined here, you must use the following syntax:
        \functionname {hnumi}{h\cmd1 i}{h\cmd2 i}
being num a number (or a command whose value is a number), and \cmd1 and \cmd2 two
control sequence names where the values of the function and its derivative (in this number) will
be stored.
   The key difference between this functions and the instructions defined in the calculator pack-
age is the inclusion of the derivative; for example, the \SQUARE{3}{\sol} instruction computes,
only, the square power of number 3, while \SQUAREfunction{3}{\sol}{\Dsol} finds, also, the
corresponding derivative.
7       Predefined functions
The calculus package predefines the most commonly used elementary functions, and includes
several utilities for defining new ones. The predefined functions are the following:
  12 Do not spect any control about the existence or differentiability of the function; if the function or the
                                                     21
        \ZEROfunction          f (t) = 0                   \ONEfunction            f (t) = 1
        \IDENTITYfunction      f (t) = t                   \RECIPROCALfunction     f (t) = 1/t
        \SQUAREfunction        f (t) = t√2                 \CUBEfunction           f (t) = t3
        \SQRTfunction          f (t) = t
        \EXPfunction           f (t) = exp t               \LOGfunction            f (t) = log t
        \COSfunction           f (t) = cos t               \SINfunction            f (t) = sin t
        \TANfunction           f (t) = tan t               \COTfunction            f (t) = cot t
        \COSHfunction          f (t) = cosh t              \SINHfunction           f (t) = sinh t
        \TANHfunction          f (t) = (tanh t             \COTHfunction           f (t) = coth t
                                          0 si t < 0
        \HEAVISIDEfunction     f (t) =
                                          1 si t ≥ 0
The following functions are added in version 2.0 (new in version 2.0)
   In the following example, we use the \LOGfunction function to compute a table of the log
function and its derivative.
Ex. 59                                                     $\begin{array}{cll}
                                                           x & \log x & \log’ x \\
    x    log x   log0 x                                    \LOGfunction{1}{\logx}{\Dlogx}
    1    0       1                                         1 &\logx & \Dlogx\\
                                                           \LOGfunction{2}{\logx}{\Dlogx}
    2    0.69315 0.5
                                                           2 &\logx & \Dlogx\\
    3    1.0986  0.33333
                                                           \LOGfunction{3}{\logx}{\Dlogx}
    4    1.38629 0.25                                      3 &\logx & \Dlogx\\
    5    1.60942 0.2                                       \LOGfunction{4}{\logx}{\Dlogx}
    6    1.79176 0.16666                                   4 &\logx & \Dlogx\\
                                                           \LOGfunction{5}{\logx}{\Dlogx}
                                                           5 &\logx & \Dlogx\\
                                                           \LOGfunction{6}{\logx}{\Dlogx}
                                                           6 &\logx & \Dlogx
                                                           \end{array}$
                                                    22
\SUMfunction{h\function1 i}{h\function2 i} {h\Functioni} defines \Function as the sum of
     functions \function1 and \function2.
     Example. Definition of the F (t) = t2 + t3 function:
     \SUMfunction{\SQUAREfunction}{\CUBEfunction}{\F}
                                               23
\LINEARCOMBINATIONfunction{hnum1 i}{h\function1 i} {hnum2 i}{h\function2 i}{h\Functioni}
     defines \Function as the linear combination of functions \function1 and \function2 mul-
     tiplied, respectively, by numbers num1 and num2.
         Example. Definition of the F (t) = 2t − 3 cos t function:
         \LINEARCOMBINATIONfunction{2}{\IDENTITYfunction}{-3}{\COSfunction}{\F}
    By combining properly this operations and the predefined functions, many elementary func-
tions can be defined.
Ex. 60                                                   % exp(-t)
                                                            \SCALEVARIABLEfunction
    If                                                          {-1}{\EXPfunction}
             f (t) = 3t2 − 2e−t cos t                           {\NEGEXPfunction}
then                                                     % exp(-t)cos(t)
                f (5) = 74.99619                            \PRODUCTfunction
                f 0 (5) = 29.99084                              {\NEGEXPfunction}
                                                                {\COSfunction}
                                                                {\NEGEXPCOSfunction}
                                                         % 3t^2-2exp(-t)cos(t)
                                                            \LINEARCOMBINATIONfunction
                                                                {3}{\SQUAREfunction}
                                                               {-2}{\NEGEXPCOSfunction}
                                                               {\myfunction}
\myfunction{5}{\sol}{\Dsol}
                                                         If
                                                         \[
                                                             f(t)=3t^2-2\mathrm{e}^{-t}\cos t
                                                         \]
                                                         then
                                                         \[
                                                         \begin{gathered}
                                                             f(5)=\sol\\
                                                             f’(5)=\Dsol
                                                         \end{gathered}
                                                         \]
9        Polynomial functions
Although polynomial functions can be defined using linear combinations of power functions, to
facilitate our work, the calculus package includes the following commands to define more easily
the polynomials of 1, 2, and 3 degrees: \newlpoly (new linear polynomial), \newqpoly (new
quadratic polynomial), and \newcpoly (new cubic polynomial):
\newlpoly{h\Functioni}{hai}{hbi} stores the p(t) = a + b t function in the \Function com-
     mand.
                                                   24
\newqpoly{h\Functioni} {hai}{hbi}{hci} stores the p(t) = a + b t + c t2 function in the
     \Function command.
\newcpoly{h\Functioni}{hai}{hbi}{hci}{hd i} stores the p(t) = a + b t + c t2 + d t3 function in
     the \Function command.
Ex. 61                                              % \mypoly=1-x^2+x^3
                                                        \newcpoly{\mypoly}{1}{0}{-1}{1}
 p0 (2) = 8                                             \mypoly{2}{\sol}{\Dsol}
                                                    $p’(2)=\Dsol$
These declarations behave similarly to to the declaration \newcommand: If the name you want to
assign to the new function is that of an already defined command, the calculus package returns
an error message and do not redefines this command. To obtain any alternative behavior, our
package includes three other sets of declarations:
   • num is a number t,
   • \cmd1 and \cmd2 are two command names where the values of the x(t) function and its
     derivative x0 (t) will be stored, and
   • \cmd3 and \cmd4 will store y(t) and y 0 (t).
                                              25
In short, in this context, a vector function is a pair of scalar functions.
    Instead of \PARAMETRICfunction we can use the alias \VECTORfunction.
Ex. 62                                                For the $f(t)=(t^2,t^3)$ function we have
                                                      \VECTORfunction
  For the f (t) = (t2 , t3 ) function we have             {\SQUAREfunction}{\CUBEfunction}{\F}
                                                      \F{4}{\solx}{\Dsolx}{\soly}{\Dsoly}
                         0
       f (4) = (16, 64), f (4) = (8, 48)
                                                      \[
                                                      f(4)=(\solx,\soly), f’(4)=(\Dsolx,\Dsoly)
                                                      \]
declares the vector function f (φ) = (r(φ) cos φ, r(φ) sin φ). The first argument is the r = r(φ)
function, (an already defined function). For example, we can define the Archimedean spiral
r(φ) = 0,5φ, as follows:
   \SCALEfunction{0.5}{\IDENTITYfunction}{\rfunction}
   \POLARfunction{\rfunction}{\archimedes}
12       Low-level instructions
Probably, many users of the package will not be interested in the implementation of the com-
mands this package includes. If this is your case, you can ignore this section.
                                                26
   \newfunction{\Ffunction}{%
      \SQUARE{\t}{\tempA}                          % A=t^2
      \EXP{\t}{\tempB}                             % B=e^t
      \COS{\t}{\tempC}                             % C=cos(t)
      \SIN{\t}{\tempD}                             % D=sin(t)
      \MULTIPLY{2}{\t}{\tempE}                     % E=2t
      \MULTIPLY{\tempB}{\tempC}{\tempC}            % C=e^t cos(t)
      \MULTIPLY{\tempB}{\tempD}{\tempD}            % D=e^t sin(t)
      \ADD{\tempA}{\tempC}{\y}                       % y=t^2 + e^t cos(t)
      \ADD{\tempE}{\tempC}{\tempC}                 % C=t^2 + e^t cos(t)
      \SUBTRACT{\tempC}{\tempD}{\Dy}                 % y’=t^2 + e^t cos(t) - e^t sin(t)
   }
    It must be said, however, that the \newfunction declaration behaves similarly to \newcommand
or \newlpoly: If the name you want to assign to the new function is that of an already de-
fined command, the calculus package returns an error message and does not redefines this com-
mand. To obtain any alternative behavior, our package includes three other versions of the
\newfunction declarations: the \renewfunction, \ensurefunction and \forcefunction dec-
larations. Each of these declarations behaves differently:
\newfunction defines a new function. If the command \Function already exists, it is not
     redefined and an error message occurs.
\renewfunction redefines the already existing command \Function . If this command does
     not exists, then it is not defined and an error message occurs.
\ensurefunction defines a new function. If the command \Function already exists, it is not
     redefined.
\forcefunction defines a new function. If the command \Function already exists, it is rede-
     fined.
For example, you can define the function f (t) = (t2 , t3 ) in the following way:
   \newvectorfunction{\F}{%
      \SQUARE{\t}{\x}                %   x=t^2
      \MULTIPLY{2}{\t}{\Dx}          %   x’=2t
      \CUBE{\t}{\y}                  %   y=t^3
      \MULTIPLY{3}{\x}{\Dy}          %   y’=3t^2
   }
                                                27
                     Finally, to define the r = r(φ) function, in polar coordinates, we have the declarations
                  \newpolarfunction, \renewpolarfunction, \ensurepolarfunction and \forcepolarfunction.
                  \newpolarfunction{h\Functioni}{hInstructions to compute \r and \Dr from \t i}
                      For example, you can define the cardioide curve r(φ) = 1+cos φ, using high level instructions,
                  Part III
                  Implementation
                  13      calculator
                  1 h∗calculatori
                  2 \NeedsTeXFormat{LaTeX2e}
                  3 \ProvidesPackage{calculator}[2022/09/15 v.2.1]
  \cctr@epsilon   \cctr@epsilon will store the closest to zero length in the TEX arithmetic: one scaled point
                  (1 sp = 1/65536 pt). This means the smallest positive number will be 0.00002 ≈ 1/65536 =
                  1/216 .
                  6   \newdimen\cctr@epsilon
                  7   \cctr@epsilon=1sp
\cctr@logmaxnum   The largest TEX number is 16383.99998 ≈ 214 ; \cctr@logmaxnum is the logarithm of this num-
                  ber, 9.704 ≈ log 16384.
                  8   \def\cctr@logmaxnum{9.704}
                                                                  28
13.2    Warning messages
9  \def\cctr@Warntruncate#1#2{%
10       \PackageWarning{calculator}%
11                     {The optional argument in truncate \MessageBreak
12                      must be less than 5 \MessageBreak
13                      I copy #1 to #2 \MessageBreak without truncating}}
14
15 \def\cctr@Warnround#1#2{%
16       \PackageWarning{calculator}%
17                     {The optional argument in round \MessageBreak
18                      must be less than 5 \MessageBreak
19                      I copy #1 to #2 \MessageBreak without rounding}}
20
21 \def\cctr@Warndivzero#1#2{%
22       \PackageWarning{calculator}%
23         {Division by 0.\MessageBreak
24          I can’t define #1/#2}}
25
26 \def\cctr@Warnnogcd{%
27       \PackageWarning{calculator}%
28         {gcd(0,0) is not well defined}}
29
30 \def\cctr@Warnnoposrad#1{%
31       \PackageWarning{calculator}%
32                     {The argument in square root\MessageBreak
33                      must be non negative\MessageBreak
34                      I can’t define sqrt(#1)}}
35
36 \def\cctr@Warnnointexp#1#2{%
37       \PackageWarning{calculator}%
38                     {The exponent in power function\MessageBreak
39                      must be an integer\MessageBreak
40                      I can’t define #1^#2}}
41
42 \def\cctr@Warnbigarcsin#1{%
43       \PackageWarning{calculator}%
44                     {The argument in arcsin\MessageBreak
45                      must be a number between -1 and 1\MessageBreak
46                      I can’t define arcsin(#1)}}
47
48 \def\cctr@Warnbigarccos#1{%
49       \PackageWarning{calculator}%
50                     {The argument in arccos\MessageBreak
51                      must be a number between -1 and 1\MessageBreak
52                      I can’t define arccos(#1)}}
53
54 \def\cctr@Warnsmallarcosh#1{%
55       \PackageWarning{calculator}%
56                     {The argument in arcosh\MessageBreak
57                      must be a number greater or equal than 1\MessageBreak
                                             29
58                        I can’t define arcosh(#1)}}
59
60 \def\cctr@Warnbigartanh#1{%
61       \PackageWarning{calculator}%
62                     {The argument in artanh\MessageBreak
63                      must be a number between -1 and 1\MessageBreak
64                      I can’t define artanh(#1)}}
65
66 \def\cctr@Warnsmallarcoth#1{%
67       \PackageWarning{calculator}%
68                     {The argument in arcoth\MessageBreak
69                      must be a number greater than 1\MessageBreak
70                      or smaller than -1\MessageBreak
71                      I can’t define arcoth(#1)}}
72
73 \def\cctr@Warnsingmatrix#1#2#3#4{%
74       \PackageWarning{calculator}%
75         {Matrix (#1 #2 ; #3 #4) is singular\MessageBreak
76          Its inverse is not defined}}
77
78 \def\cctr@WarnsingTDmatrix#1#2#3#4#5#6#7#8#9{%
79       \PackageWarning{calculator}%
80         {Matrix (#1 #2 #3; #4 #5 #6; #7 #8 #9) is singular\MessageBreak
81          Its inverse is not defined}}
82
83    \def\cctr@WarnIncLinSys{\PackageWarning{calculator}{%
84          Incompatible linear system}}
85
86 \def\cctr@WarnIncTDLinSys{\PackageWarning{calculator}{%
87       Incompatible or indeterminate linear system\MessageBreak
88       For 3x3 systems I can solve only determinate systems}}
89
90 \def\cctr@WarnIndLinSys{\PackageWarning{calculator}{%
91       Indeterminate linear system.\MessageBreak
92       I will choose one of the infinite solutions}}
93
94 \def\cctr@WarnZeroLinSys{\PackageWarning{calculator}{%
95       0x=0 linear system. Every vector is a solution!\MessageBreak
96       I will choose the (0,0) solution}}
97
98  \def\cctr@Warninftan#1{%
99               \PackageWarning{calculator}{%
100                     Undefined tangent.\MessageBreak
101                            The cosine of #1 is zero and, then,\MessageBreak
102                            the tangent of #1 is not defined}}
103
104 \def\cctr@Warninfcotan#1{%
105              \PackageWarning{calculator}{%
106                     Undefined cotangent.\MessageBreak
107                            The sine of #1 is zero and, then,\MessageBreak
                                              30
              108                              the cotangent of #1 is not defined}}
              109
              110 \def\cctr@Warninfexp#1{%
              111              \PackageWarning{calculator}{%
              112                     The absolute value of the variable\MessageBreak
              113                     in the exponential function must be less than
              114                     \cctr@logmaxnum\MessageBreak
              115                    (the logarithm of the max number I know)\MessageBreak
              116                     I can’t define exp(#1)}}
              117
              118 \def\cctr@Warninfexpb#1#2{%
              119              \PackageWarning{calculator}{%
              120                     The base\MessageBreak
              121                     in the exponential function must be positive.
              122                     \MessageBreak
              123                     I can’t define #1^(#2)}}
              124
              125 \def\cctr@Warninflog#1{%
              126              \PackageWarning{calculator}{%
              127                     The value of the variable\MessageBreak
              128                     in the logarithm function must be positive\MessageBreak
              129                     I can’t define log(#1)}}
              130
              131 \def\cctr@Warncrossprod(#1)(#2){%
              132       \PackageWarning{calculator}%
              133         {Vector product only defined\MessageBreak
              134         for 3 dimmensional vectors.\MessageBreak
              135          I can’t define (#1)x(#2)}}
              136
              137 \def\cctr@Warnnoangle(#1)(#2){%
              138       \PackageWarning{calculator}%
              139         {Angle between two vectors only defined\MessageBreak
              140         for nonzero vectors.\MessageBreak
              141          I can’t define an angle between (#1) and (#2)}}
\GLOBALCOPY   Global version of \COPY. The new defined command #2 is not changed outside groups.
              143   \def\GLOBALCOPY#1#2{\xdef#2{#1}\ignorespaces}
\@OUTPUTSOL   \@OUTPUTSOL{h#1 i}: an internal macro to save solutions when a group is closed.
                  The global c.s. \cctr@outa preserves solutions. Whenever we use any temporary param-
              eters in the definition of an instruction, we use a group to ensure the local character of those
              parameters. The instruction \@OUTPUTSOL is a bypass to export the solution.
              144   \def\@OUTPUTSOL#1{\GLOBALCOPY{#1}{\cctr@outa}\endgroup\COPY{\cctr@outa}{#1}}
                                                              31
\@OUTPUTSOLS   Analogous to \@OUTPUTSOL, preserving a pair of solutions.
               145 \def\@OUTPUTSOLS#1#2{\GLOBALCOPY{#1}{\cctr@outa}
               146                      \GLOBALCOPY{#2}{\cctr@outb}\endgroup
               147                      \COPY{\cctr@outa}{#1}\COPY{\cctr@outb}{#2}}
       \MAX    \MAX{h#1 i}{h#2 i}{h#3 i} defines the #3 command as the maximum of numbers #1 and #2.
               148 \def\MAX#1#2#3{%
               149    \ifdim #1\p@ < #2\p@
               150       \COPY{#2}{#3}\else\COPY{#1}{#3}\fi\ignorespaces}
       \MIN    \MIN{h#1 i}{h#2 i}{h#3 i} defines the #3 command as the minimum of numbers #1 and #2.
               151 \def\MIN#1#2#3{%
               152    \ifdim #1\p@ > #2\p@
               153       \COPY{#2}{#3}\else\COPY{#1}{#3}\fi\ignorespaces}
               Real arithmetic
  \ABSVALUE    \ABSVALUE{h#1 i}{h#2 i} defines the #2 command as the absolute value of number #1.
               154 \def\ABSVALUE#1#2{%
               155     \ifdim #1\p@<\z@
               156           \MULTIPLY{-1}{#1}{#2}\else\COPY{#1}{#2}\fi}
       \ADD    \ADD{h#1 i}{h#2 i}{h#3 i} defines the #3 command as the sum of numbers #1 and #2.
               160 \def\ADD#1#2#3{\cctr@lengtha=#1\p@
               161        \cctr@lengthb=#2\p@
               162        \advance\cctr@lengtha by \cctr@lengthb
               163        \edef#3{\expandafter\strip@pt\cctr@lengtha}\ignorespaces}
  \SUBTRACT    \SUBTRACT{h#1 i}{h#2 i}{h#3 i} defines the #3 command as the difference of numbers #1 and
               #2.
               164   \def\SUBTRACT#1#2#3{\ADD{#1}{-#2}{#3}}
               Divisions We define several kinds of divisions: the quotient of two real numbers, the integer
               quotient, and the quotient of two lengths. The basic algorithm is a lightly modified version of
               the Beccari’s division.
    \DIVIDE    \DIVIDE{h#1 i}{h#2 i}{h#3 i} defines the #3 command as the quotient of numbers #1 and
               #2.
               165   \def\DIVIDE#1#2#3{%
               166        \begingroup
                                                              32
                  Absolute values of dividend and divisor
                  167        \ABSVALUE{#1}{\cctr@tempD}
                  168        \ABSVALUE{#2}{\cctr@tempd}
                  The sign of quotient
                  169        \ifdim#1\p@<\z@\ifdim#2\p@>\z@\COPY{-1}{\cctr@sign}
                  170           \else\COPY{1}{\cctr@sign}\fi
                  171        \else\ifdim#2\p@>\z@\COPY{1}{\cctr@sign}
                  172                \else\COPY{-1}{\cctr@sign}\fi
                  173             \fi
                  Integer part of quotient
                  174        \@DIVIDE{\cctr@tempD}{\cctr@tempd}{\cctr@tempq}{\cctr@tempr}
                  175        \COPY{\cctr@tempq.}{\cctr@Q}
                  Fractional part up to five decimal places. \cctr@ndec is the number of decimal places already
                  computed.
                  176        \COPY{0}{\cctr@ndec}
                  177        \@whilenum \cctr@ndec<5 \do{%
                  Each decimal place is calculated by multiplying by 10 the last remainder and dividing it by the
                  divisor. But when the remainder is greater than 1638.3, an overflow occurs, because 16383.99998
                  is the greatest number. So, instead, we multiply the divisor by 0.1.
                  178           \ifdim\cctr@tempr\p@<1638\p@
                  179              \MULTIPLY{\cctr@tempr}{10}{\cctr@tempD}
                  180           \else
                  181              \COPY{\cctr@tempr}{\cctr@tempD}
                  182              \MULTIPLY{\cctr@tempd}{0.1}{\cctr@tempd}
                  183           \fi
                  184           \@DIVIDE{\cctr@tempD}{\cctr@tempd}{\cctr@tempq}{\cctr@tempr}
                  185           \COPY{\cctr@Q\cctr@tempq}{\cctr@Q}
                  186           \ADD{1}{\cctr@ndec}{\cctr@ndec}}%
                  Adjust the sign and return the solution.
                  187        \MULTIPLY{\cctr@sign}{\cctr@Q}{#3}
                  188        \@OUTPUTSOL{#3}}
      \@DIVIDE    The \@DIVIDE(h#1 i) (h#2 i)(h#3 i)(h#4 i) command computes #1/#2 and returns an integer
                  quotient (#3 ) and a real remainder (#4 ).
                  189   \def\@DIVIDE#1#2#3#4{%
                  190        \@INTEGERDIVIDE{#1}{#2}{#3}
                  191        \MULTIPLY{#2}{#3}{#4}
                  192        \SUBTRACT{#1}{#4}{#4}}
\@INTEGERDIVIDE   \@INTEGERDIVIDE divides two numbers (not necessarily integer) and returns an integer (this is
                  the integer quotient only for nonnegative integers).
                  193 \def\@INTEGERDIVIDE#1#2#3{%
                  194        \cctr@lengtha=#1\p@
                  195        \cctr@lengthb=#2\p@
                  196        \ifdim\cctr@lengthb=\z@
                  197           \let#3\undefined
                                                                33
                  198            \cctr@Warndivzero#1#2%
                  199         \else
                  200            \divide\cctr@lengtha\cctr@lengthb
                  201            \COPY{\number\cctr@lengtha}{#3}
                  202         \fi\ignorespaces}
     \LENGTHADD   The sum of two lengths. \LENGTHADD{h#1 i}{h#2 i}{h#3 i} stores in #3 the sum of the lenghts
                  #1 and #2 (#3 must be a length).
                  203 \def\LENGTHADD#1#2#3{\cctr@lengtha=#1
                  204        \cctr@lengthb=#2
                  205        \advance\cctr@lengtha by \cctr@lengthb
                  206        \setlength{#3}{\cctr@lengtha}\ignorespaces}
\LENGTHSUBTRACT   The difference of two lengths. \LENGTHSUBTRACT{h#1 i}{h#2 i}{h#3 i} stores in #3 the differ-
                  ence of the lenghts #1 and #2 (#3 must be a length).
                  207   \def\LENGTHSUBTRACT#1#2#3{%
                  208          \LENGTHADD{#1}{-#2}{#3}}
  \LENGTHDIVIDE   The quotient of two lengths must be a number (not a length). For example, one inch over one
                  centimeter equals 2.54. \LENGTHDIVIDE{h#1 i}{h#2 i}{h#3 i} stores in #3 the quotient of the
                  lenghts #1 and #2.
                  209 \def\LENGTHDIVIDE#1#2#3{%
                  210        \begingroup
                  211        \cctr@lengtha=#1
                  212        \cctr@lengthb=#2
                  213        \edef\cctr@tempa{\expandafter\strip@pt\cctr@lengtha}%
                  214        \edef\cctr@tempb{\expandafter\strip@pt\cctr@lengthb}%
                  215        \DIVIDE{\cctr@tempa}{\cctr@tempb}{#3}
                  216        \@OUTPUTSOL{#3}}
                  Powers
       \SQUARE    \SQUARE{h#1 i}{h#2 i} stores #1 squared in #2.
                  217   \def\SQUARE#1#2{\MULTIPLY{#1}{#1}{#2}}
                                                                 34
                   227 \def\@POWER#1#2#3{%
                   228       \begingroup
                   229       \ifdim #2\p@<\z@
                   For negative exponents, an = (1/a)−n .
                   230             \DIVIDE{1}{#1}{\cctr@tempb}
                   231             \MULTIPLY{-1}{#2}{\cctr@tempc}
                   232             \@POWER{\cctr@tempb}{\cctr@tempc}{#3}
                   233          \else
                   234             \COPY{0}{\cctr@tempa}
                   235             \COPY{1}{#3}
                   236             \@whilenum \cctr@tempa<#2 \do {%
                   237                \MULTIPLY{#1}{#3}{#3}
                   238                \ADD{1}{\cctr@tempa}{\cctr@tempa}}%
                   239       \fi\@OUTPUTSOL{#3}}
\INTEGERQUOTIENT   \INTEGERQUOTIENT{h#1 i}{h#2 i}{h#3 i} returns the integer quotient of division #1/#2.
                   256 \def\INTEGERQUOTIENT#1#2#3{%
                   257        \begingroup
                   258        \INTEGERDIVISION{#1}{#2}{#3}{\cctr@temp}\@OUTPUTSOL{#3}}
                                                                35
                  264                          \MULTIPLY{-1}{#1}{\cctr@temp}
                  265                          \INTEGERPART{\cctr@temp}{#2}
                  266                          \ifdim #2\p@<\cctr@temp\p@
                  267                             \SUBTRACT{-#2}{1}{#2}
                  268                          \else \COPY{-#2}{#2}
                  269                          \fi
                  270                       \else
                  271                          \@INTEGERPART{#1}{#2}
                  272                       \fi\@OUTPUTSOL{#2}}
                                                               36
\ROUND   \ROUND[h#1 i]{h#2 i}{h#3 i} rounds #2 to #1 (0, 1, 2 (default), 3 or 4) digits.
         307 \def\ROUND{\@ifnextchar[\@@ROUND\@ROUND}
         308 \def\@ROUND#1#2{\@@ROUND[2]{#1}{#2}}
         309 \def\@@ROUND[#1]#2#3{%
         310     \begingroup
         311     \ifdim #1\p@ > 4\p@ \cctr@Warnround{#2}{\noexpand#3} \COPY{#2}{#3}
         312     \else
         313     \INTEGERPART{#2}{\cctr@tempa}
         314     \ifdim \cctr@tempa\p@ = #2\p@
         315        \expandafter\@@@ROUND\cctr@tempa.00000.)[#1]{#3}
         316     \else
         317        \expandafter\@@@ROUND#200000.)[#1]{#3}
         318     \fi
         319     \fi
         320     \@OUTPUTSOL{#3}}
         321
         322 \def\@@@ROUND#1.#2#3#4#5#6.#7)[#8]#9{%
         323     \ifcase #8
         324        \COPY{#1}{#9} \ifnum #2>4 \ADD{#1}{1}{\cctr@tempp}\COPY{\cctr@tempp}{#9} \fi
         325     \or\COPY{#1.#2}{#9} \ifnum #3>4 \ADD{#2}{1}\cctr@tempq\COPY{#1}{\cctr@tempp}
         326                                     \ifnum\cctr@tempq=10\ADD{\cctr@tempp}{1}\cctr@tempp\COPY{0}{\cctr
         327                                     \COPY{\cctr@tempp.\cctr@tempq}{#9}
         328                         \fi
         329     \or\COPY{#1.#2#3}{#9} \ifnum #4>4 \ADD{#3}1\cctr@tempq\COPY{#2}{\cctr@tempp}\COPY{#1}{\cctr@tempo
         330                                     \ifnum\cctr@tempq=10\ADD{\cctr@tempp}{1}{\cctr@tempp}\COPY{0}{\cc
         331                                     \ifnum\cctr@tempp=10\ADD{\cctr@tempo}{1}\cctr@tempo\COPY{0}{\cctr
         332                                     \COPY{\cctr@tempo.\cctr@tempp\cctr@tempq}{#9}
         333                           \fi
         334     \or\COPY{#1.#2#3#4}{#9} \ifnum #5>4 \ADD{#4}1\cctr@tempq\COPY{#3}{\cctr@tempp}\COPY{#2}{\cctr@tem
         335                                     \ifnum\cctr@tempq=10\ADD{\cctr@tempp}{1}{\cctr@tempp}\COPY{0}{\cc
         336                                     \ifnum\cctr@tempp=10\ADD{\cctr@tempo}{1}\cctr@tempo\COPY{0}{\cctr
         337                                     \ifnum\cctr@tempo=10\ADD{\cctr@tempn}{1}\cctr@tempn\COPY{0}{\cctr
         338                                     \COPY{\cctr@tempn.\cctr@tempo\cctr@tempp\cctr@tempq}{#9}
         339                           \fi
         340     \or\COPY{#1.#2#3#4#5}{#9} \ifnum #6>4 \ADD{#5}1\cctr@tempq\COPY{#4}{\cctr@tempp}\COPY{#3}{\cctr@
         341                                     \ifnum\cctr@tempq=10\ADD{\cctr@tempp}{1}{\cctr@tempp}\COPY{0}{\cc
         342                                     \ifnum\cctr@tempp=10\ADD{\cctr@tempo}{1}\cctr@tempo\COPY{0}{\cctr
         343                                     \ifnum\cctr@tempo=10\ADD{\cctr@tempn}{1}\cctr@tempn\COPY{0}{\cctr
         344                                     \ifnum\cctr@tempn=10\ADD{\cctr@tempm}{1}\cctr@tempm\COPY{0}{\cctr
         345                                     \COPY{\cctr@tempm.\cctr@tempn\cctr@tempo\cctr@tempp\cctr@tempq}{#
         346    \fi}
 \GCD    \GCD{h#1 i}{h#2 i}{h#3 i} Greatest common divisor, using the Euclidean algorithm
         347 \def\GCD#1#2#3{%
         348        \begingroup
         349        \ABSVALUE{#1}{\cctr@tempa}
         350        \ABSVALUE{#2}{\cctr@tempb}
         351        \MAX{\cctr@tempa}{\cctr@tempb}{\cctr@tempc}
         352        \MIN{\cctr@tempa}{\cctr@tempb}{\cctr@tempa}
         353        \COPY{\cctr@tempc}{\cctr@tempb}
                                                      37
                    354       \ifnum \cctr@tempa = 0
                    355          \ifnum \cctr@tempb = 0
                    356             \cctr@Warnnogcd
                    357             \let#3\undefined
                    358          \else
                    359          \COPY{\cctr@tempb}{#3}
                    360          \fi
                    361       \else
                    Euclidean algorithm: if c ≡ b (mod a) then gcd(b, a) = gcd(a, c). Iterating this property, we
                    obtain gcd(b, a) as the last nonzero residual.
                    362          \@whilenum \cctr@tempa > \z@ \do {%
                    363             \COPY{\cctr@tempa}{#3}%
                    364             \MODULO{\cctr@tempb}{\cctr@tempa}{\cctr@tempc}%
                    365             \COPY\cctr@tempa\cctr@tempb%
                    366             \COPY\cctr@tempc\cctr@tempa}
                    367       \fi\ignorespaces\@OUTPUTSOL{#3}}
\FRACTIONSIMPLIFY   \FRACTIONSIMPLIFY{h#1 i}{h#2 i}{h#3 i}{h#4 i} Fraction simplification: #3/#4 is the irre-
                    ducible fraction equivalent to #1/#2.
                    376 \def\FRACTIONSIMPLIFY#1#2#3#4{%
                    377        \ifnum #1=\z@
                    378           \COPY{0}{#3}\COPY{1}{#4}
                    379        \else
                    380           \GCD{#1}{#2}{#3}%
                    381           \DIVIDE{#2}{#3}{#4}
                    382           \DIVIDE{#1}{#3}{#3}
                    383           \ifnum #4<0 \MULTIPLY{-1}{#4}{#4}\MULTIPLY{-1}{#3}{#3}\fi
                    384        \fi\ignorespaces}
                    Elementary functions
                    Square roots
     \SQUAREROOT    \SQUAREROOT{h#1 i}{h#2 i} defines #2 as the square root of #1, using the Newton’s method:
                    xn+1 = xn − (x2n − #1)/(2xn ).
                    385 \def\SQUAREROOT#1#2{%
                    386        \begingroup
                    387        \ifdim #1\p@ = \z@
                    388          \COPY{0}{#2}
                                                                 38
        389         \else
        390           \ifdim #1\p@ < \z@
        391               \let#2\undefined
        392               \cctr@Warnnoposrad{#1}%
        393            \else
        We take #1 as the initial approximation.
        394               \COPY{#1}{#2}
        \cctr@lengthb will be the difference of two successive iterations.
           We start with \cctr@lengthb=5\p@ to ensure almost one iteration.
        395               \cctr@lengthb=5\p@
        Successive iterations
        396               \@whilenum \cctr@lengthb>\cctr@epsilon \do {%
        Copy the actual approximation to \cctr@tempw
        397                     \COPY{#2}{\cctr@tempw}
        398                     \DIVIDE{#1}{\cctr@tempw}{\cctr@tempz}
        399                     \ADD{\cctr@tempw}{\cctr@tempz}{\cctr@tempz}
        400                     \DIVIDE{\cctr@tempz}{2}{\cctr@tempz}
        Now, \cctr@tempz is the new approximation.
        401                     \COPY{\cctr@tempz}{#2}
        Finally, we store in \cctr@lengthb the difference of the two last approximations, finishing the
        loop.
        402                  \SUBTRACT{#2}{\cctr@tempw}{\cctr@tempw}
        403                  \cctr@lengthb=\cctr@tempw\p@%
        404                  \ifnum
        405                     \cctr@lengthb<\z@ \cctr@lengthb=-\cctr@lengthb
        406                  \fi}
        407         \fi\fi\@OUTPUTSOL{#2}}
        Trigonometric functions For a variable close enough to zero, the sine and tangent functions
        are computed using some continued fractions. Then, all trigonometric functions are derived
        from well-known formulas.
\SIN    \SIN{h#1 i}{h#2 i}. Sine of #1.
        409   \def\SIN#1#2{%
        410       \begingroup
        Exact sine for t ∈ {π/2, −π/2, 3π/2}
        411      \ifdim #1\p@=-\numberHALFPI\p@ \COPY{-1}{#2}
        412      \else
        413            \ifdim #1\p@=\numberHALFPI\p@ \COPY{1}{#2}
        414            \else
        415                 \ifdim #1\p@=\numberTHREEHALFPI\p@ \COPY{-1}{#2}
        416                  \else
                                                         39
              If |t| > π/2, change t to a smaller value.
              417                      \ifdim#1\p@<-\numberHALFPI\p@
              418                         \ADD{#1}{\numberTWOPI}{\cctr@tempb}
              419                         \SIN{\cctr@tempb}{#2}
              420                      \else
              421                         \ifdim #1\p@<\numberHALFPI\p@
              Compute the sine.
              422                          \@BASICSINE{#1}{#2}
              423                       \else
              424                          \ifdim #1\p@<\numberTHREEHALFPI\p@
              425                             \SUBTRACT{\numberPI}{#1}{\cctr@tempb}
              426                             \SIN{\cctr@tempb}{#2}
              427                         \else
              428                           \SUBTRACT{#1}{\numberTWOPI}{\cctr@tempb}
              429                           \SIN{\cctr@tempb}{#2}
              430   \fi\fi\fi\fi\fi\fi\@OUTPUTSOL{#2}}
                                                                    40
     \COS    \COS{h#1 i}{h#2 i}. Cosine of #1 : cos t = sin(t + π/2).
             449 \def\COS#1#2{%
             450         \begingroup
             451         \ADD{\numberHALFPI}{#1}{\cctr@tempc}
             452         \SIN{\cctr@tempc}{#2}\@OUTPUTSOL{#2}}
                                                                41
                      For t very close to zero, tan t ≈ t.
                      478               \ifdim\cctr@tempa\p@<0.04\p@
                      479                  \COPY{#1}{#2}
                      480               \else
                      Compute the continued fraction.
                      481                  \DIVIDE{#1}{11}{#2}
                      482                  \DIVIDE{9}{#1}{\cctr@tempa}
                      483                  \SUBTRACT{\cctr@tempa}{#2}{#2}
                      484                  \DIVIDE{1}{#2}{#2}
                      485                  \DIVIDE{7}{#1}{\cctr@tempa}
                      486                  \SUBTRACT{\cctr@tempa}{#2}{#2}
                      487                  \DIVIDE{1}{#2}{#2}
                      488                  \DIVIDE{5}{#1}{\cctr@tempa}
                      489                  \SUBTRACT{\cctr@tempa}{#2}{#2}
                      490                  \DIVIDE{1}{#2}{#2}
                      491                  \DIVIDE{3}{#1}{\cctr@tempa}
                      492                  \SUBTRACT{\cctr@tempa}{#2}{#2}
                      493                  \DIVIDE{1}{#2}{#2}
                      494                  \DIVIDE{1}{#1}{\cctr@tempa}
                      495                  \SUBTRACT{\cctr@tempa}{#2}{#2}
                      496                  \DIVIDE{1}{#2}{#2}
                      497            \fi\fi\@OUTPUTSOL{#2}}
              \COT    \COT{h#1 i}{h#2 i}. Cotangent of #1 : If cos t = 0 then cot t = 0; if tan t = 0 then cot t = ∞.
                      Otherwise, cot t = 1/ tan t.
                      498 \def\COT#1#2{%
                      499         \begingroup
                      500         \COS{#1}{#2}
                      501         \ifdim #2\p@ = \z@
                      502         \COPY{0}{#2}
                      503         \else
                      504         \TAN{#1}{#2}
                      505         \ifdim #2\p@ = \z@
                      506         \cctr@Warninfcotan{#1}
                      507         \let#2\undefined
                      508         \else
                      509         \DIVIDE{1}{#2}{#2}
                      510         \fi\fi\@OUTPUTSOL{#2}}
                                                                    42
                      516                   \ADD{#1}{\numberTWOPI}{#2}
                      517                   \REDUCERADIANSANGLE{#2}{#2}
                      518           \fi
                      519           \ifdim #1\p@ > \numberPI\p@
                      520                   \SUBTRACT{#1}{\numberTWOPI}{#2}
                      521                   \REDUCERADIANSANGLE{#2}{#2}
                      522           \fi
                      523           \ifdim #1\p@ = -180\p@ \COPY{\numberPI}{#2} \fi}
                                                                    43
               549                  \DEGREESSIN{\cctr@tempb}{#2}
               550            \else
               551               \ifdim #1\p@<90\p@
               552                      \DEGtoRAD{#1}{\cctr@tempb}
               553                      \@BASICSINE{\cctr@tempb}{#2}
               554                    \else
               555                          \ifdim #1\p@<270\p@
               556                            \SUBTRACT{180}{#1}{\cctr@tempb}
               557                             \DEGREESSIN{\cctr@tempb}{#2}
               558                            \else
               559                                  \SUBTRACT{#1}{360}{\cctr@tempb}
               560                                  \DEGREESSIN{\cctr@tempb}{#2}
               561   \fi\fi\fi\fi\fi\fi\@OUTPUTSOL{#2}}
                                                             44
                593          \ifdim #2\p@ = \z@
                594          \cctr@Warninfcotan{#1}
                595          \let#2\undefined
                596          \else
                597          \DIVIDE{1}{#2}{#2}
                598          \fi\fi\@OUTPUTSOL{#2}}
                For an arbitrary number of degrees, we normalise to 360 degrees and, then, call the former
                functions.
\@@DEGREESSIN   \@@DEGREESSIN computes the sine. A circle has #1 degrees.
                599   \def\@@DEGREESSIN[#1]#2#3{\@CONVERTDEG{#1}{#2}
                600           \@DEGREESSIN{\@DEGREES}{#3}}
                Exponential functions
        \EXP    \EXP[h#1 i]{h#2 i}{h#3 i} computes the exponential #3 = #1#2 . Default for #1 is number
                e.
                609   \def\EXP{\@ifnextchar[\@@EXP\@EXP}
                                                              45
    \@EXP    \@EXP{h#1 i}{h#2 i} computes #3 = e#2
             620 \def\@EXP#1#2{%
             621       \begingroup
             622       \ABSVALUE{#1}{\cctr@absval}
             If |t| is greater than \cctr@logmaxnum then exp t is too large.
             623      \ifdim \cctr@absval\p@>\cctr@logmaxnum\p@
             624              \cctr@Warninfexp{#1}
             625             \let#2\undefined
             626      \else
             627          \ifdim #1\p@ < \z@
                                                                                                 2
             We call \@BASICEXP when t ∈ [−6, 3]. Otherwise we use the equality exp t = (exp t/2) .
             628             \ifdim #1\p@ > -6.00002\p@
             629                \@BASICEXP{#1}{#2}
             630             \else
             631                \DIVIDE{#1}{2}{\cctr@expt}
             632                \@EXP{\cctr@expt}{\cctr@expy}
             633                \SQUARE{\cctr@expy}{#2}
             634             \fi
             635           \else
             636                \ifdim #1\p@ < 3.00002\p@
             637                   \@BASICEXP{#1}{#2}
             638                \else
             639                   \DIVIDE{#1}{2}{\cctr@expt}
             640                   \@EXP{\cctr@expt}{\cctr@expy}
             641                   \SQUARE{\cctr@expy}{#2}
             642                \fi
             643 \fi\fi\@OUTPUTSOL{#2}}
                                                                  2x
                                       exp x ≈ 1 +
                                                                  x2 /6
                                                     2−x+
                                                                   x2 /60
                                                            1+
                                                                     x2 /140
                                                               1+
                                                                        x2 /256
                                                                  1+
                                                                             x2
                                                                       1+
                                                                            396
             644 \def\@BASICEXP#1#2{%
             645        \begingroup
             646        \SQUARE{#1}\cctr@tempa
             647        \DIVIDE{\cctr@tempa}{396}{#2}
             648        \ADD{1}{#2}{#2}
             649        \DIVIDE\cctr@tempa{#2}{#2}
             650        \DIVIDE{#2}{256}{#2}
             651        \ADD{1}{#2}{#2}
             652        \DIVIDE\cctr@tempa{#2}{#2}
             653        \DIVIDE{#2}{140}{#2}
                                                            46
        654       \ADD{1}{#2}{#2}
        655       \DIVIDE\cctr@tempa{#2}{#2}
        656       \DIVIDE{#2}{60}{#2}
        657       \ADD{1}{#2}{#2}
        658       \DIVIDE\cctr@tempa{#2}{#2}
        659       \DIVIDE{#2}{6}{#2}
        660       \ADD{2}{#2}{#2}
        661       \SUBTRACT{#2}{#1}{#2}
        662       \DIVIDE{#1}{#2}{#2}
        663       \MULTIPLY{2}{#2}{#2}
        664       \ADD{1}{#2}{#2}\@OUTPUTSOL{#2}}
        Hyperbolic functions
\COSH   \COSH. Hyperbolic cosine: cosh t = (exp t + exp(−t))/2.
        665 \def\COSH#1#2{%
        666        \begingroup
        667        \ABSVALUE{#1}{\cctr@absval}
        668        \ifdim \cctr@absval\p@>\cctr@logmaxnum\p@
        669           \cctr@Warninfexp{#1}
        670           \let#2\undefined
        671        \else
        672           \EXP{#1}{\cctr@expx}
        673           \MULTIPLY{-1}{#1}{\cctr@minust}
        674           \EXP{\cctr@minust}{\cctr@expminusx}
        675           \ADD{\cctr@expx}{\cctr@expminusx}{#2}
        676           \DIVIDE{#2}{2}{#2}
        677        \fi\@OUTPUTSOL{#2}}
                                                      47
        696            \let#2\undefined
        697         \else
        698            \SINH{#1}{\cctr@tanhnum}
        699            \COSH{#1}{\cctr@tanhden}
        700            \DIVIDE{\cctr@tanhnum}{\cctr@tanhden}{#2}
        701         \fi\@OUTPUTSOL{#2}}
        Logarithm
\LOG    \LOG[h#1 i]{h#2 i}{h#3 i} computes the logarithm #3 = log#1 #2. Default for #1 is number
        e.
        713   \def\LOG{\@ifnextchar[\@@LOG\@LOG}
                                                          48
             For t ∈ [1, e2 ] we call \@@BASICLOG.
             730                \@BASICLOG{#1}{#2}
             731   \fi\fi\fi\@OUTPUTSOL{#2}}
                                                                    t
                                                     xn+1 = xn +         −1
                                                                   exn
             736 \def\@BASICLOG#1#2{\begingroup
             737 % We take $\textit{\#1}-1$ as the initial approximation.
             738 %    \begin{macrocode}
             739              \SUBTRACT{#1}{1}{\cctr@tempw}
                   We start with \cctr@lengthb=5\p@ to ensure almost one iteration.
             740               \cctr@lengthb=5\p@%
             741               \cctr@epsilon=2\cctr@epsilon%
             Successive iterations
             742         \@whilenum \cctr@lengthb>\cctr@epsilon \do {%
             743             \COPY{\cctr@tempw}{\cctr@tempoldw}
             744             \EXP{\cctr@tempw}{\cctr@tempxw}
             745             \DIVIDE{#1}{\cctr@tempxw}{\cctr@tempxw}
             746             \ADD{\cctr@tempw}{\cctr@tempxw}{\cctr@tempw}
             747             \SUBTRACT{\cctr@tempw}{1}{\cctr@tempw}
             748             \SUBTRACT{\cctr@tempw}{\cctr@tempoldw}{\cctr@tempdif}
             749             \cctr@lengthb=\cctr@tempdif\p@%
             750             \ifnum
             751                \cctr@lengthb<\z@ \cctr@lengthb=-\cctr@lengthb
             752             \fi}%
             753         \COPY{\cctr@tempw}{#2}\@OUTPUTSOL{#2}}
                                                             49
763                \COPY{-\numberHALFPI}{#2}
764              \else
765                 \ifdim #1\p@ > 1\p@
766                    \let#2\undefined
767                    \cctr@Warnbigarcsin{#1}
768                 \else
769                    \ifdim #1\p@ < -1\p@
770                       \let#2\undefined
771                       \cctr@Warnbigarcsin{#1}
772                    \else
                                                      p
If x is close to 1 we use arcsin x = π/2 − 2 arcsin       (1 − x)/2
773                        \ifdim #1\p@ >0.89\p@
774                        \SUBTRACT{1}{#1}{\cctr@tempx}
775                        \DIVIDE{\cctr@tempx}{2}{\cctr@tempx}
776                        \SQRT{\cctr@tempx}{\cctr@tempxx}
777                        \ARCSIN{\cctr@tempxx}{#2}
778                        \MULTIPLY{2}{#2}{#2}
779                        \SUBTRACT{\numberHALFPI}{#2}{#2}
780                        \else
                                                                  p
Symmetrically, for x close to −1, arcsin x = −π/2 + 2 arcsin       (1 + x)/2
781                        \ifdim #1\p@ <-0.89\p@
782                        \ADD{1}{#1}{\cctr@tempx}
783                        \DIVIDE{\cctr@tempx}{2}{\cctr@tempx}
784                        \SQRT{\cctr@tempx}{\cctr@tempxx}
785                        \ARCSIN{\cctr@tempxx}{#2}
786                        \MULTIPLY{2}{#2}{#2}
787                        \SUBTRACT{#2}{\numberHALFPI}{#2}
788                        \else
We take #1 as the initial approximation.
789                           \COPY{#1}{#2}
If −0.4 ≤ t ≤ 0.4 then arcsin x ≈ x is a good approximation. Else, we apply the Newton method
790                           \ABSVALUE{#1}{\cctr@tempy}
791                           \ifdim \cctr@tempy\p@ < 0.04\p@
792                           \else
\cctr@lengthb will be the difference of two successive iterations, and \cctr@tempoldy,
\cctr@tempy will be the two last iterations.
   We start with \cctr@lengthb=5\p@ and \cctr@tempy=16383 to ensure almost one iteration.
793                               \cctr@lengthb=5\p@
794                               \COPY{16383}{\cctr@tempy}
Successive iterations
795                               \@whilenum \cctr@lengthb>\cctr@epsilon \do {%
Copy the actual approximation to \cctr@tempw
796                                 \COPY{#2}{\cctr@tempw}
797                                 \COPY{\cctr@tempy}{\cctr@tempoldy}
798                                 \SIN{\cctr@tempw}{\cctr@tempz}
799                                 \SUBTRACT{\cctr@tempz}{#1}{\cctr@tempz}
                                                50
          800                                 \COS{\cctr@tempw}{\cctr@tempy}
          801                                 \DIVIDE{\cctr@tempz}{\cctr@tempy}{\cctr@tempz}
          802                                 \SUBTRACT{\cctr@tempw}{\cctr@tempz}{\cctr@tempz}
          Now, \cctr@tempz is the new approximation.
          803                                 \COPY{\cctr@tempz}{#2}
          Finally, we store in \cctr@lengthb the difference of the two last approximations, finishing the
          loop.
          804                                 \SUBTRACT{#2}{\cctr@tempw}{\cctr@tempy}
          805                                 \ABSVALUE{\cctr@tempy}{\cctr@tempy}
          806                                 \cctr@lengthb=\cctr@tempy\p@%
          807                                 \ifdim\cctr@tempy\p@=\cctr@tempoldy\p@
          808                                    \cctr@lengthb=\z@
          809                                 \fi}\fi\fi\fi\fi\fi\fi\fi\fi\@OUTPUTSOL{#2}}
\ARCCOS   \ARCCOS{h#1 i}{h#2 i} defines #2 as the arccos of #1, using the well know relation arccos x =
          π/2 − arcsin x.
          810 \def\ARCCOS#1#2{%
          811        \begingroup
          812        \ifdim #1\p@ = \z@
          813          \COPY{\numberHALFPI}{#2}
          814        \else
          815          \ifdim #1\p@ = 1\p@
          816             \COPY{0}{#2}
          817           \else
          818              \ifdim #1\p@ = -1\p@
          819                \COPY{\numberPI}{#2}
          820              \else
          821                 \ifdim #1\p@ > 1\p@
          822                    \let#2\undefined
          823                    \cctr@Warnbigarccos{#1}
          824                 \else
          825                    \ifdim #1\p@ < -1\p@
          826                       \let#2\undefined
          827                       \cctr@Warnbigarccos{#1}
          828                    \else
          829                       \ARCSIN{#1}{#2}
          830                       \SUBTRACT{\numberHALFPI}{#2}{#2}
          831        \fi\fi\fi\fi\fi\@OUTPUTSOL{#2}}
                                                         51
                839                        \ifdim#1\p@>1\p@
                840                           \DIVIDE{1}{#1}{\cctr@tempb}
                841                           \ARCTAN{\cctr@tempb}{#2}
                842                           \SUBTRACT{\numberHALFPI}{#2}{#2}
                843                        \else
                For −1 ≤ x ≤ 1 call \@BASICARCTAN.
                844                           \@BASICARCTAN{#1}{#2}
                845                        \fi
                846                     \fi\@OUTPUTSOL{#2}}
                                                                   52
          874                  \DIVIDE{#1}{#2}{#2}
          875            \fi\@OUTPUTSOL{#2}}
\ARCCOT   \ARCCOT{h#1 i}{h#2 i} defines #2 as the arccot of #1, using the well know relation arccot x =
          π/2 − arctan x.
          876 \def\ARCCOT#1#2{%
          877        \begingroup
          878           \ARCTAN{#1}{#2}
          879           \SUBTRACT{\numberHALFPI}{#2}{#2}
          880        \@OUTPUTSOL{#2}}
                                                       53
              909               \cctr@Warnbigartanh{#1}
              910            \else
              911               \COPY{#1}{\cctr@tempa}
              912               \ADD1\cctr@tempa\cctr@tempb
              913               \SUBTRACT1\cctr@tempa\cctr@tempc
              914               \LOG\cctr@tempb\cctr@tempB
              915               \LOG\cctr@tempc\cctr@tempC
              916               \SUBTRACT\cctr@tempB\cctr@tempC{#2}
              917               \DIVIDE{#2}{2}{#2}
              918            \fi
              919         \fi\@OUTPUTSOL{#2}}
                                                                 54
                    944   \def\@VECTORSIZE(#1,#2,#3,#4)#5{\ifx$#3$\COPY{2}{#5}
                    945                                   \else\COPY{3}{#5}\fi\ignorespaces}
  \@OUTPUTVECTOR
                    968 \def\@@OUTPUTVECTOR(#1,#2){%
                    969     \VECTORGLOBALCOPY(#1,#2)(\cctr@outa,\cctr@outb)
                    970     \endgroup\VECTORCOPY(\cctr@outa,\cctr@outb)(#1,#2)}
                    971
                    972 \def\@@@OUTPUTVECTOR(#1,#2,#3){%
                    973     \VECTORGLOBALCOPY(#1,#2,#3)(\cctr@outa,\cctr@outb,\cctr@outc)
                    974     \endgroup\VECTORCOPY(\cctr@outa,\cctr@outb,\cctr@outc)(#1,#2,#3)}
                    975
                    976 \def\@OUTPUTVECTOR(#1){\VECTORSIZE(#1){\cctr@size}
                    977         \ifnum\cctr@size=2
                    978            \@@OUTPUTVECTOR(#1)
                    979         \else \@@@OUTPUTVECTOR(#1)\fi}
                                                                   55
                 985 \def\@@@SCALARPRODUCT(#1,#2,#3)(#4,#5,#6)#7{%
                 986        \MULTIPLY{#1}{#4}{#7}
                 987        \MULTIPLY{#2}{#5}\cctr@tempa
                 988        \ADD{#7}{\cctr@tempa}{#7}
                 989        \MULTIPLY{#3}{#6}\cctr@tempa
                 990        \ADD{#7}{\cctr@tempa}{#7}}
                 991
                 992 \def\SCALARPRODUCT(#1)(#2)#3{%
                 993         \begingroup
                 994         \VECTORSIZE(#1){\cctr@size}
                 995         \ifnum\cctr@size=2
                 996            \@@SCALARPRODUCT(#1)(#2){#3}
                 997         \else \@@@SCALARPRODUCT(#1)(#2){#3}\fi\@OUTPUTSOL{#3}}
                                                                56
                       1026          \VECTORSIZE(#1){\cctr@size}
                       1027          \ifnum\cctr@size=2
                       1028             \@@VECTORADD(#1)(#2)(#3)
                       1029          \else \@@@VECTORADD(#1)(#2)(#3)\fi}
                                                                      57
                   1068         \SCALARPRODUCT(#1)(#1){\cctr@temp}
                   1069         \SQUAREROOT{\cctr@temp}{#2}\@OUTPUTSOL{#2}}
                    Matrix operations
                    Here, we need to define some internal macros to simulate commands with more than nine
                    arguments.
  \@TDMATRIXCOPY    This command copies a 3 × 3 matrix to the commands \cctr@solAA, \cctr@solAB, . . . ,
                    \cctr@solCC.
                   1092 \def\@TDMATRIXCOPY(#1,#2,#3;#4,#5,#6;#7,#8,#9){%
                   1093        \COPY{#1}{\cctr@solAA}
                   1094        \COPY{#2}{\cctr@solAB}
                   1095        \COPY{#3}{\cctr@solAC}
                   1096        \COPY{#4}{\cctr@solBA}
                   1097        \COPY{#5}{\cctr@solBB}
                   1098        \COPY{#6}{\cctr@solBC}
                   1099        \COPY{#7}{\cctr@solCA}
                   1100        \COPY{#8}{\cctr@solCB}
                   1101        \COPY{#9}{\cctr@solCC}}
                                                                  58
                      1103         \COPY{\cctr@solAA}{#1}
                      1104         \COPY{\cctr@solAB}{#2}
                      1105         \COPY{\cctr@solAC}{#3}
                      1106         \COPY{\cctr@solBA}{#4}
                      1107         \COPY{\cctr@solBB}{#5}
                      1108         \COPY{\cctr@solBC}{#6}
                      1109         \COPY{\cctr@solCA}{#7}
                      1110         \COPY{\cctr@solCB}{#8}
                      1111         \COPY{\cctr@solCC}{#9}}
\@TDMATRIXGLOBALSOL
                      1112 \def\@TDMATRIXGLOBALSOL(#1,#2,#3;#4,#5,#6;#7,#8,#9){%
                      1113        \GLOBALCOPY{\cctr@solAA}{#1}
                      1114        \GLOBALCOPY{\cctr@solAB}{#2}
                      1115        \GLOBALCOPY{\cctr@solAC}{#3}
                      1116        \GLOBALCOPY{\cctr@solBA}{#4}
                      1117        \GLOBALCOPY{\cctr@solBB}{#5}
                      1118        \GLOBALCOPY{\cctr@solBC}{#6}
                      1119        \GLOBALCOPY{\cctr@solCA}{#7}
                      1120        \GLOBALCOPY{\cctr@solCB}{#8}
                      1121        \GLOBALCOPY{\cctr@solCC}{#9}}
   \@TDMATRIXNOSOL     This command undefines a 3 × 3 matrix when a matrix problem has no solution.
                      1122 \def\@TDMATRIXNOSOL(#1,#2,#3;#4,#5,#6;#7,#8,#9){%
                      1123           \let#1\undefined
                      1124           \let#2\undefined
                      1125           \let#3\undefined
                      1126           \let#4\undefined
                      1127           \let#5\undefined
                      1128           \let#6\undefined
                      1129           \let#7\undefined
                      1130           \let#8\undefined
                      1131           \let#9\undefined
                      1132           }
                                                                       59
     \MATRIXCOPY     Store a matrix in 4 or 9 commands.
                    1142   \def\@@MATRIXCOPY(#1,#2;#3,#4)(#5,#6;#7,#8){%
                    1143       \COPY{#1}{#5}\COPY{#2}{#6}\COPY{#3}{#7}\COPY{#4}{#8}}
                    1144
                    1145 \def\@@@MATRIXCOPY(#1,#2,#3;#4,#5,#6;#7,#8,#9){%
                    1146      \@TDMATRIXCOPY(#1,#2,#3;#4,#5,#6;#7,#8,#9)
                    1147      \@TDMATRIXSOL}
                    1148
                    1149 \def\MATRIXCOPY(#1)(#2){%
                    1150         \MATRIXSIZE(#1){\cctr@size}
                    1151         \ifnum\cctr@size=2
                    1152            \@@MATRIXCOPY(#1)(#2)
                    1153         \else \@@@MATRIXCOPY(#1)(#2)\fi}
  \@OUTPUTMATRIX
                    1166 \def\@@OUTPUTMATRIX(#1,#2;#3,#4){%
                    1167     \MATRIXGLOBALCOPY(#1,#2;#3,#4)(\cctr@outa,\cctr@outb;\cctr@outc,\cctr@outd)
                    1168     \endgroup\MATRIXCOPY(\cctr@outa,\cctr@outb;\cctr@outc,\cctr@outd)(#1,#2;#3,#4)}
                    1169
                    1170 \def\@@@OUTPUTMATRIX(#1,#2,#3;#4,#5,#6;#7,#8,#9){%
                    1171     \MATRIXGLOBALCOPY(#1,#2,#3;#4,#5,#6;#7,#8,#9)(%
                    1172         \cctr@outa,\cctr@outb,\cctr@outc;
                    1173         \cctr@outd,\cctr@oute,\cctr@outf;
                    1174         \cctr@outg,\cctr@outh,\cctr@outi)
                    1175     \endgroup\MATRIXCOPY(%
                    1176         \cctr@outa,\cctr@outb,\cctr@outc;
                    1177         \cctr@outd,\cctr@oute,\cctr@outf;
                    1178         \cctr@outg,\cctr@outh,\cctr@outi)(#1,#2,#3;#4,#5,#6;#7,#8,#9)}
                    1179
                    1180 \def\@OUTPUTMATRIX(#1){\MATRIXSIZE(#1){\cctr@size}
                    1181         \ifnum\cctr@size=2
                    1182            \@@OUTPUTMATRIX(#1)
                    1183         \else \@@@OUTPUTMATRIX(#1)\fi}
                                                                    60
                  1185       \COPY{#1}{#5}\COPY{#3}{#6}\COPY{#2}{#7}\COPY{#4}{#8}}
                  1186
                  1187 \def\@@@TRANSPOSEMATRIX(#1,#2,#3;#4,#5,#6;#7,#8,#9){%
                  1188        \@TDMATRIXCOPY(#1,#4,#7;#2,#5,#8;#3,#6,#9)
                  1189        \@TDMATRIXSOL}
                  1190
                  1191 \def\TRANSPOSEMATRIX(#1)(#2){%
                  1192         \begingroup
                  1193         \MATRIXSIZE(#1){\cctr@size}
                  1194         \ifnum\cctr@size=2
                  1195            \@@TRANSPOSEMATRIX(#1)(#2)
                  1196         \else \@@@TRANSPOSEMATRIX(#1)(#2)\fi\@OUTPUTMATRIX(#2)}
                                                                 61
                       1229   \def\@@MATRIXABSVALUE(#1;#2)(#3;#4){%
                       1230          \VECTORABSVALUE(#1)(#3)\VECTORABSVALUE(#2)(#4)}
                       1231
                       1232   \def\@@@MATRIXABSVALUE(#1;#2;#3)(#4;#5;#6){%
                       1233          \VECTORABSVALUE(#1)(#4)\VECTORABSVALUE(#2)(#5)\VECTORABSVALUE(#3)(#6)}
                       1234
                       1235 \def\MATRIXABSVALUE(#1)(#2){%
                       1236         \begingroup
                       1237         \MATRIXSIZE(#1){\cctr@size}
                       1238         \ifnum\cctr@size=2
                       1239            \@@MATRIXABSVALUE(#1)(#2)
                       1240         \else \@@@MATRIXABSVALUE(#1)(#2)\fi\@OUTPUTMATRIX(#2)}
                                                                      62
                 1273 \def\@@SCALARMATRIXPRODUCT#1(#2;#3)(#4,#5;#6,#7){%
                 1274        \SCALARVECTORPRODUCT{#1}(#2)(#4,#5)
                 1275        \SCALARVECTORPRODUCT{#1}(#3)(#6,#7)}
                 1276
                 1277 \def\@@@SCALARMATRIXPRODUCT#1(#2;#3;#4){%
                 1278        \SCALARVECTORPRODUCT{#1}(#2)(\cctr@solAA,\cctr@solAB,\cctr@solAC)
                 1279        \SCALARVECTORPRODUCT{#1}(#3)(\cctr@solBA,\cctr@solBB,\cctr@solBC)
                 1280        \SCALARVECTORPRODUCT{#1}(#4)(\cctr@solCA,\cctr@solCB,\cctr@solCC)
                 1281        \@TDMATRIXSOL}
                 1282
                 1283 \def\SCALARMATRIXPRODUCT#1(#2)(#3){%
                 1284         \begingroup
                 1285         \MATRIXSIZE(#2){\cctr@size}
                 1286         \ifnum\cctr@size=2
                 1287            \@@SCALARMATRIXPRODUCT{#1}(#2)(#3)
                 1288         \else \@@@SCALARMATRIXPRODUCT{#1}(#2)(#3)\fi\@OUTPUTMATRIX(#3)}
                                                               63
                 1319          \begingroup
                 1320          \MATRIXSIZE(#1){\cctr@size}
                 1321          \ifnum\cctr@size=2
                 1322             \@@DETERMINANT(#1){#2}
                 1323          \else \@@@DETERMINANT(#1){#2}\fi\@OUTPUTSOL{#2}}
                                                                64
                     1367            \DETERMINANT(#3,#1;#6,#4){\cctr@solBC}
                     1368            \DETERMINANT(#1,#2;#4,#5){\cctr@solCC}}
                     1369
                     1370 \def\INVERSEMATRIX(#1)(#2){%
                     1371         \begingroup
                     1372         \DETERMINANT(#1){\cctr@det}
                     1373         \ABSVALUE{\cctr@det}{\cctr@@det}
                     1374         \MATRIXSIZE(#1){\cctr@size}
                     1375         \ifnum\cctr@size=2
                     1376            \@@INVERSEMATRIX(#1)(#2)
                     1377         \else
                     1378            \@@@INVERSEMATRIX(#1)(#2)\fi\@OUTPUTMATRIX(#2)}
\SOLVELINEARSYSTEM    Solving a linear system (two equations and two unknowns or three equations and three un-
                      knowns).
                     1379   \def\@INCSYS#1#2{\cctr@WarnIncLinSys
                     1380          \let#1\undefined\let#2\undefined}
                     1381
                     1382 \def\@SOLPART#1#2#3#4{\cctr@WarnIndLinSys
                     1383                       \DIVIDE{#1}{#2}{#3}
                     1384                       \COPY{0}{#4}}
                     1385
                     1386 \def\@TDINCSYS(#1,#2,#3){\cctr@WarnIncTDLinSys
                     1387                          \let#1\undefined
                     1388                          \let#2\undefined
                     1389                          \let#3\undefined}
                     1390
                     1391 \def\@@SOLVELINEARSYSTEM(#1,#2;#3,#4)(#5,#6)(#7,#8){%
                     1392         \DETERMINANT(#1,#2;#3,#4)\cctr@deta
                     1393         \DETERMINANT(#5,#2;#6,#4)\cctr@detb
                     1394         \DETERMINANT(#1,#5;#3,#6)\cctr@detc
                     1395         \ABSVALUE{\cctr@deta}{\cctr@@deta}
                     1396         \ABSVALUE{\cctr@detb}{\cctr@@detb}
                     1397         \ABSVALUE{\cctr@detc}{\cctr@@detc}
                     1398         \ifdim \cctr@@deta\p@>\cctr@epsilon% Regular matrix. Determinate system
                     1399            \DIVIDE{\cctr@detb}{\cctr@deta}{#7}
                     1400            \DIVIDE{\cctr@detc}{\cctr@deta}{#8}
                     1401         \else % Singular matrix     \cctr@deta=0
                     1402            \ifdim \cctr@@detb\p@>\cctr@epsilon% Incompatible system
                     1403               \@INCSYS#7#8
                     1404            \else
                     1405               \ifdim \cctr@@detc\p@>\cctr@epsilon% Incompatible system
                     1406                  \@INCSYS#7#8
                     1407               \else
                     1408                  \MATRIXABSVALUE(#1,#2;#3,#4)(\cctr@tempa,\cctr@tempb;
                     1409                                               \cctr@tempc,\cctr@tempd)
                     1410                  \ifdim \cctr@tempa\p@ > \cctr@epsilon
                     1411                                                % Indeterminate system
                     1412                     \@SOLPART{#5}{#1}{#7}{#8}
                     1413                  \else
                                                                       65
               1414                      \ifdim \cctr@tempb\p@ > \cctr@epsilon
               1415                                                 % Indeterminate system
               1416                         \@SOLPART{#5}{#2}{#8}{#7}
               1417                      \else
               1418                         \ifdim \cctr@tempc\p@ > \cctr@epsilon
               1419                                                 % Indeterminate system
               1420                            \@SOLPART{#6}{#3}{#7}{#8}
               1421                         \else
               1422                            \ifdim \cctr@tempd\p@ > \cctr@epsilon
               1423                                                 % Indeterminate system
               1424                               \@SOLPART{#6}{#4}{#8}{#7}
               1425                            \else
               1426                               \VECTORNORM(#5,#6){\cctr@tempa}
               1427                               \ifdim \cctr@tempa\p@ > \cctr@epsilon
               1428                                                 % Incompatible system
               1429                                  \@INCSYS#7#8
               1430                               \else
               1431                                     \cctr@WarnZeroLinSys
               1432                                     \COPY{0}{#7}\COPY{0}{#8}
               1433                                                 % 0x=0 Indeterminate system
               1434          \fi\fi\fi\fi\fi\fi\fi\fi}
               1435
               1436 \def\@@@SOLVELINEARSYSTEM(#1)(#2)(#3){%
               1437        \DETERMINANT(#1){\cctr@det}
               1438        \ABSVALUE{\cctr@det}{\cctr@@det}
               1439        \ifdim\cctr@@det\p@<\cctr@epsilon
               1440           \@TDINCSYS(#3)
               1441           \else
               1442              \@ADJMATRIX(#1)
               1443              \MATRIXVECTORPRODUCT(\cctr@solAA,\cctr@solAB,\cctr@solAC;
               1444                                   \cctr@solBA,\cctr@solBB,\cctr@solBC;
               1445                                   \cctr@solCA,\cctr@solCB,\cctr@solCC)(#2)(#3)
               1446              \@SCLRDIVVECT{\cctr@det}(#3)(#3)
               1447           \fi}
               1448
               1449 \def\SOLVELINEARSYSTEM(#1)(#2)(#3){%
               1450         \begingroup
               1451         \MATRIXSIZE(#1){\cctr@size}
               1452         \ifnum\cctr@size=2
               1453            \@@SOLVELINEARSYSTEM(#1)(#2)(#3)
               1454         \else
               1455            \@@@SOLVELINEARSYSTEM(#1)(#2)(#3)
               1456         \fi\@OUTPUTVECTOR(#3)}
                Predefined numbers
  \numberPI     The number π
               1457   \def\numberPI{3.14159}
\numberTWOPI 2π
                                                             66
                     1458   \MULTIPLY{\numberPI}{2}{\numberTWOPI}
     \numberHALFPI    π/2
                     1459   \DIVIDE{\numberPI}{2}{\numberHALFPI}
\numberTHREEHALFPI    3π/2
                     1460   \MULTIPLY{\numberPI}{1.5}{\numberTHREEHALFPI}
   \numberTHIRDPI     π/3
                     1461   \DIVIDE{\numberPI}{3}{\numberTHIRDPI}
  \numberQUARTERPI    π/4
                     1462   \DIVIDE{\numberPI}{4}{\numberQUARTERPI}
   \numberFIFTHPI     π/5
                     1463   \DIVIDE{\numberPI}{5}{\numberFIFTHPI}
   \numberSIXTHPI     π/6
                     1464   \DIVIDE{\numberPI}{6}{\numberSIXTHPI}
      \numberINVE     1/e
                     1466   \DIVIDE{1}{\numberE}{\numberINVE}
      \numberETWO     e2
                     1467   \SQUARE{\numberE}{\numberETWO}
   \numberINVETWO     1/e2
                     1468   \SQUARE{\numberINVE}{\numberINVETWO}
     \numberLOGTEN    log 10
                     1469   \def\numberLOGTEN{2.30258}
   \numberINVGOLD     1/φ
                     1471   \def\numberINVGOLD{0.61803}
                      √
   \numberSQRTTWO           2
                     1472   \def\numberSQRTTWO{1.41421}
                      √
  \numberSQRTTHREE          3
                     1473   \def\numberSQRTTHREE{1.73205}
                      √
  \numberSQRTFIVE           5
                     1474   \def\numberSQRTFIVE{2.23607}
                                                                      67
\numberCOSXLV    cos 45o (or cos π/4)
                1475   \def\numberCOSXLV{0.70711}
1477 h/calculatori
                 14         calculus
                1478 h∗calculusi
                1479 \NeedsTeXFormat{LaTeX2e}
                1480 \ProvidesPackage{calculus}[2014/02/20 v.2.0]
                                                                 68
               1502        {The \noexpand#1 control sequence is already defined\MessageBreak
               1503         If you want to redefine the \noexpand#1
               1504         command as a polar function\MessageBreak
               1505         please, use the \noexpand\renewpolarfunction command}}
               1506
               1507 \def\ccls@ErrorPFuncUnDef#1{%
               1508       \PackageError{calculus}%
               1509         {\noexpand#1 command undefined}
               1510         {The \noexpand#1 control sequence
               1511          is not currently defined.\MessageBreak
               1512          If you want to define the \noexpand#1 command as a polar
               1513          function\MessageBreak
               1514          please, use the \noexpand\newpolarfunction command}}
               1515
               1516 \def\ccls@InfoPFuncEns#1{%
               1517       \PackageInfo{calculus}%
               1518       {\noexpand#1 command already defined\MessageBreak
               1519        the \noexpand\ensurepolarfunction command does not redefine it}}
                For vector functions
               1520 \def\ccls@ErrorVFuncDef#1{%
               1521       \PackageError{calculus}%
               1522         {\noexpand#1 command already defined}
               1523         {The \noexpand#1 control sequence is already defined\MessageBreak
               1524          If you want to redefine the \noexpand#1 command as a vector
               1525          function\MessageBreak
               1526          please, use the \noexpand\renewvectorfunction command}}
               1527
               1528 \def\ccls@ErrorVFuncUnDef#1{%
               1529       \PackageError{calculus}%
               1530         {\noexpand#1 command undefined}
               1531         {The \noexpand#1 control sequence is not currently
               1532          defined.\MessageBreak
               1533          If you want to define the \noexpand#1 command as a vector
               1534          function\MessageBreak
               1535          please, use the \noexpand\newvectorfunction command}}
               1536
               1537 \def\ccls@InfoVFuncEns#1{%
               1538       \PackageInfo{calculus}%
               1539       {\noexpand#1 command already defined\MessageBreak
               1540        the \noexpand\ensurevectorfunction command does not redefine it}}
                                                            69
                      1544         \else
                      1545            \ccls@ErrorFuncDef{#1}
                      1546         \fi}
    \renewfunction     \renewfunction redefines #1, as a new function, if this command is already defined.
                      1547 \def\renewfunction#1#2{%
                      1548        \ifx #1\undefined
                      1549           \ccls@ErrorFuncUnDef{#1}
                      1550        \else
                      1551           \ccls@deffunction{#1}{#2}
                      1552        \fi}
   \ensurefunction     \ensurefunction defines the new function #1 (only if this macro is undefined).
                      1553 \def\ensurefunction#1#2{%
                      1554        \ifx #1\undefined\ccls@deffunction{#1}{#2}
                      1555        \else
                      1556           \ccls@InfoFuncEns{#1}
                      1557        \fi}
    \forcefunction     \forcefunction defines (if undefined) or redefines (if defined) the new function #1.
                      1558   \def\forcefunction#1#2{%
                      1559          \ccls@deffunction{#1}{#2}}
  \ccls@deffunction    The private \ccls@deffunction command makes the real work. The new functions will have
                       three arguments: ##1, a number, ##2, the value of the new function in that number, and
                       ##3, the derivative.
                      1560 \def\ccls@deffunction#1#2{%
                      1561     \def#1##1##2##3{%
                      1562              \begingroup
                      1563              \def\t{##1}%
                      1564                   #2
                      1565                  \xdef##2{\y}%
                      1566                  \xdef##3{\Dy}%
                      1567              \endgroup}\ignorespaces}
                                                                     70
                         1576            \ccls@ErrorPFuncUnDef{#1}
                         1577         \else
                         1578            \ccls@defpolarfunction{#1}{#2}
                         1579         \fi}
\ccls@defpolarfunction    The private \ccls@defpolarfunction command makes the real work. The new functions will
                          have three arguments: ##1, a number (the polar radius), ##2, ##3, ##4, and ##5, the x
                          and y component functions and its derivatives at ##1.
                         1587 \def\ccls@defpolarfunction#1#2{%
                         1588        \def#1##1##2##3##4##5{%
                         1589        \begingroup
                         1590           \def\t{##1}
                         1591        #2
                         1592        \COS{\t}\ccls@cost
                         1593        \MULTIPLY\r\ccls@cost{\x}
                         1594        \SIN{\t}\ccls@sint
                         1595        \MULTIPLY\r\ccls@sint{\y}
                         1596        \MULTIPLY\ccls@cost\Dr\Dx
                         1597        \SUBTRACT{\Dx}{\y}{\Dx}
                         1598        \MULTIPLY\ccls@sint\Dr\Dy
                         1599        \ADD{\Dy}{\x}{\Dy}
                         1600        \xdef##2{\x}
                         1601        \xdef##3{\Dx}
                         1602        \xdef##4{\y}
                         1603        \xdef##5{\Dy}
                         1604        \endgroup}\ignorespaces}
                                                                          71
  \renewvectorfunction     \renewvectorfunction redefines #1 if already defined.
                          1611 \def\renewvectorfunction#1#2{%
                          1612        \ifx #1\undefined
                          1613           \ccls@ErrorVFuncUnDef{#1}
                          1614        \else
                          1615           \ccls@defvectorfunction{#1}{#2}
                          1616        \fi}
\ccls@defvectorfunction    The private \ccls@defvectorfunction command makes the real work. The new functions will
                           have three arguments: ##1, a number, ##2, ##3, ##4, and ##5, the x and y component
                           functions and its derivatives at ##1.
                          1624 \def\ccls@defvectorfunction#1#2{%
                          1625        \def#1##1##2##3##4##5{%
                          1626        \begingroup
                          1627           \def\t{##1}
                          1628        #2
                          1629        \xdef##2{\x}
                          1630        \xdef##3{\Dx}
                          1631        \xdef##4{\y}
                          1632        \xdef##5{\Dy}
                          1633        \endgroup}\ignorespaces}
                           14.3       Polynomials
                           Linear (first degreee) polynomials
             \newlpoly     The \newlpoly{#1}{#2}{#3} instruction defines the linear polynomial
                              #1 = #2 + #3t.
                          1634 \def\newlpoly#1#2#3{%
                          1635     \newfunction{#1}{%
                          1636         \ccls@lpoly{#2}{#3}}}
                                                                           72
\ensurelpoly
               1640 \def\ensurelpoly#1#2#3{%
               1641     \ensurefunction{#1}{%
               1642         \ccls@lpoly{#2}{#3}}}
\forcelpoly
               1643 \def\forcelpoly#1#2#3{%
               1644     \forcefunction{#1}{%
               1645         \ccls@lpoly{#2}{#3}}}
                Quadratic polynomials
  \newqpoly     The \newqpoly{#1}{#2}{#3}{#4} instruction defines the quadratic polynomial
                   #1 = #2 + #3t + #4t2 .
               1650 \def\newqpoly#1#2#3#4{%
               1651     \newfunction{#1}{%
               1652         \ccls@qpoly{#2}{#3}{#4}}}
\renewqpoly
               1653 \def\renewqpoly#1#2#3#4{%
               1654     \renewfunction{#1}{%
               1655         \ccls@qpoly{#2}{#3}{#4}}}
\ensureqpoly
               1656 \def\ensureqpoly#1#2#3#4{%
               1657     \ensurefunction{#1}{%
               1658         \ccls@qpoly{#2}{#3}{#4}}}
\forceqpoly
               1659 \def\forceqpoly#1#2#3#4{%
               1660     \forcefunction{#1}{%
               1661         \ccls@qpoly{#2}{#3}{#4}}}
                                                           73
                 Cubic polynomials
   \newcpoly     The \newcpoly{#1}{#2}{#3}{#4}{#5} instruction defines the cubic polynomial
                    #1 = #2 + #3t + #4t2 + #5t3 .
                1669 \def\newcpoly#1#2#3#4#5{%
                1670     \newfunction{#1}{%
                1671         \ccls@cpoly{#2}{#3}{#4}{#5}}}
 \renewcpoly
                1672 \def\renewcpoly#1#2#3#4#5{%
                1673     \renewfunction{#1}{%
                1674         \ccls@cpoly{#2}{#3}{#4}{#5}}}
\ensurecpoly
                1675 \def\ensurecpoly#1#2#3#4#5{%
                1676     \ensurefunction{#1}{%
                1677         \ccls@cpoly{#2}{#3}{#4}{#5}}}
 \forcecpoly
                1678 \def\forcecpoly#1#2#3#4#5{%
                1679     \forcefunction{#1}{%
                1680         \ccls@cpoly{#2}{#3}{#4}{#5}}}
                                                               74
 \IDENTITYfunction     The \IDENTITYfunction: y(t) = t, y 0 (t) = 1
                      1700 \newfunction{\IDENTITYfunction}{%
                      1701       \COPY{\t}{\y}
                      1702       \COPY{1}{\Dy}}
                                                                         75
     \COTfunction     The \COTfunction: y(t) = cot t, y 0 (t) = −1/(sin t)2
                     1732 \newfunction{\COTfunction}{%
                     1733      \COTAN{\t}{\y}
                     1734      \SIN{\t}{\Dy}
                     1735      \SQUARE{\Dy}{\Dy}
                     1736      \DIVIDE{-1}{\Dy}{\Dy}}
                                                                        √
  \ARCSINfunction     The \ARCSINfunction: y(t) = arcsin t, y 0 (t) = 1/ 1 − t2
                     1759 \newfunction{\ARCSINfunction}{%
                     1760      \ARCSIN{\t}{\y}
                     1761      \SQUARE{\t}{\yy}
                     1762      \SUBTRACT{1}{\yy}{\yy}
                     1763      \SQRT{\yy}{\Dy}
                     1764      \DIVIDE{1}{\Dy}{\Dy}}
                                                                         76
                                                                      √
\ARCCOSfunction    The \ARCCOSfunction: y(t) = arccos t, y 0 (t) = −1/ 1 − t2
                  1765 \newfunction{\ARCCOSfunction}{%
                  1766      \ARCCOS{\t}{\y}
                  1767      \SQUARE{\t}{\yy}
                  1768      \SUBTRACT{1}{\yy}{\yy}
                  1769      \SQRT{\yy}{\Dy}
                  1770      \DIVIDE{-1}{\Dy}{\Dy}}
                                                                  77
                     14.5    Operations with functions
\CONSTANTfunction    \CONSTANTfunction defines #2 as the constant function f (t) = #1.
                    1803 \def\CONSTANTfunction#1#2{%
                    1804               \def#2##1##2##3{%
                    1805                           \xdef##2{#1}%
                    1806                           \xdef##3{0}}}
                                                                   78
                         1842                    #1{##1}{\ccls@QUOf}{\ccls@QUODf}%
                         1843                    #2{##1}{\ccls@QUOg}{\ccls@QUODg}%
                         1844                    \DIVIDE{\ccls@QUOf}{\ccls@QUOg}{\ccls@QUOfg}
                         1845                    \MULTIPLY{\ccls@QUOf}{\ccls@QUODg}{\ccls@QUOfDg}
                         1846                    \MULTIPLY{\ccls@QUODf}{\ccls@QUOg}{\ccls@QUODfg}
                         1847                    \SUBTRACT{\ccls@QUODfg}{\ccls@QUOfDg}{\ccls@QUOnum}
                         1848                    \SQUARE{\ccls@QUOg}{\ccls@qsquaretempg}
                         1849                    \DIVIDE{\ccls@QUOnum}{\ccls@qsquaretempg}{\ccls@QUODfg}
                         1850                         \xdef##2{\ccls@QUOfg}%
                         1851                         \xdef##3{\ccls@QUODfg}%
                         1852             \endgroup}\ignorespaces}
\SCALEVARIABLEfunction    \SCALEVARIABLEfunction scales the variable by number #1 and aplies function #2.
                         1871 \def\SCALEVARIABLEfunction#1#2#3{%
                         1872             \def#3##1##2##3{%
                         1873              \begingroup%
                         1874                     \MULTIPLY{#1}{##1}{\ccls@SCVat}
                         1875                     #2{\ccls@SCVat}{\ccls@SCVf}{\ccls@SCVDf}%
                         1876                     \MULTIPLY{#1}{\ccls@SCVDf}{\ccls@SCVDf}
                         1877                          \xdef##2{\ccls@SCVf}%
                         1878                          \xdef##3{\ccls@SCVDf}%
                         1879              \endgroup}\ignorespaces}
                                                                      79
                            1884                      \POWER{\ccls@POWf}{#2}{\ccls@POWfn}
                            1885                     \SUBTRACT{#2}{1}{\ccls@nminusone}
                            1886                     \POWER{\ccls@POWf}{\ccls@nminusone}{\ccls@POWDfn}
                            1887                    \MULTIPLY{#2}{\ccls@POWDfn}{\ccls@POWDfn}
                            1888                    \MULTIPLY{\ccls@POWDfn}{\ccls@POWDf}{\ccls@POWDfn}
                            1889                           \xdef##2{\ccls@POWfn}%
                            1890                           \xdef##3{\ccls@POWDfn}%
                            1891               \endgroup}\ignorespaces}
LINEARCOMBINATIONfunction    \LINEARCOMBINATIONfunction defines the new function #5 as the linear combination #1#2+#3#4.
                             #1 and #3 are two numbers. #1 and #3 are two functions.
                            1892 \def\LINEARCOMBINATIONfunction#1#2#3#4#5{%
                            1893             \def#5##1##2##3{%
                            1894              \begingroup
                            1895                     #2{##1}{\ccls@LINf}{\ccls@LINDf}%
                            1896                     #4{##1}{\ccls@LINg}{\ccls@LINDg}%
                            1897                     \MULTIPLY{#1}{\ccls@LINf}{\ccls@LINf}
                            1898                     \MULTIPLY{#3}{\ccls@LINg}{\ccls@LINg}
                            1899                     \MULTIPLY{#1}{\ccls@LINDf}{\ccls@LINDf}
                            1900                     \MULTIPLY{#3}{\ccls@LINDg}{\ccls@LINDg}
                            1901                     \ADD{\ccls@LINf}{\ccls@LINg}{\ccls@LINafbg}
                            1902                     \ADD{\ccls@LINDf}{\ccls@LINDg}{\ccls@LINDafbg}
                            1903                          \xdef##2{\ccls@LINafbg}%
                            1904                          \xdef##3{\ccls@LINDafbg}%
                            1905              \endgroup}\ignorespaces}
          \POLARfunction     \POLARfunction defines the polar curve #2. #1 is a previously defined function.
                            1906 \def\POLARfunction#1#2{%
                            1907        \PRODUCTfunction{#1}{\COSfunction}{\ccls@polarx}
                            1908        \PRODUCTfunction{#1}{\SINfunction}{\ccls@polary}
                            1909        \PARAMETRICfunction{\ccls@polarx}{\ccls@polary}{#2}}
     \PARAMETRICfunction     \PARAMETRICfunction defines the parametric curve #3. #1 and #2 are the components func-
                             tions (two previuosly defined functions).
                            1910 \def\PARAMETRICfunction#1#2#3{%
                            1911        \def#3##1##2##3##4##5{%
                            1912                 #1{##1}{##2}{##3}
                            1913                 #2{##1}{##4}{##5}}}
1915 % </calculus>
                                                                            80
Change History
v1.0                                                                  \ARCOTHfunction . . . . . . . . . . . . . .       77
    General: First public version . . . . . . . . . . 1              New commands: \ARSINH, \ARCOSH,
v1.0a                                                                 \ARTANH, \ARCOTH . . . . . . . . . . . . . .      53
    General: calculator.dtx modified to make                         New commands: \DOTPRODUCT,
       it autoinstallable. calculus.dtx                               \VECTORPRODUCT, \CROSSPRODUCT . . .               56
       embedded in calculus.dtx . . . . . . . . . 1                  New commands: \LENGTHADD,
v2.0                                                                  \LENGTHSUBTRACT . . . . . . . . . . . . . .       34
    General: new calculator.dtx and                                  Trivial error in documentation corrected           68
       calculator.ins files . . . . . . . . . . . . . . . 1
                                                              v2.1
      New commands: \ARCSINfunction,
       \ARCCOSfunction, \ARCTANfunction,                          \@BASICLOG: Changed stop criterion on
       \ARCCOTfunction . . . . . . . . . . . . . . 76                iterations to 2sp . . . . . . . . . . . . . . .     49
      New commands: \ARCSIN, \ARCCOS,                             \FRACTIONALPART: Bug fixed . . . . . . . . .           36
       \ARCTAN, \ARCCOT . . . . . . . . . . . . . . 49            \ROUND: Bug fixed . . . . . . . . . . . . . . . . .    37
      New commands: \ARSINHfunction,                              \TRUNCATE: Bug fixed . . . . . . . . . . . . . . .     36
       \ARCOSHfunction, \ARTANHfunction,                          General: Some bugs fixed . . . . . . . . . . . .      . 1
Index
Numbers written in italic refer to the page where the corresponding entry is described; numbers
underlined refer to the code line of the definition; numbers in roman refer to the code lines where
the entry is used.
                                                            81
\@@VECTORGLOBALCOPY 957, 966            \@SOLPART . . . . . . . 1382,           \ARCOTHfunction         .....      1798
\@@VECTORMATRIXPRODUCT .                      1412, 1416, 1420, 1424            \ARCSIN . . . . .     754, 829,    1760
       . . . . . . . . . . 1256, 1271   \@TDINCSYS . . . . . 1386, 1440         \ARCSINfunction         .....      1759
\@@VECTORPRODUCT . 999, 1013            \@TDMATRIXCOPY . . . . . . . .          \ARCTAN . . . . .     832, 878,    1772
\@@VECTORSUB . . . . 1030, 1039                . 1092, 1146, 1158, 1188         \ARCTANfunction         .....      1771
\@ADJMATRIX . 1346, 1359, 1442          \@TDMATRIXGLOBALSOL . . . .             \ARSINH . . . . . .   . . . 881,   1782
\@BASICARCTAN . . . . . 844, 847               . . . . . . . . . . 1112, 1159   \ARSINHfunction         .....      1781
\@BASICEXP . . . 629, 637, 644          \@TDMATRIXNOSOL . . . . . . .           \ARTANH . . . . . .   . . . 901,   1794
\@BASICLOG . . . . . . . 730, 736              . . . . . 1122, 1135, 1341       \ARTANHfunction         .....      1793
\@BASICSINE . . . 422, 431, 553         \@TDMATRIXSOL . . . . 1102,
\@BASICTAN . . . 468, 473, 581                1137, 1147, 1189,                                   C
\@CONVERTDEG . . . . . . . . . .              1205, 1221, 1281, 1297            \ccls@COMDf . 1857, 1858, 1860
       . 599, 601, 603, 605, 607        \@TRUNCATE . . . . . . . 285, 286       \ccls@COMDg . . . . . 1856, 1858
\@DEGREES . . . . . . . . . . . .       \@VECTORSIZE . . . . . . 943, 944       \ccls@COMf . . . . . 1857, 1859
       . 600, 602, 604, 606–608                                                 \ccls@COMg . . . . . 1856, 1857
\@DEGREESCOS . . . . . . 536, 562                          A                    \ccls@cost . 1592, 1593, 1596
\@DEGREESCOT . . . . . . 538, 586       \ABSVALUE . . . . . 154, 167,           \ccls@cpoly . . . . . . 1671,
\@DEGREESSIN . . 535, 539, 600                 168, 242, 349, 350,                    1674, 1677, 1680, 1681
\@DEGREESTAN . . . . . . 537, 566              374, 433, 475, 622,              \ccls@deffunction            1543,
\@DIVIDE . . 174, 184, 189, 243                667, 680, 693, 704,                    1551, 1554, 1559, 1560
\@EXP . . . . . . . . 609, 618, 620            790, 805, 1042, 1045,            \ccls@defpolarfunction .
\@FRACTIONALPART . . 276, 282                  1373, 1395–1397, 1438                   . . . . . . . . . . . 1570,
\@INCSYS 1379, 1403, 1406, 1429         \ADD . . . . . . . . . . . . . 160,           1578, 1581, 1586, 1587
\@INTEGERDIVIDE . . . 190, 193                 164, 186, 238, 247,              \ccls@defvectorfunction
\@INTEGERPART . . . . . 261, 271               251, 260, 275, 324–                     . . . . . . . . . . . 1607,
\@LOG . . . . . 713, 714, 733, 734             326, 329–331, 334–                     1615, 1618, 1623, 1624
\@MATRIXSIZE . . . . 1139, 1140                337, 340–344, 399,               \ccls@ErrorFuncDef 1482, 1545
\@NUMBERSOL . . . . . 1138, 1316               418, 451, 464, 516,              \ccls@ErrorFuncUnDef . . .
\@OUTPUTMATRIX . . . 1166,                     527, 548, 564, 577,                     . . . . . . . . . . 1489, 1549
      1196, 1212, 1228,                        648, 651, 654, 657,              \ccls@ErrorPFuncDef . . . .
      1240, 1288, 1304, 1378                   660, 664, 675, 723,                     . . . . . . . . . . 1499, 1572
\@OUTPUTSOL 144, 188, 216,                     746, 782, 853, 856,              \ccls@ErrorPFuncUnDef . .
      226, 239, 255, 258,                      859, 862, 865, 868,                     . . . . . . . . . . 1507, 1576
      272, 283, 297, 320,                      871, 873, 884, 886,              \ccls@ErrorVFuncDef . . . .
      367, 407, 430, 448,                      898, 912, 929, 983,                     . . . . . . . . . . 1520, 1609
      452, 472, 497, 510,                      988, 990, 1017, 1018,            \ccls@ErrorVFuncUnDef . .
      561, 565, 585, 598,                      1021–1023,             1313,            . . . . . . . . . . 1528, 1613
      619, 643, 664, 677,                      1315, 1599, 1648,                \ccls@InfoFuncEns 1495, 1556
      690, 701, 712, 731,                      1665, 1666, 1668,                \ccls@InfoPFuncEns 1516, 1583
      735, 753, 809, 831,                      1684, 1686, 1689,                \ccls@InfoVFuncEns 1537, 1620
      846, 875, 880, 888,                      1690, 1692, 1774,                \ccls@LINafbg . . . 1901, 1903
      900, 919, 942, 997,                      1779, 1784, 1812,                \ccls@LINDafbg . . 1902, 1904
      1014, 1069, 1091, 1323                   1813, 1835, 1901, 1902           \ccls@LINDf . 1895, 1899, 1902
\@OUTPUTSOLS . . . . . . 145, 252       \ARCCOS . . . . 810, 1090, 1766         \ccls@LINDg . 1896, 1900, 1902
\@OUTPUTVECTOR . . . . 968,             \ARCCOSfunction . . . . . 1765          \ccls@LINf . 1895, 1897, 1901
      1074, 1255, 1272, 1456            \ARCCOT . . . . . . . . . 876, 1777     \ccls@LINg . 1896, 1898, 1901
\@POWER . . . . . . 226, 227, 232       \ARCCOTfunction . . . . . 1776          \ccls@lpoly . . . . . . 1636,
\@ROUND . . . . . . . . . . 307, 308    \ARCOSH . . . . . . . . . 889, 1788           1639, 1642, 1645, 1646
\@SCLRDIVVECT . . . . 1347,             \ARCOSHfunction . . . . . 1787          \ccls@nminusone . 1885, 1886
      1349, 1351, 1356, 1446            \ARCOTH . . . . . . . . . 920, 1799     \ccls@polarx . . . . 1907, 1909
                                                         82
\ccls@polary . . . . 1908, 1909    \cctr@@detc . . . . . 1397, 1405    \cctr@outd . . . . . . . . . . .
\ccls@POWDf . . . . . 1883, 1888   \cctr@absval . . . . . . 622,              . 1167, 1168, 1173, 1177
\ccls@POWDfn 1886–1888, 1890             623, 667, 668, 680,           \cctr@oute . . . . . 1173, 1177
\ccls@POWf . 1883, 1884, 1886            681, 693, 694, 704, 705       \cctr@outf . . . . . 1173, 1177
\ccls@POWfn . . . . . 1884, 1889   \cctr@ae . . 721, 722, 726, 727     \cctr@outg . . . . . 1174, 1178
\ccls@PRODf . . . . . 1830, 1834   \cctr@det . . . 1311–1315,          \cctr@outh . . . . . 1174, 1178
\ccls@PRODfg 1834, 1835, 1837            1335, 1336, 1347,             \cctr@outi . . . . . 1174, 1178
\ccls@PRODg . . . . . 1831, 1833         1349, 1351, 1372,             \cctr@Q . . . . . . 175, 185, 187
\ccls@PROf . 1830, 1832, 1833            1373, 1437, 1438, 1446        \cctr@sign . . . 169–172, 187
\ccls@PROfDg . . . . 1833, 1835    \cctr@deta . . . . . . . . . . .    \cctr@size . . . . . . . 953,
\ccls@PROfg . . . . . 1832, 1836          . 1392, 1395, 1399–1401            954, 964, 965, 976,
\ccls@PROg . 1831, 1832, 1834      \cctr@detb . 1393, 1396, 1399             977, 994, 995, 1011,
\ccls@qpoly . . . . . . 1652,      \cctr@detc . 1394, 1397, 1400             1012, 1026, 1027,
      1655, 1658, 1661, 1662       \cctr@epsilon . . . . . . . 6,            1037, 1038, 1048,
\ccls@qsquaretempg 1848, 1849            396, 612, 716, 741,                 1049, 1062, 1063,
\ccls@QUODf . . . . . 1842, 1846         742,      795,     1325,            1150, 1151, 1162,
\ccls@QUODfg . . . . . . . . . .         1340, 1398, 1402,                   1163, 1180, 1181,
       . 1846, 1847, 1849, 1851          1405, 1410, 1414,                   1193, 1194, 1209,
\ccls@QUODg . . . . . 1843, 1845         1418, 1422, 1427, 1439              1210, 1225, 1226,
\ccls@QUOf . 1842, 1844, 1845      \cctr@expminusx . . . . . . .             1237, 1238, 1252,
\ccls@QUOfDg . . . . 1845, 1847           . . . . 674, 675, 687, 688         1253, 1269, 1270,
\ccls@QUOfg . . . . . 1844, 1850   \cctr@expt 631, 632, 639, 640             1285, 1286, 1301,
\ccls@QUOg . . . . . . . . . . .                                             1302, 1320, 1321,
                                   \cctr@expx 672, 675, 685, 688
       . 1843, 1844, 1846, 1848                                              1374, 1375, 1451, 1452
                                   \cctr@expy 632, 633, 640, 641
\ccls@QUOnum . . . . 1847, 1849                                        \cctr@sol . . . . . . . . . . . .
                                   \cctr@lengtha . . . . . . . . .
\ccls@SCFaf . . . . . 1866, 1868                                              . 1138, 1311, 1313, 1315
                                          . . . 4, 157–160, 162,
\ccls@SCFDaf . . . . 1867, 1869                                        \cctr@solAA . . . . . . . . . . .
                                         163, 194, 200, 201,
\ccls@SCFDf . . . . . 1865, 1867                                              . . 1093, 1103, 1113,
                                         203, 205, 206, 211, 213
\ccls@SCFf . . . . . 1865, 1866                                              1134, 1202, 1218,
\ccls@SCVat . . . . . 1874, 1875   \cctr@lengthb . . . . . . . . .
                                                                             1278, 1294, 1341,
                                          5, 161, 162, 195, 196,
\ccls@SCVDf . 1875, 1876, 1878                                               1347, 1348, 1360, 1443
                                         200, 204, 205, 212,
\ccls@SCVf . . . . . 1875, 1877                                        \cctr@solAB . . 1094, 1104,
                                         214, 395, 396, 403,
\ccls@sint . 1594, 1595, 1598                                                1114, 1202, 1218,
                                         405, 740, 742, 749,
\ccls@SUBDf . . . . . 1820, 1823                                             1278, 1294, 1341,
                                         751, 793, 795, 806, 808
\ccls@SUBDfg . . . . 1823, 1825                                              1347, 1348, 1363, 1443
                                   \cctr@log . . . . . . . . 616–618
\ccls@SUBDg . . . . . 1821, 1823                                       \cctr@solAC . . 1095, 1105,
\ccls@SUBf . . . . . 1820, 1822    \cctr@loga . . . . . . . 733, 735         1115, 1202, 1218,
\ccls@SUBfg . . . . . 1822, 1824   \cctr@logmaxnum . 8, 114,                 1278, 1294, 1341,
\ccls@SUBg . . . . . 1821, 1822          623, 668, 681, 694, 705             1347, 1348, 1366, 1443
\ccls@SUMDf . . . . . 1810, 1813   \cctr@logx . . . . . . . 734, 735   \cctr@solBA . . 1096, 1106,
\ccls@SUMDfg . . . . 1813, 1815    \cctr@minust 673, 674, 686, 687           1116, 1203, 1219,
\ccls@SUMDg . . . . . 1811, 1813   \cctr@ndec . . . 176, 177, 186            1279, 1295, 1342,
\ccls@SUMf . . . . . 1810, 1812    \cctr@outa      144, 145, 147,            1349, 1350, 1361, 1444
\ccls@SUMfg . . . . . 1812, 1814         969, 970, 973, 974,           \cctr@solBB . . 1097, 1107,
\ccls@SUMg . . . . . 1811, 1812          1167, 1168, 1172, 1176              1117, 1203, 1219,
\ccls@temp . . . . . 1685, 1686    \cctr@outb . . . . 146, 147,              1279, 1295, 1342,
\cctr@@det . . . . . . 1325,             969, 970, 973, 974,                 1349, 1350, 1364, 1444
      1340, 1373, 1438, 1439             1167, 1168, 1172, 1176        \cctr@solBC . . 1098, 1108,
\cctr@@deta . . . . . 1395, 1398   \cctr@outc . . . . 973, 974,              1118, 1203, 1219,
\cctr@@detb . . . . . 1396, 1402         1167, 1168, 1172, 1176              1279, 1295, 1342,
                                                  83
      1349, 1350, 1367, 1444               584, 835, 836, 840,               \cctr@Warnbigartanh . . . .
\cctr@solCA . . 1099, 1109,                841, 885–887, 897–                       . . . . . . . . . 60, 905, 909
      1119, 1204, 1220,                    899, 912, 914, 929,               \cctr@Warncrossprod 131, 1002
      1280, 1296, 1343,                    931, 1078, 1084, 1089,            \cctr@Warndivzero . . 21, 198
      1351, 1352, 1362, 1445               1262–1265, 1408, 1414             \cctr@WarnIncLinSys 83, 1379
\cctr@solCB . . 1100, 1110,          \cctr@tempC 915, 916, 932, 933          \cctr@WarnIncTDLinSys . .
      1120, 1204, 1220,              \cctr@tempc . . . . . . . 231,                 . . . . . . . . . . . 86, 1386
      1280, 1296, 1343,                    232, 351, 353, 364,               \cctr@WarnIndLinSys 90, 1382
      1351, 1352, 1365, 1445               366, 451, 452, 564,               \cctr@Warninfcotan . . . . .
\cctr@solCC . . 1101, 1111,                565, 913, 915, 930,                      . . . . . . . . 104, 506, 594
      1121, 1204, 1220,                    932, 1079, 1088–1090,             \cctr@Warninfexp . . 110,
      1280, 1296, 1343,                    1262–1265, 1409, 1418                   624, 669, 682, 695, 706
      1351, 1352, 1368, 1445         \cctr@tempD . . . . . . . . . . .       \cctr@Warninfexpb . 118, 613
\cctr@tanhden . . . . . . . . .             . 167, 174, 179, 181, 184        \cctr@Warninflog . . 125, 717
       . . . . 699, 700, 709, 711    \cctr@tempd 168, 174, 182,              \cctr@Warninftan . . . . . .
\cctr@tanhnum . . . . . . . . .            184, 242, 251, 1409, 1422                . . 98, 456, 460, 569, 573
       . . . . 698, 700, 710, 711    \cctr@tempdif . . . . . 748, 749        \cctr@Warnnoangle . . . . .
\cctr@temp . . . . . . . 255,        \cctr@tempexp . . . . . 221, 222               . . . . . . 137, 1082, 1086
      258, 264–266, 1068, 1069       \cctr@tempm . . . 340, 344, 345         \cctr@Warnnogcd . . . . 26, 356
\cctr@tempA . . . . . . . 279, 280   \cctr@tempn . . . . . . . 334,          \cctr@Warnnointexp . . 36, 223
\cctr@tempa 213, 215, 234,                 337, 338, 340, 343–345            \cctr@Warnnoposrad . . 30, 392
      236, 238, 291–293,             \cctr@tempo . . . . . . . 329,          \cctr@Warnround . . . . 15, 311
      313–315, 349, 351,                   331, 332, 334, 336–               \cctr@Warnsingmatrix 73, 1330
      352, 354, 362–366,                   338, 340, 342, 343, 345           \cctr@WarnsingTDmatrix .
      433, 434, 436, 438,            \cctr@tempoldw . . . . 743, 748                . . . . . . . . . . . 78, 1344
      439, 441, 444, 475,            \cctr@tempoldy . . . . 797, 807         \cctr@Warnsmallarcosh 54, 893
      476, 478, 482, 483,            \cctr@tempp . . . . . . . 324–          \cctr@Warnsmallarcoth 66, 925
      485, 486, 488, 489,                  327, 329–332, 334–                \cctr@Warntruncate . . 9, 289
      491, 492, 494, 495,                  336, 338, 340–342, 345            \cctr@WarnZeroLinSys 94, 1431
      646, 647, 649, 652,            \cctr@tempq . . . . 174, 175,           \COMPOSITIONfunction . 1853
      655, 658, 851, 852,                  184, 185, 325–327,                \CONSTANTfunction . . . 1803
      854, 857, 860, 863,                  329, 330, 332, 334,               \COPY . . . . . 142, 144, 147,
      866, 869, 872, 883–                  335, 338, 340, 341, 345                 150, 153, 156, 169–
      885, 895–897, 911–             \cctr@tempr . . . . . . . . . . .             172, 175, 176, 181,
      913, 928–930, 939,                    . 174, 178, 179, 181, 184              185, 201, 234, 235,
      940, 982, 983, 987–            \cctr@tempw . . . . 397–399,                  259, 268, 274, 289,
      990, 1072–1074, 1077,                402, 403, 739, 743,                     301–305, 311, 324–
      1080, 1088, 1262–                    744, 746–748, 753,                      327, 329–332, 334–
      1265, 1307, 1308,                    796, 798, 800, 802, 804                 338, 340–345, 353,
      1408, 1410, 1426, 1427         \cctr@tempx 774–776, 782–784                  359, 363, 365, 366,
\cctr@tempB 914, 916, 931, 933       \cctr@tempxw . . . . . . 744–746              370, 378, 388, 394,
\cctr@tempb . . . . . . . . . . .    \cctr@tempxx 776, 777, 784, 785               397, 401, 411, 413,
       . 214, 215, 230, 232,         \cctr@tempy 790, 791, 794,                    415, 434, 436, 476,
      350–353, 355, 359,                   797, 800, 801, 804–807                  479, 502, 514, 523,
      364, 365, 418, 419,            \cctr@tempz . . . . . . . 398–                525, 534, 541, 543,
      425, 426, 428, 429,                  401, 798, 799, 801–803                  545, 590, 743, 753,
      464, 465, 470, 471,            \cctr@Warnbigarccos . . . .                   757, 760, 763, 789,
      548, 549, 552, 553,                   . . . . . . . . . 48, 823, 827         794, 796, 797, 803,
      556, 557, 559, 560,            \cctr@Warnbigarcsin . . . .                   813, 816, 819, 849,
      577, 580, 581, 583,                   . . . . . . . . . 42, 767, 771         911, 928, 941, 944,
                                                      84
       945, 947, 950, 1093–                      874, 917, 934, 1073,               \forceqpoly . . . . . . . .   . 1659
       1101,           1103–1111,                1088, 1089, 1335,                  \forcevectorfunction          . 1622
       1138, 1140, 1141,                         1357, 1383, 1399,                  \FRACTIONALPART . . . .       . . 274
       1143, 1185, 1331,                         1400, 1459, 1461–                  \FRACTIONSIMPLIFY . .         . . 376
       1332, 1384, 1432,                         1464, 1466, 1704,
       1649, 1695, 1696,                         1716, 1731, 1736,                                     G
       1698, 1699, 1701,                         1747, 1752, 1755,                  \GCD . . . . . . . . . 347, 369, 380
       1702, 1719, 1757, 1758                    1764, 1770, 1775,                  \GLOBALCOPY . . . . . . . . . . .
\COS . . . . . . 449, 500, 800,                  1780, 1786, 1792,                          . 143, 144–146, 958,
       1592, 1721, 1726, 1729                    1797, 1802, 1844, 1849                    961, 1113–1121, 1155
\COSfunction . . . . 1720, 1907            \DOTPRODUCT . . . . . . . . . . 998
\COSH . . . . . . . . . 665, 699,          \Dr . . . . . . . . . . . 1596, 1598                  H
       710, 1738, 1742, 1745               \Dx . . 1596, 1597, 1601, 1630           \HEAVISIDEfunction . . .          1756
\COSHfunction . . . . . . . 1737           \Dy . . . 1566, 1598, 1599,
\COT . . . . . . . . . . . . . . . . 498         1603, 1632, 1649,                                   I
                                                 1664, 1665, 1683,                  \IDENTITYfunction . . . 1700
\COTAN . . . . . . . . . . . . . 1733
                                                 1686, 1688, 1690,                  \ifcase . . . . . . . . . . 300, 323
\COTANH . . . . . . . . . . . . 1749
                                                 1696, 1699, 1702,                  \INTEGERDIVISION 240, 255, 258
\COTfunction . . . . . . . . 1732
                                                 1705, 1706, 1709,                  \INTEGERPART . . . . . . 221,
\COTH . . . . . . . . . . . . . . . 702
                                                 1711–1713,           1716,               259, 273, 279, 291, 313
\COTHfunction . . . . . . . 1748
                                                 1719, 1722, 1723,                  \INTEGERQUOTIENT . . . . . 256
\CROSSPRODUCT . . . . . . . 1015
                                                 1726,           1729–1731,         \INVERSEMATRIX . . . . . . 1324
\CUBE . . . . . . . . . . . . . . . 218
                                                 1734–1736,           1739,
\CUBEfunction . . . . . . . 1710                                                                       L
                                                 1742,           1745–1747,
                                                 1750–1752,           1755,         \LCM . . . . . . . . . . . . . . . . 368
                D                                                                   \LENGTHADD . . . . . . . 203, 208
                                                 1758, 1763, 1764,
\DEGREESCOS . . . 536, 588, 602                                                     \LENGTHDIVIDE . . . . . . . . 209
                                                 1769, 1770, 1775,
\DEGREESCOT . . . . . . . 538, 606                                                  \LENGTHSUBTRACT . . . . . . 207
                                                 1780, 1785, 1786,
\DEGREESSIN . . . . . . . . . . .                                                   \LINEARCOMBINATIONfunction
                                                 1791, 1792, 1797, 1802
       . 535, 549, 557, 560, 565                                                            . . . . . . . . . . . . . . 1892
\DEGREESTAN . . . . . . . . . . .                             E                     \LOG 616, 713, 727, 887, 899,
       . 537, 577, 584, 592, 604           \ensurecpoly . . . . . . . . 1675               914, 915, 931, 932, 1754
\DEGtoRAD . . . . 511, 552, 580            \ensurefunction . . 1498,                \LOGfunction . . . . . . . . 1753
\DETERMINANT . 1005–1007,                         1553, 1641, 1657, 1676
      1305,         1360–1368,             \ensurelpoly . . . . . . . . 1640                          M
      1372, 1392–1394, 1437                \ensurepolarfunction . . .               \MATRIXABSVALUE . 1229, 1408
\DIVIDE . . . . . . . . . . 165,                   . . . . . . . . . . 1519, 1580   \MATRIXADD . . . . . . . . . 1197
      215, 230, 372, 381,                  \ensureqpoly . . . . . . . . 1656        \MATRIXCOPY . 1142, 1168, 1175
      382, 398, 400, 439,                  \ensurevectorfunction . .                \MATRIXGLOBALCOPY . . . . .
      442, 445, 481, 482,                          . . . . . . . . . . 1540, 1617           . . . . . 1154, 1167, 1171
      484, 485, 487, 488,                  \EXP . . . . . . . . . . 609, 672,       \MATRIXPRODUCT . . . . . . 1289
      490, 491, 493, 494,                         674, 685, 687, 744, 1718          \MATRIXSIZE . . . . . . 1139,
      496, 509, 511, 597,                  \EXPfunction . . . . . . . . 1717               1150, 1162, 1180,
      607, 631, 639, 647,                                                                  1193, 1209, 1225,
      649, 650, 652, 653,                                   F                              1237, 1252, 1285,
      655, 656, 658, 659,                  \FLOOR . . . . . . . . . . . . . . 273          1301, 1320, 1374, 1451
      662, 676, 689, 700,                  \forcecpoly . . . . . . . . . 1678       \MATRIXSUB . . . . . . . . . 1213
      711, 721, 735, 745,                  \forcefunction . . . . . . . .           \MATRIXVECTORPRODUCT . . .
      775, 783, 801, 835,                         . 1558, 1644, 1660, 1679                  . 1241, 1290, 1291, 1443
      840, 854, 857, 860,                  \forcelpoly . . . . . . . . . 1643       \MAX . . . . . . . . . . . . . 148, 351
      863, 866, 869, 872,                  \forcepolarfunction . . 1585             \MIN . . . . . . . . . . . . . 151, 352
                                                            85
\MODULO . . . . . . . . . . 253, 364   \numberFIFTHPI . . . . . . 1463                          R
\MULTIPLY . . . . . . . . 156,         \numberGOLD . . . . . . . . . 1470    \r . . . . . . . . . . . . 1593, 1595
      157, 179, 182, 187,              \numberHALFPI . . 411, 413,           \RADtoDEG . . . . . . . . . . . 512
      191, 217, 218, 231,                    417, 421, 451, 455,             \RECIPROCALfunction . . 1703
      237, 264, 373, 383,                    459, 463, 467, 760,             \REDUCEDEGREESANGLE . . . 524
      441, 444, 447, 512,                    763, 779, 787, 813,             \REDUCERADIANSANGLE . . . 513
      608, 617, 663, 673,                    830, 837, 842, 879, 1459        \renewcpoly . . . . . . . . . 1672
      686, 726, 778, 786,              \numberINVE . . . . . 1466, 1468      \renewfunction . . . 1488,
      852, 855, 858, 861,              \numberINVETWO . . . . . . 1468              1547, 1638, 1654, 1673
      864, 867, 870, 939,              \numberINVGOLD . . . . . . 1471       \renewlpoly . . . . . . . . . 1637
      981, 982, 986, 987,              \numberLOGTEN . . . . . . . 1469      \renewpolarfunction . . . .
      989,     1053,        1054,      \numberPI . . . . . 425, 464,                 . . . . . . . . . . 1505, 1574
      1057–1059,            1306,            470, 515, 519, 523,             \renewqpoly . . . . . . . . . 1653
      1307, 1311, 1312,                      819, 1457, 1458–1464            \renewvectorfunction . . .
      1314, 1333, 1334,                \numberQUARTERPI . . . . 1462                 . . . . . . . . . . 1526, 1611
      1458, 1460, 1593,                                                      \ROUND . . . . . . . . . . . . . . 307
                                       \numberSIXTHPI . . . . . . 1464
      1595, 1596, 1598,
                                       \numberSQRTFIVE . . . . . 1474
      1647, 1663, 1664,                                                                         S
                                       \numberSQRTTHREE . . . . 1473
      1667, 1682, 1683,                                                      \SCALARMATRIXPRODUCT . . .
      1685, 1687, 1688,                \numberSQRTTWO . . . . . . 1472
                                       \numberTHIRDPI . . . . . . 1461               . . . . . . . . . . 1273, 1336
      1691, 1706, 1709,                                                      \SCALARPRODUCT . . . . . . . .
      1712, 1713, 1723,                \numberTHREEHALFPI . . . . .
                                              . . . . . . . 415, 424, 1460           . . . . 980, 998, 1068,
      1832–1834,            1845,                                                   1079, 1242, 1243,
      1846, 1858, 1866,                \numberTWOPI . . . . . . . . . .
                                                                                    1246–1248, 1257, 1258
      1867, 1874, 1876,                        418, 428, 516, 520, 1458
                                                                             \SCALARVECTORPRODUCT . . .
      1887, 1888, 1897–1900                                                          . . . . . . 1052, 1074,
                                                     O
                                                                                    1261, 1262, 1264,
               N                       \ONEfunction . . . . . . . . 1694
                                                                                    1274, 1275, 1278–1280
\NeedsTeXFormat . . . . 2, 1479        \or 302–305, 325, 329, 334, 340
                                                                             \SCALEfunction . . . . . . 1862
\newcpoly . . . . . . . . . . 1669                                           \SCALEVARIABLEfunction 1871
\newfunction . . . . . . . . . .                        P                    \setlength . . . . . . . . . . 206
       . . 1494, 1541, 1635,           \PackageError 1483, 1490,             \SIN . . . . . . 409, 452, 798,
      1651, 1670, 1694,                      1500, 1508, 1521, 1529                 1594, 1722, 1725, 1734
      1697, 1700, 1703,                \PackageInfo 1496, 1517, 1538         \SINfunction . . . . 1724, 1908
      1707, 1710, 1714,                \PackageWarning . . . . 10,           \SINH . . . . . . . . . 678, 698,
      1717, 1720, 1724,                      16, 22, 27, 31, 37, 43,                709, 1739, 1741, 1750
      1727, 1732, 1737,                      49, 55, 61, 67, 74, 79,         \SINHfunction . . . . . . . 1740
      1740, 1743, 1748,                      83, 86, 90, 94, 99, 105,        \SOLVELINEARSYSTEM . . . 1379
      1753, 1756, 1759,                      111, 119, 126, 132, 138         \SQRT . . . . . . . . . 408, 776,
      1765, 1771, 1776,                \PARAMETRICfunction . . . .                  784, 885, 897, 1715,
      1781, 1787, 1793, 1798                  . . . . . 1909, 1910, 1914            1763, 1769, 1785, 1791
\newlpoly . . . . . . . . . . 1634     \POLARfunction . . . . . . 1906       \SQRTfunction . . . . . . . 1714
\newpolarfunction 1514, 1568           \POWER . . . . . 219, 1884, 1886      \SQUARE . . . . . . . 217, 438,
\newqpoly . . . . . . . . . . 1650     \POWERfunction . . . . . . 1880              633, 641, 646, 851,
\newvectorfunction 1535, 1605          \PRODUCTfunction . . . . . .                 883, 895, 1467, 1468,
\numberCOSXLV . . . . . . . 1475              . . . . . 1827, 1907, 1908            1705, 1708, 1711,
\numberCOSXXX . . . . . . . 1476       \ProvidesPackage . . . 3, 1480               1730, 1735, 1746,
\numberE . . . . . . . . . 721,                                                     1751, 1761, 1767,
      726, 1465, 1466, 1467                         Q                               1773, 1778, 1783,
\numberETWO . . . . . . 720, 1467      \QUOTIENTfunction      ...    1839           1789, 1795, 1800, 1848
                                                       86
\SQUAREfunction . . . . . 1707             1754, 1755, 1757,                \VECTORSIZE 943, 953, 964,
\SQUAREROOT . . 385, 408, 1069             1760, 1761, 1766,                      976, 994, 1011, 1026,
\SUBTRACT . . . . . . . . 164,             1767, 1772, 1773,                      1037, 1048, 1062, 1269
      192, 249, 267, 280,                  1777, 1778, 1782,                \VECTORSUB . . . . . . 1030,
      402, 425, 428, 440,                  1783, 1788, 1789,                      1214, 1215, 1218–1220
      443, 446, 470, 483,                  1794, 1795, 1799, 1800
      486, 489, 492, 495,           \TAN . . . . . . . . 453, 504, 1728                     X
      520, 531, 556, 559,           \TANfunction . . . . . . . . 1727       \x . . .   1593, 1599, 1600, 1629
      583, 661, 688, 728,           \TANH . . . . . . . . . . . 691, 1744
      739, 747, 748, 774,           \TANHfunction . . . . . . . 1743                      Y
      779, 787, 799, 802,           \textit . . . . . . . . . . . . . 737   \y . . . . 1565, 1595, 1597,
      804, 830, 837, 842,           \TRANSPOSEMATRIX . . . . 1184                  1602, 1631, 1647,
      879, 896, 913, 916,           \TRUNCATE . . . . . . . . . . . 285            1648, 1663, 1664,
      930,    933,       1308,      \TWOVECTORSANGLE . . . . 1075                  1666–1668,     1682–
      1597, 1762, 1768,                                                            1684, 1687, 1689,
      1790, 1796, 1801,                           U                                1691, 1692, 1695,
      1822, 1823, 1847, 1885        \UNITVECTOR . . . . . . . . .   1070           1698, 1701, 1704,
\SUBTRACTfunction . . . 1817                                                       1705, 1708, 1712,
\SUMfunction . . . . . . . . 1807                     V                            1715, 1716, 1718,
                                    \VECTORABSVALUE . . . . . . .                  1719, 1721, 1725,
              T                            . . . . . 1041, 1230, 1233              1728, 1733, 1738,
\t . . . . 1563, 1590,   1592,      \VECTORADD . . 1016, 1031,                     1741, 1744, 1749,
       1594, 1627,       1647,            1034, 1198, 1199,                        1754, 1757, 1760,
       1663, 1667,       1682,            1202–1204, 1263, 1265                    1766, 1772, 1777,
       1687, 1688,       1691,      \VECTORCOPY . . . 946, 970, 974                1782, 1788, 1794, 1799
       1701, 1704,       1708,      \VECTORfunction . . . . . 1914          \yy . . . 1761–1763, 1767–
       1709, 1711,       1712,      \VECTORGLOBALCOPY . . . . .                    1769,     1773–1775,
       1715, 1718,       1721,             . . . . . . . . 957, 969, 973           1778–1780,     1783–
       1722, 1725,       1726,      \VECTORMATRIXPRODUCT . . .                     1785,     1789–1791,
       1728, 1729,       1733,             . . . . . 1256, 1294–1296               1795–1797,    1800–1802
       1734, 1738,       1739,      \VECTORNORM . . . . . . 1066,
       1741, 1742,       1744,            1072, 1077, 1078, 1426                         Z
       1745, 1749,       1750,      \VECTORPRODUCT . . . 999, 1015          \ZEROfunction . . . . . . .   1697
87