<<

Appendix C Some details of .xla(m) C.1 Matrix nomenclature For the sake of notational compactness, we will denote a square by D with elements dii, a square by T with elements tij where | j – i | ≤ 1, most other square matrices by S, rectangular matrices by , and all matrix elements by mij. A vector will be shown as v, with elements vi, and a scalar as s. Particular values are denoted by x when real, and by z when complex. All optional pa- rameters are shown in straight brackets, [ ]. All matrices, vectors, and scalars are assumed to be real, ex- cept when specified otherwise. All matrices are restricted to two dimensions, and vectors to one dimen- sion. Table C.1 briefly explains some matrix terms that will be used in subsequent tables. With some functions, the user is given the integer option Int of applying integer arithmetic. When a matrix only contains integer elements, selecting integer arithmetic may avoid most round-off problems. On the other hand, the range of integer arithmetic is limited, so that overflow errors may result if the ma- trix is large and/or contains large numbers. Another common option it Tiny, which defines the absolute value of quantities that can be regarded as most likely resulting from round-off errors, and are therefore set to zero. When not activated, the routine will use its user-definable default value. Condition of a matrix: ratio of its largest to smallest singular value Diagonal of a square matrix: the set of terms mij where i = j Diagonal matrix D square matrix with mij = 0 for all off-diagonal elements i ≠ j. Decomposition or factorization: writing a matrix as the product of two or more special matrices False as optional parameter: False = 0 First lower subdiagonal of a square matrix: the set of terms mij where j = i+1 First upper subdiagonal of a square matrix: the set of terms mij where j = i–1 Inverse square matrix S–1 square matrix that satisfies S–1 S = S S–1 = I Hermitean matrix a square matrix for which S*T = S where S* denotes the complex conjugate of S; all symmetric real matrices are Hermitian H a square matrix with mij = 0 for j = i+k, k > 1 Lower L a square matrix with only 0’s below its diagonal Order of a square matrix: its number of rows or columns a real, square matrix with the property S–1 = ST Rank order of largest nonsingular square submatrix of a matrix Rectangular matrix R a matrix with (in general) an unequal number of rows and columns Square matrix S a matrix with an equal number of rows and columns Subdiagonal the set of terms mij where i = j±k where k is an integer T a square matrix S with all mij = mji, hence S = S a square matrix with constant elements on each diagonal parallel to the main diagonal Transpose RT matrix after interchanging its rows and columns Triangular matrix T matrix with non-zero terms only on its diagonal and first upper and lower subdiagonals True as optional parameter: True = 1 Uniform matrix repeats its elements on its diagonal and each subdiagonal Unit matrix I square matrix of arbitrary dimension m×m with 1’s on its diagonal, and 0’s above and below it Upper triangular matrix U a square matrix with only 0’s below its diagonal. (Exceptions: the upper triangular matrix R in QR decomposition; the orthogonal matrix U in singular value decomposition.)

Table C-1: The nomenclature used

599

C.2 Functions for basic matrix operations C.2.1 Functions with a scalar output

Entering the functions listed below does not require the use of Ctrl∪Shift∪Enter. 2 MAbs(R) Absolute value of R ∑mij i, j MCond(R) Condition number κ of a matrix κ computed using singular value decomposition

MpCond(R) –log10 of matrix condition number pκ = –log(κ) computed using singular value decomposition

MDet(S [,Int] [,Tiny]) of a square matrix S det[S] Similar to Excel’s =MDETERM(S). Because of rounding errors, both MDET and MDETERM can yield (often different) non-zero answers For a singular matrix. When all elements of S are integer, and Integer is set to True, MDET uses integer mode. Defaults: Integer = False, Tiny = 0.

MRank(R) Rank of a matrix

MTrace(S) of a square matrix tr(S) = ∑mii i C.2.2 Basic matrix functions

Entering the following functions requires the use of Ctrl∪Shift∪Enter

MAdd(R1,R2) Addition of two matrices R1+R2 equivalent to Excel’s =R1+R2, as in =B2:D5+F2:H5.

MSub(R1,R2) Subtraction of two matrices R1–R2 Equivalent to Excel’s = R1–R2, as in =B2:D5–F2:H5.

MT(R) Transpose of a matrix RT equivalent to Excel’s function TRANSPOSE

MMult(R1,R2) Product of two matrices R1 R2 Excel’s function is listed here for the sake of completeness

MProd(R1,R2,R3,...) Product of two or more matrices R1R2R3... Pay attention to the dimensions, as the function MProd does not check them.

MMultS(R,s) Product of a matrix and a scalar sR = Rs equivalent to Excel’s scalar multiplication, as in =3.21*B2:G9.

MPow(S,n) Sn = S S S … S (n terms) Sn

–1 MInv(S [,Int] [,Tiny]) Inverse of S S similar to Excel’s =MINVERSE(M). Because of rounding errors, both M_INV(M) and MINVERSE(M) can yield (different) non-zero element values for a singular matrix. When Integer is set to True, integer mode is used. Any result smaller in absolute magnitude than Tiny is set to zero. Defaults: Integer = False, Tiny = 0. ∞ n S S MExp(S [,Algo] [,n]) e = ∑ n=0 n! Uses Padé approximation (the default, Algo = “P”), otherwise the power method. The default stops when convergence is reached. When n is specified, the resulting error can be obtained with =MExpErr(S, n)

MExpErr (S ,n) Error term in matrix exponential

600

C.2.3 Vector functions

ProdScal(v1,v2) Scalar product of two vectors v1 • v2

ProdVect(v1,v2) Vector product of two vectors v1 v2  v • v  VectAngle(v ,v ) Angle between two vectors arccos 1 2  1 2    v1 ⋅ v2  C.3: More sophisticated matrix functions Diagonal or tridiagonal square matrices occur quite frequently in practical problems. When such matrices are of high orders, they can take up a large amount of space, even though most of it will be occupied by zeros. It is then often convenient to store and display m×m diagonal matrices D in compact notation as single m×1 column vectors, and tridiagonal matrices T as m×3 rectangular matrices. A number of special instructions are provided for this space-saving approach. Don’t confuse compact notation with sparse notation, as used in con- nection with sparse matrices, see Table C.10.3. MDetPar(S) Determinant of S containing one symbolic parameter k det[S]

Used with Ctrl∪Shift∪Enter yields vector, otherwise output shown as text string.

MDet3(T) Determinant of T in n×3 format det[T]

There is no need to use Ctrl∪Shift∪Enter, because the output is a scalar.

MMult3(T,R) Multiplies a tridiagonal matrix in tricolumnar format T R with a rectangular or square matrix R, or even a vector v.

MMultTpz (S,v) Multiplies a Toeplitz matrix in compact (columnar) format and a vector v. For a Toeplitz matrix of order 2n+1, v must be n×1

–1 MBAB(S1,S2) Similarity transform S1 S2 S1 MBlock(S) Transforms reducible, sparse square matrix into block-partitioned form

MBlockPerm(S) The for MBlock

MDiag(v) Convert vector v into D mii = vi

MDiagExtr(S [,d]) Extract the diagonal of S d = 1 for the diagonal, i = j (the default), d = 2 for the first lower subdiagonal, i = j+1.

C.4: Functions for matrix factorization

The terms matrix factorization and matrix decomposition refer to the same operations, in which a given matrix is expressed as the product of two or more special matrices. This approach is often used to facili- tate finding the required solution. The differences between the various available approaches reflect their general applicability, numerical efficiency, tolerance of ill-conditioning, etc. SVDD(R) Yields D of R = UT D V D The central result of singular value decomposition, providing the singular values σi as well as easy routes to matrix rank r and condition number κ. When R is Hermitian, the σi are the absolute values of its eigenfunctions. Note: the traditional symbol U here does not imply an upper triangular matrix.

SVDU(R) Yields U of R = UT D V U

SVDV(R) Yields V of R = UT D V V

MCholesky(S) Cholesky decomposition S = L L–1 of a symmetric matrix M into a lower triangular square matrix L and its transpose LT 601

MLU(S [,pivot]) LU decomposition into a lower (L) and upper (U) triangular square matrix. S = L U The optional pivot (the default) activates partial pivoting

MOrthoGS(R) Modified Gram-Schmidt orthogonalization

T MQH(S,v) decomposition of S with vector b S = Q H Q Q is orthogonal, H is Hessenberg. If S is symmetric, H is tridiagonal

MQR(R) QR decomposition A = Q R Q is orthogonal, R is upper triangular

MHessenberg(S) Converts S into its Hessenberg form H

MChar(S, x) Computes characteristic matrix at real value x If x complex, use MCharC(S, z)

MCharPoly(S) Computes characteristic polynomial of S Can often be combined with PolyRoots(P)

PolyRoots(P) Finds all roots of a polynomial P

PolyRootsQR(P) Finds all roots of a polynomial P using the QR algorithm

MNorm(R or v [,Norm]) Finds the matrix or vector norm For matrix R: Norm: 0 (default) = Frobenius, 1 = max. abs. column sum, 2 = Euclidian norm, 3 = max. abs. row sum. For vector v: Norm: 1 = max. sum, 2 = Euclidian norm, 3 (default) = max. abs. value

MPerm(p) generates a permutation matrix from a permutation vector p

MCmp(v) of a monic polynomial P where v contains the coefficients of P m ∑(mki − mi,av )(mkj − m j,av ) MCovar(R) c = k =1 ij m similar to Excel’s COVAR(ai, aj)

MCorr(R) correlation matrix (i.e., normalized covariance) m m ∑(mki − mi,av )(mkj − m j,av ) k=1 rij = m m ∑(mki − mi,av ) ∑(mkj − m j,av ) k=1 k=1 MExtract(R, row, column) Creates a submatrix of R by extracting a specified row and column

MMopUp(R [,ErrMin]) Eliminates round-off errors from R –15 by replacing by zero all elements |aij| < ErrMin (default 10 )

MRot(m, theta, p, q) Creates orthogonal matrix of order m that rotates by angle theta in p,q plane

p ≠ q, p ≤ m, q ≤ m

602

C.5 Eigenvalues & eigenvectors The German word “eigen” in this context is best translated as “particular to”: eigenvalues and eigenvectors of a matrix are scalars and vectors that are particular to that matrix. They are only defined for square matrices. C.5.1: For general square matrices MEigenvalJacobi(S [,MaxIter]) Jacobi sequence of orthogonality transforms MaxIter (default 100) is the max. # of iterations

MEigenvalMax(S [,MaxIter]) Finds maximum |eigenvalue by using the iterative power method MaxIter (default 1000) is the max. # of iterations

MEigenvecPow(S [,Norm] [,MaxIter]) Approximates eigenvalues for diagonizable S by using the power method. Normalizes eigenvector if Norm = True; default = False MaxIter (default 1000) is the max. # of iterations

MEigenvalQR(S) Approximates the eigenvalues of S by QR decomposition Yields an n×1 array, or n×2 for complex eigenvalues

MQRIter(S[,MaxIter]) Iterative diagonalization of M to yield its eigenvalues based on QR decomposition MaxIter (default = 100) sets the max. # of iterations

MEigenvec(S, eval [,MaxErr]) Computes eigenvector of S for a given eigenvalue(s) in vector eval

MEigenvecInv(S, eval) Computes eigenvectors for a given vector eval by inverse iteration

MEigenvecJacobi(S[,MaxIter]) Orthogonal similarity transforms of a symmetric matrix S MaxIter (default = 100) sets the max. # of iterations

MEigenvectMax(S [,Norm] [,MaxIter]) Yields eigenvector for dominant eigenvalue (i.e., with max. absolute value). Normalizes eigenvector if Norm = True; default = False

MEigenvecPow(S [,Norm] [,MaxIter]) Yields real eigenvectors for diagonizable S using the power method. Normalizes eigenvector if Norm = True; default = False. MaxIter (default 1000) is the max. # of iterations

MRotJacobi(S) Jacobi orthogonal rotation of symmetric S

MEigenSortJacobi(eval, evec [,n]) Sorts eigenvectors by value of |eigenvalue| Optional n specifies number of eigenvectors shown

MNormalize(R [,Norm] [Tiny]) Normalize real matrix R

Norm specifies normalizing denominator: 1 = |vmin|, –14 2 (default) = |v|, 3 = |vmax|; Tiny default = 2×10

C.5.2: For tridiagonal matrices MEigenvalQL(T [,MaxIter]) Approximates eigenvalues of tridiago nal symmetric matrix using the QL algorithm accepts T in either regular or compact format. MaxIter (default 200) is the max. # of iterations

MEigenvalTTpz(n, a, b, c) Computes eigenvalues for a tridiagonal Toeplitz matrix with elements a, b, c All eigenvalues are real if ac > 0, complex if ac < 0

MEigenvecT(T, eigenvalues [,MaxErr]) Approximates eigenvectors for given eigenvalue(s) of T Accepts T in either square or compact format

603

C.6 Linear system solvers Linear system solvers solve a system of simultaneous linear equations in one single user operation. Int = True uses integer computation, otherwise use False (default). Tiny sets the minimum absolute round-off error that will be replaced by 0 (default: 10–15).

SysLin (S, x [,Integer] [,Tiny]) Gauss-Jordan solution of linear system M is the matrix of independent (control) parameters, x is the unknown coefficient vector or matrix

SysLinIterG (S, x, x0 [,MaxIter] [,w]) Iterative Gauss-Seidel solution of linear system using relaxation M is the matrix of independent (control) parameters, x is the unknown coefficient vector or matrix, x0 its starting value, MaxIter (default = 200) is the max # of iteration (MaxIter = 1 can be used for step-by-step use), w (default = 1) is the relaxation factor

SysLinIterJ (S, x, x0 [,MaxIter] [,w]) Iterative Jacobi solution of linear system S is the matrix of independent (control) parameters, x is the unknown coefficient vector or matrix, x0 its starting value, MaxIter (default = 200) is the max # of iteration (MaxIter = 1 for step-by-step use).

SysLinT (T, x [,Type] [,Tiny]) Solution of triangular linear system by forward or backward substitution. T is either U (upper) or L (lower) diagonal; the optional (i.e., unnecessary) Type specifies U or L.

SysLin3 (T3, x [,Integer] [,Tiny]) SysLin for tridiagonal matrix T3 where T3 is in compact notation

SysLinTpz (S, v) Solves a Toeplitz linear system by Levinson’s method

SysLinSing (S or R [,x] [,MaxErr]) Linear system analysis of a singular system The matrix can be square (m×m) or rectangular (m×n, where m

TraLin (R ,X [,B]) Linear transformation ` Y = RX + B R is m×n; X is n×p, B is m×p, and Y is m×p. Also works when p = 1, in which case X, B, and Y are vectors.

C.7 Functions for complex matrices

There are many physical phenomena that are best described in terms of matrix algebra with complex rather than real numbers. For example, the concept of a dielectric permittivity ε of a medium can be extended from strictly transparent media to (partially or completely) light-absorbing ones by considering ε as a complex quan- tity. Electrical networks containing phase-shifting components are conveniently described in terms of complex quantities such as admittance and impedance. Likewise, the linear (i.e., small-amplitude) response of an elec- trochemical interface is most completely described in terms of Rangarajan’s matrix model (J. Electroanal. Chem. 55 (1974) 297-374), which includes complex quantities reflecting the time lags of mass transport and interfacial capacitance. Modern quantum theory uses complex wave functions. The Excel functions involving complex quantities, as listed in Appendix A.5, only use the character string format. The matrix operations involving complex functions listed below allow the user, through the optional instruction parameter c, to select one of three notational formats. These formats are c = 1: split; c = 2: inter- laced, and c = 3: character string. Figs. C.7.1 and C.7.2 illustrate these for when the real and imaginary com- ponents are integer or non-integer respectively. In the split format each complex entity (scalar, vector, matrix) is displayed with its real components, and to its immediate right with its imaginary components. In the interlaced format, each complex number is repre- sented in two adjacent cells on the same row. In the text string format, the numbers are displayed as character 604 strings listing both the real and imaginary component, as in the Excel-supplied functions for complex num- bers. In the latter case, the results may have to be decoded with =IMREAL() or =IMAGINARY(). These three ways of representing complex numbers are illustrated in Fig. C.7.2. The default mode is 1, the split format.

ABCDEFGH I 1 2 Split format (default) 3-280057=MDetC(A3:F5) 43465-4-29-103 5-298626 6 7 Interlaced format 8 -2 0 8 5 0 7 =MDetC(A8:F10,2) 9354-46-29-103 10-269286 11 12 Text string format 13 -2 8+5j 7j =MDetC(A13:C15,3) 14 3+5j 4-4j 6-2j 9-103j 15 -2+6j 9+2j 8+6j

Fig C.7.1: The three ways to display complex quantities: (1) “split”, as entire quantities with real and imagi- nary components, the default mode; (2) “interlaced”, in which each individual element is shown with its two components adjacent to each other; and (3) “string”, as text strings. The matrix and its determinant contain only integer and imaginary components, in which case the text string format is often the more compact.

ABCDEFGH 1 2 Split format (default) 3 -2.42750 8.17185 0.04820 0 4.53980 6.84630 =MDetC(A3:F5) 4 2.65938 4.07577 6.33463 5.28370 -4.32580 -1.68270 -20.96548 -78.61323 5 -2.36394 9.49214 7.88308 6.49700 2.01150 5.62860 6 7 Interlaced format 8 -2.42750 0 8.17185 4.53980 0.04820 6.84630 =MDetC(A8:F10,2) 9 2.65938 5.28370 4.07577 -4.32580 6.33463 -1.68270 -20.96548 -78.61323 10 -2.36394 6.49700 9.49214 2.01150 7.88308 5.62860 11 12 Text string format 13 -2.4275 8.17185+4.5398j 0.0482+6.8463j =MDetC(A13:C15,3) 14 2.65938+5.2837j 4.07577-4.3258j 6.33463-1.6827j -20.9654787597-78.6132259685j 15 -2.36394+6.497j 9.49214+2.0115j 7.88308+5.6286j

Fig C.7.2: The three ways to display complex quantities, when the numbers are not re- stricted to integers, in which case the text string format may require much wider columns.

MCplx (R1, R2 [,c]) Convert two real matrices M into one complex matrix C C = R1+iR2

MAddC (C1, C2 [,c]) Add two complex matrices C1 + C2

MSubC (C1, C2 [,c]) Subtract two complex matrices C1 + C2

MAbsC (C[,c]) Absolute value of a complex vector

MDetC (C) Determinant of a complex square matrix C Det(C)

MInvC (C [,c]) Invert of a complex square matrix C–1

MMultC (C1, C2 [,c]) Product of two complex matrices C1 C2

MPowC (C1, C2, C3, ... [,c]) Product of two or more complex matrices C1 C2 C3 ...

MMultSC(C, s [,c]) Product of a complex matrix C and scalar s s C = C s

MTC (C [,c]) Transpose of a complex matrix C CT 605

H T T MTH (C [,c]) Hermitian (conjugate, adjoint) transpose of C C = C* = C *

ProdScaleC (v1, v2) Scalar product of complex vectors v1 • v2

MNormalize (C [,Norm] [,c] [Tiny]) Normalize complex matrix C

Norm specifies normalizing denominator: 1 = |vmin|, –14 2 (default) = |v|, 3 = |vmax|; Tiny default = 2×10

MCharC (C, z [,c]) Compute characteristic matrix of C at value z M and/or z can be real or complex

MCharPolyC (C, [,c]) Compute the characteristic polynomial

PolyRootsQRC (p, [,c]) Find all roots of a complex vector p of polynomial coefficients using the QR algorithm

MEigenvalQRC (C [,c]) Approximates the eigenvalues of a complex square matrix C using QR decomposition

MEigenvecC (C [,c]) Compute complex eigenvector of C for given complex eigenvalue(s)

MEigenvecInvC (C, eigenvalues [,c]) Compute eigenvector of C for given eigenvalue(s) by inverse iteration

SysLinC (C, x [,c]) Gauss-Jordan solution of complex linear system. C: vector or matrix of independent parameters, x: is the unknown coefficient vector or matrix

C.8 Matrix generators The following is a collection of routines for generating various types of matrices. It starts with the simplest, the , and includes not only a number of named matrices but, also, routines to gen- erate custom-ordered matrices, such as matrices with a given set of eigenvalues or with a given amount of sparsity. Often used option: Int = True (default) creates an , otherwise use False.

MIde(m) Generates the identity matrix I of order m, i.e., Im×m

MRnd(m [,n] [,Type] [,Int] [,AMax] [,AMin] [,sparse]) Generates a random m×n matrix (default: n = m). Type specifies the type of matrix: All (default) fills all cells, Sym generates a symmetrical matrix, Dia a diagonal one, Trd a tridiagonal, Tlw a tridiagonal lower, Tup a tridiagonal upper, and SymTrd a symmetrical tridiagonal matrix. AMax and AMin specify the maxi- mum and minimum element values. Sparse accepts values from 0 to 1: 0 (default) for filled, 1 for very sparse.

MRndEig(v [,Int]) Creates a random real matrix for a given vector v of eigenvalues MRndEigSym(v) Creates a symmetrical random real matrix for a given vector v of eigenvalues

MRndRank(m [,Rank] [,Det] [,Int]) Creates a square real matrix with a given value of Rank or Determinant. If Rank < m, Det = 0.

MRndSym(m [,Rank] [,Det] [,Int]) Creates a square real symmetrical matrix of dimension m×m with a given value of Rank or Determinant. If Rank < m, Det = 0.

MHilbert(m) Creates the m×m The Hilbert matrix is ill-conditioned; its elements hij = 1/(i+j+1) are shown in decimal form

MHilbertInv(m) Creates the m×m inverse Hilbert matrix The elements of the inverse Hilbert matrix are all integer

MHouseholder(x) Creates the Householder matrix of vector x

MTartaglia(m) Creates the m×m Tartaglia (or Pascal) matrix Element values: mi1 = m1j = 1; for i > 1, j >1: mij = mi–1,j+mi,j–1 MVandermonde(x) Creates the X of vector x, as used in, e.g., the least squares formalism 606

C.9 Miscellaneous functions C.9.1 Linear least squares routines RegrL(y, x [,Intercept]) Linear least squares based on svd Equivalent to post-Excel2002 LinEst. y: N×1 vector of dependent variables, x: N×1 vector or N×m matrix of

independent parameters for the monovariate and multivariate case respectively. Intercept = a0 when specified; nd default leaves a0 unspecified. First output column: coefficients ai; 2 output column: standard deviations si.

RegrP(Order, y, x [,Intercept]) Linear least squares polynomial fit based on svd, equivalent to post-Excel2002 LinEst. Order is the polynomial order, y the N×1 vector of de- pendent variables, x the N×1 vector of the independent parameter x. Powers of x are generated internally. In- st nd tercept = a0 when specified; default leaves a0 unspecified. Output: 1 column: coefficients ai; 2 column: standard deviations si.

RegrCir(x, y) Least squares fit to a circle through all points (xi,yi), yields radius and x,y coordinates of circle center, with standard deviations

C.9.2 Optimization routine Simplex(y, constraints [,optimum]) Simplex optimization y = a0 + a1x1 + a2x2 +..., as 1×m vector of the coefficients a0, a1, a2, ... constraints: <, >, = ; optimum: 1 (default) maximum, 0 minimum C.9.3 Step-by-step demonstration GJStep(S [,Type] [,Integer] [,Tiny]) Step-by-step (didactic) tracing of Gauss-Jordan elimination leading to either diagonal (Type = D) or triangular (Type = T) reduction. Integer = True conserves integer values, default = False. Tiny sets minimum round-off error; default = 2×10–15. Copy & paste for the next step.

C.9.4 Economic optimization routines MLeontInv (S,v) Inverts the Leontief matrix encountered in economic input-output analysis

VarimaxIndex (F [,row-norm]) Varimax index for given factor loading matrix F.

Row-normalization: False (default) or True

VarimaxRot (F [,row-norm] [,MaxErr] [,MaxIter]) Orthogonal rotation of factor loading matrix F in Kaiser’s Varimax model. –4 Row-normalization: False (default) or True; MaxErr default = 10 ; MaxIter default = 500.

C.9.5 Minimum path routines PathFloyd(G) Computes the matrix of shortest-path pairs from an G

PathMin(G) Shows vectors of shortest paths

C.9.6 Routine for electrical circuit admittance MAdm(B) Creates an admittance matrix from a 3- or 4-column wide branch matrix B (two columns for the nodes, and 1 or 2 columns for the admittance of the individual circuit elements

607

C.10: Matrix macros The Matrix Toolbar provides access to a set of matrix-related macros through three menu headings: Selector, Generator, and Macros. Below we will briefly describe each one of these. C.10.1 The Selector tool The Selector tool can be used to select different parts of a matrix. Start with identifying a matrix (when that matrix is bordered by empty cells, just clicking on a single cell of that matrix will do), and then use the choices presented in the Selector dialog box. In other words, click on a cell in a matrix, click on Selector, click on a choice, such as Triang. low, again click on the Selector, then on the Paster (at the bottom of the Selector menu), select a starting cell, and click OK. You will see the lower triangular part of the selected matrix appear, starting at the selected starting cell. The available choices are listed in Table C.10.1. You can even arrange for diverse output formats through the Target range selector. When you do not specify a matrix ahead of time, click on Selector, and its dialog box will give you entry to the Selector choices. Selector choice Brief description Full the entire matrix Triang. low the lower triangle, including the diagonal Triang. up the upper triangle, including the diagonal Diag. 1st the (main) diagonal, from top-left to bottom-right Diag. 2nd the anti-diagonal, running from top-right to bottom-left Tridiag. 1st the tridiagonal, from top-left to bottom-right Tridiag. 2nd the anti-tridiagonal, from top-right to bottom-left Subtriang. low the lower triangle minus the diagonal Subtriang. up the upper triangle minus the diagonal Adjoint the matrix minus the row and column of the chosen cell Table C.10.1: The choices offered in the Selector dialog box. As its default, the Selector dialog box will copy the selected matrix parts as is, at your option leaving the unselected cells empty or filling them with zeros. By using its Target range you can also choose dif- ferent output formats, such as vertical, horizontal, diagonal, transposed, etc. For the Adjoint output, also set the Target range at Adjoint. C.10.2 The Generator tool The Generator tool allows you to create matrices to your specifications. Apart from its four generators of specific matrices (Hilbert, inverse Hilbert, Tartaglia, and Toeplitz) of user-selectable order, it contains four generators, which are marvelous learning and teaching tools, especially when com- bined with some of the matrix functions described in the earlier sections to monitor their performance. Table C.10.2 lists the various choices available.

608

Generator choice Brief description Random generates random matrices of user-selected dimensions, minimum and maximum element values, format (full, triangular, tridiagonal, integer, symmetric), and numerical resolution. Rank/Determinant generates random square matrices of user-selected order and determinant (the default, if rank = order) or rank (if det = 0). Eigenvalues generates random square matrices with user-selected eigenvalues. Hilbert generates the Hilbert matrix of given order. Hilbert inverse generates the inverse Hilbert matrix of given order. Tartaglia generates the Tartaglia matrix of given order. Toeplitz generates the Toeplitz matrix of given order. Sparse generates sparse square matrices of user-selected order, minimum and maximum element values, dominance factor, filling factor, and spreading factor. One can specify integer and/or symmetrical output, and regular (square) or sparse output display. In the latter case, all non-zero elements mij are listed in three adjacent columns as i, j, and mij.

Table C.10.2: The choices offered in the Generator dialog box. C.10.3 The Macros tool The Macros tool provides easy access to a number of macros. Many of these macros duplicate matrix functions already described in appendices B.2 to B.8, but the operations contains some ad- ditional features. The choices given in the Macros dialog box are listed in Table B.10.3. Some matrices can be selected by simply pointing to one cell of that matrix, and by then clicking on the smart selector icon, labeled with a rectangle. This method works only when the matrix in question is surrounded by empty cells and/or the border.

Macro choice Brief description Matrix operations reproduces the most often used matrix functions Complex matrix operations duplicates many of the functions of section 9.7 Sparse matrix operations applies the most common matrix operations to sparse matrices in sparse matrix format (i.e., in three adjacent columns: i, j, mij), thereby greatly facilitating handling large sparse matrices on the spread- sheet. It includes an efficient ADSOR (adaptive successive over-relaxation) Gauss-Seidel method. Eigen-solving provides eigenvalues, eigenvectors, the characteristic matrix, and the characteristic polynomial for a square (real, real tridiagonal, complex) matrix Gauss step-by-step a macro form of GJ_Step Graph includes Shortest Path and Draw Methods Clean-up and Round

Table C.10.3: The choices offered in the Macros dialog box.

609

Appendix D XN extended-precision functions & macros Here we list the major instructions available at present with XN.xla(m) version 6051. The further down the list, the sparser the annotations. A more complete listing is available once you have installed XN.xla(m), and its Toolbar, which can be toggled on and off by clicking on the XN purple book icon fea- turing an X. Because this software is still developing and growing; whenever information provided here differs from the documentation provided with your installed version, consider the latter as authoritative. For a quick guide on the format used, also consult the Paste (Insert) Function window by clicking on its icon, fx. Note that numbers displayed by Excel are usually stored as their binary approximations; when they are text strings, they are shown within quotation marks " inside the function argument, or as 'a = . For the list of available functions click on the Help button of the XN Toolbar, click on Help-on-line, which will open up the Xnumbers version 6.0 Help file. For the most recent list of functions, which in- cludes the many recent updates from John Beyers, click on “changes to version 6.0” at the end of its first paragraph. For the older functions, use its Index of Functions or other items in its Contents. When in doubt, try them out!

In the list below, items shown within straight brackets [ ] are optional. The letter D is used as an abbre- viation for DgtMax; I recommend a value of 35 (roughly quintuple precision) to 50, as usually sufficient for final 15-decimal accuracy yet still very fast. The value of D = 35 is used here unless otherwise speci- fied. As long as you avoid degrading its performance by mixing in double-precision operations, XN func- tions and macros with D = 35 pass all NIST StRD linear and nonlinear least squares tests with flying col- ors. Whether you will find pE = 15 or ‘merely’ pE ≥ 14 may well depend on how you read in the data files. When you import test data, and then let a VBA routine read them from Excel, it will read the stored data, which are binary approximations of the data shown on the screen, see section 11.14. Instead, copy them literally and place them between quotation marks. In the same vein, be careful with your input ar- guments. Instead of 1/3 use xDiv(3,10), replace 0.317 by “0.317”, for -2 substitute xNeg(2) or “-2”, etc., e you may degrade the accuracy of your output. To change the default D-value, use the XN Toolbar, select X-Edit B Configuration, and enter the de- sired value in the Default digits window. For 32-bit systems, the current D-values range from D ≤ 630 for XN.xla(m)6051-7A or -7M, to D ≤ 4030 for XN.xla(m)6051-13A or -13M. For best accuracy and speed, stay at least two packets (14 decimals for –7A and –7M, 26 decimals for –13A and –13M) below the up- per edges of these ranges. Using a D-value much larger than needed merely slows you down. D.1 Numerical constants The brackets are required, even when empty, in which case D assumes its default value, here set to 35.

xPi ([D]) π, the ratio of circumference to diameter of a circle π xPi() = 3.1415926535897932384626433832795029 when default D is 35; xPi(58) = 3.141592653589793238462643383279502884197169399375105820975; xPi(600) = 3.141592653589793238462643383279502884197169399375105820974 94459230781640628620899862803482534211706798214808651328230664709384 46095505822317253594081284811174502841027019385211055596446229489549 30381964428810975665933446128475648233786783165271201909145648566923 46034861045432664821339360726024914127372458700660631558817488152092 09628292540917153643678925903600113305305488204665213841469519415116 09433057270365759591953092186117381932611793105118548074462379962749 56735188575272489122793818301194912983367336244065664308602139494639 522473719070217986094370277053921717629317675238467481846766940513.

611

x2Pi([D]) 2π 2π xPi(50) = 6.2831853071795864769252867665590057683943387987502; xPi(5) = 6.2832; xPi() = 6.2831853071795864769252867665590058.

xPi2 ([D]) π/2 π/2 xPi2(50) = 1.5707963267948966192313216916397514420985846996876.

xPi4 ([D]) π/4 π/4 xPi4(50) = 0.78539816339744830961566084581987572104929234984378.

xE ([D]) e, the base of the natural logarithm e xE() = 2.7182818284590452353602874713526625 when the default D is 35

xEu ([D]), xGm([D]) γ, Euler’s gamma γ xEu(42) = xGm(42) = 0.577215664901532860606512090082402431042159.

xLn2 ([D]) Natural logarithm of 2 ln (2) xLn2(50) = 0.69314718055994530941723212145817656807550013436026.

xLn10 ([D]) Natural logarithm of 10 ln (10) xLn10(50) = 2.3025850929940456840179914546843642076011014886288.

xRad5 ([D]) Square root of 5 √ (5) xRad5(50) = 2.2360679774997896964091736687312762354406183596115.

xRad12 ([D]) Square root of 12 √ (12) xRad12(50) = 3.4641016151377545870548926830117447338856105076208. D.2 Basic mathematical operations

xAbs (a) Absolute value |a| Do not enter D in this instruction. xAbs("-1.2345") = 1.2345; xAbs("-1234567890.0987654321") = 1234567890.0987654321; xCos(xPi()) = -1 so that xAbs(xCos(xPi())) = 1.

xIncr (a) Increment a by 1 a+1 e.g., xIncr(xPi()) = 4.1415926535897932384626433832795029 and

xIncr(xPi(28)) = 4.141592653589793238462643383 for (π + 1 ), where xPi([D]) has an optional D, while xIncr(xPi(),28) yields #VALUE! because it incorrectly specifies D for xIncr(), which cannot handle it.

xAdd (a, b [,D]) Addition a+b e.g., Add(xPi(),xE()) = 5.8598744820488384738229308546321654,

xAdd(xPi(),xE(),21) = 5.85987448204883847382 for (π + e ) with 35 (the default used here) or 21 decimals respectively.

xSum (A [,D]) Summation of terms in a cell range Σ ai Ignores empty cells as well as cells containing text. Example: Place the instruction =xPi() in cell B3, =xIncr(B3) in B4, and copy this down to B8. In cell B10 then place the instruction =xSum(B3:B8), which will yield 33.849555921538759430775860299677017. In cell B11 verify that you get the same answer with =xAdd(15,xMult(6,xPi())) for (1+2+3+4+5) + 6 π.

xNeg (a) Negation –a Do not use –a because it will convert the result to double precision. Instead, always use xNeg instead of a minus sign in XN, otherwise you will revert to double precision. Using quotation marks surrounding a fractional number uses it as shown, xNeg("-1234567890.0987654321") = 1234567890.0987654321 whereas xNeg(-1234567890.0987654321) = 1234567890.098759889602661133 uses the value stored by Excel approxi- mating the 15-decimal number -1234567890.09876 in binary notation. No such distortion (but still truncation to 15 decimals) occurs with integers: xNeg(-12345678900987654321) = 123456789009876. 612

xSub (a, b [,D]) Subtraction a–b equivalent to xAdd(a, xNeg(b)). Do not use xAdd(a,–b) because the notation –b will make the result double precision. Example: (π – e ) B xSub(xPi(),xE()) = 0.4233108251307480031023559119268404. Also: xSub("1.000000000000000012345678","1.000000000000000023456789") = -1.1111111E-17, with all leading zeroes automatically deleted. And note: xSub(1.2345678901234," 1.2345678901234") = 6.9057879591E-17 illus- trates the distortion due to decimal-to-binary conversion.

xMult (a, b [,D]) Multiplication a × b e.g., xMult(6, Pi()) = 18.849555921538759430775860299677017, and xMult(6,Pi(42),42) = 18.849555921538759430775860299677017305183.

xProd (a [,D]) Multiplication of components of a cell range Π ai Ignores empty cells as well as cells containing text. The range can be a column, a row, or a rectangular array, but not an enumeration of comma-separated cell values or cell addresses..

xInv (a) Inversion 1/a When a = 0, xInv(a) yields ″?″. Example: 1/9 in 42-decimal precision is xInv(9,42) = 0.111111111111111111111111111111111111111111

xDiv (a, b [,D]) Division a/b or: xMult(a, xInv(b)). When b = 0, xDiv(a,b) yields ″?″. xDiv(7,9,42) = 0.777777777777777777777777777777777777777778

xDivInt (a, b) Integer division int (a/b) xDivInt(a,0) B ″?″. xDivInt(7,9) = 0; xDivInt(13,7) = 1; xDivInt(-13,7) = -2. p xPow (a, p [,D]) Power a where a can be positive or negative, and with integer or noninteger powers p xPow(xPi(),xNeg("2.7"),21) = 4.54668999316115830687E-2 but xPow(xPi(),xNeg(2.7),21) = 4.54668999316115738232E-2; and watch this: xPow(xNeg(xPi());xNeg("2.7"),21) = -2.67247732472589436167E-2 -3.67834947262189055211E-2j because –π–2.7 has a complex root. p xPow2 (p [,D]) Power of 2 2 where the power p can be positive or negative, integer or noninteger. e.g. xPow2(xNeg("400.3") = 3.1455220629461415507035091262930301E-121; xMult(xPow2(xNeg("400.3")),xPow2("400.3"),34) = 1. p xExp (p [,D]) Exponential e xExp(80) = 55406223843935100525711733958316613, xExp(800) = 2.7263745721125665673647795463672698E+347 and xExp(800,14) = 2.7263745721126E+347. The latter two cannot be read by Excel or reduced to double precision, because Excel cannot store numbers beyond E308. p xExpa (p [,a] [,D]) Arbitrary power a Note the unusual argument order: power first, then the value raised to it: xExpa(3,7) = 343 = 7^3. When a is unspecified, a = 10: xExpa(3) = 1000; xExpa(3,xPi()) = π3 = 31.006276680299820175476315067101396, xExpa(xNeg(3),xPi()) = (-π)3 = -3.2251534433199492956082745196133453E-2; watch the commas: xExpa("3.01",17) = 5054.1863831357180932094218872658106 but xExpa("3.01",,17) = 1023.2929922807541 and xExpa(3.01,,17) = 1023.2929922807536; xExpa(xNeg("3.01")) = 31.363254111413810434877685894955175; xExpa(xNeg("3.01"),xNeg(xPi()),21) = (-π)-3.01 = -3.18844465707427014412E-2). x xExpBase (a,ax [,D]) Arbitrary power a Arbitrary power of any base. Similar to xExpa(x,a[,D]) but a not optional.

613

xSqr (a [,D]) Square root of a √ (a) xSqr("4.7") = 2.1679483388678799418989624480732099 = √ (4.7), xSqr("4.7",50) = 2.167948338867879941898962448073209935826865748722.

xSqrPi (a [,D]) Square root of a times π √ (aπ)

for a ≥ 0. If a is omitted, a = 1. xSqrPi(,21) = 1.7724538509055160273 = √ π , xSqrPi("4.7",21) = 3.84258838179059041156 = √ (4.7 π) to 21 decimals. 1/ b xRoot (a [,b] [,D]) Arbitrary root a

b need not be an integer; default: b = 2. xRoot(9) = 3 = √ 2 , as is xRoot(9,2), but xRoot(2,9) = 1.0800597388923061698729308312885969, and xRoot(2,,9) = 1.41421356; xRoot(78,9) = 1.6226794404526244307856240252218919 = 781/9, while xRoot(78,"9.0001") = 1.6226707127436371883687249182251982.

xLn (a [,D]) Natural logarithm ln a xLn(11,50) = 2.3978952727983705440619435779651292998217068539374.

xLog (a [,base] [,D]) General logarithm log n a, log a Optional base must be positive; default = 10. Analogous to Excel’s LOG(a [,base]) where LOG(4,2) = 2 = log2(4) and LOG(4) = 0.60206.. = log10(4), XN uses xLog(30,3) = 3.0959032742893846042965675220214013 =log3(30) at Ddefault = 35, and xLog(30,,35) = xLog(30) = 1.4771212547196624372950279032551153 =log10(30) D.3 Trigonometric and related operations All angles are assumed to be in radians. The prefix ar stands for area, the prefix arc for arc.

xSin (α [,D]) Sine sin α xSin(0.5,50) = 0.4794255386042030002732879352155713880818033679406; xSin(xPi()) = -1.5802830600624894179025055407692184E-35; xSin(xPi(46),46) = 3.751058209749445923078164062862089986280348253E-46; xSin(xSub(xPi(),0.00000001)) = 1.0000000000000000042558941617530493E-8; xSin(xSub(xPi(),"0.00000001")) = 9.9999999999999998333333333175305036E-9.

xCos (α [,D]) Cosine cos α xCos("0.5",50) = 0.87758256189037271611628158260382965199164519710974 and xCos(0.5,50) = 0.87758256189037271611628158260382965199164519710974, because 0.5 = ½ is exactly convertible into binary notation, as are 0.75, 0.625, etc.; xCos(xPi2(),50) = 4.2098584699687552910487472296153908203143104499314E-35.

xCos(xPi2(50),50) = -4.7089512527703846091796856895500685982587328941466E-50.

xTan (α [,D]) Tangent tan α xTan(0.5,50) = 0.54630248984379051325517946578028538329755172017979.

xASin (a [,D]) Inverse sine arcsin a |a| ≤ 1; xASin(1) = 1.5707963267948966192313216916397514; xASin(xNeg(1),48) = -1.57079632679489661923132169163975144209858469969.

xACos (a [,D]) Inverse cosine arccos a |a| ≤ 1; xACos(0,48) = 1.57079632679489661923132169163975144209858469969.

xATan (a [,D]) Inverse tangent arctan a xATan(1,50) = 0.78539816339744830961566084581987572104929234984378.

xATan2 (a, b [,D]) Inverse tangent of quotient a/b arctan (a/b) xATan2(3,4,50) = 0.64350110879328438680280922871732263804151059111531; note that the order of a and b is reversed from that used in Excel’s ATAN2.

xSinH (a [,D]) Hyperbolic sine sinh a sinh a = ( ex – e–x) / 2; xSinH(3) = 10.017874927409901898974593619465828.

614

xCosH (a [,D]) Hyperbolic cosine cosh a cosh a = ( ex + e–x) / 2; xCosH(0.3) = 1.0453385141288604816444546338323457 but xCosH(xDiv(3,10)) = xCosH("0.3") = 1.0453385141288604850253090463229121.

xTanH (a [,D]) Hyperbolic tangent tanh a tanh a = (ex – e–x) / ( ex + e–x); xTanH("0.1",28) = 9.966799462495581711830508368E-2

xASinH (a [,D]) Inverse hyperbolic sine arsinh a arsinh a = ln [a+√(a2+1)]; xASinH("0.1",28) = 0.0998340788992075633273031247

xACosH (a [,D]) Inverse hyperbolic cosine arcosh a arcosh a = ln [a+√(a2–1)], a > 1;

xATanH (a [,D]) Inverse hyperbolic tangent artanh a artanh a = ½ ln [(1+a)/(1–a)]; xATanH(0.1,28) = 0.1003353477310755862429135451; xATanH("0.1",28) = 0.1003353477310755806357265521.

xAngleC (a [,D]) Complement of angle α π / 2 – α xAngleC(0.25,21) = 1.3207963267948966192313216916397514; xSub(xPi2(21),0.25,21) = 1.3207963267948966192313216916397514.

xDegrees (a [,D]) Converts radians into degrees radians→degrees xDegrees(xPi4()) = 45; xdegrees(xMult(4,xPi()),28) = 720.

xRadians (a [,D]) Converts degrees into radians degrees→radians xRadians(180) = 3.1415926535897932384626433832795029 = xPi()

xAdjPi (a [,D]) Adjusted angle, in radians, between –π and +π xAdjPi(xMult(5.75,xPi()),21) = -2.35619449019234492885 = xMult(3,xNeg(xPi4()),21)

xAdj2Pi (a [,D]) Adjusted angle, in radians, between 0 and 2π xAdj2Pi(xMult(6.75,xPi()),21) = 2.35619449019234492885 = xMult(3,xPi4(),21) D.4 Statistical operations

A is an array of numbers ai in a contiguous row, column, or block. n xMean (A [,D]) Mean (∑ai ) /n i=1 xMean(1,3,4,10) = xMean({1,3,4,10},21) = xMean(C14:C17,21) = 4.5 when C14:C17 contains 1, 3, 4, and 10 respectively.

xMedian (A) Median xMedian(1,3,4,10) = xMean(C14:C17,21) = 3.5 when C14:C17 contains 1, 3, 4, and 10 respectively. Do not specify D.

n xGMean (A [,D]) Geometric mean a1 × a2 ×L× an xGMean({1,3,4,10},21) = xGMean(C14:C17,21) = 3.30975091964687310503 when C14:C17 contains 1, 3, 4, and 10 respectively; A must be an array or a named range. n  1  xHMean (A [,D]) Harmonic mean n ∑  i=1  ai  xHMean({1,3,4,10},21) = xHMean(C14:C17,21) = 2.37623762376237623762 when C14:C17 contains 1, 3, 4, and 10 respectively; A must be an array or a named range.

615

n 2 xQMean (A [,D]) Quadratic mean (∑ai )/n i=1 xQMean({1,3,4,10},21) = xQMean(C14:C17,21) = 5.61248608016091207838 when C14:C17 contains 1, 3, 4, and 10 respectively; A must be an array or a named range. n 2 ∑(ai − aav ) i=1 xStDev (A [,D]) Standard deviation n −1

xStDev({3.1,3.2,3.3},21) = xStDev(B3:B5,21) = 9.99999999999998667732E-2 when B3:B5 contains 3.1, 3.2, and 3.3 respectively; xStDev({"3.1","3.2","3.3"},21) = 0.1 n 2 ∑(ai − aav ) i=1 xStDevP (A [,D]) Population standard deviation n xStDevP({3.1,3.2,3.3},21) = xStDevP(B3:B5,21) = 0.081649658092772494494 when B3:B5 contains 3.1, 3.2, and 3.3 respectively; xStDev({"3.1","3.2","3.3"},21) = 8.16496580927726032732E-2. n 2 ∑(ai − aav ) i=1 xVar (A [,D]) (Sample) variance n −1 xVar({3.1,3.2,3.3},21) = xVar(B3:B5,21) = 9.99999999999997335465E-3 when B3:B5 contains 3.1, 3.2, and 3.3 respectively; xVar({"3.1","3.2","3.3"},21) = 0.01 n 2 ∑(ai − aav ) i=1 xVarP (A [,D]) Population variance n xVarP({3.1,3.2,3.3},21) = xVarP(B3:B5,21) = 6.6666666666666489031E-3 when B3:B5 contains 3.1, 3.2, and 3.3 respectively; xVar({"3.1","3.2","3.3"},21) = 6.66666666666666666667E-3.

xFact (n [,D]) Factorial n! For n a positive integer; if not integer, n is rounded down to the next integer. xFact(27) = 10888869450418352160768000000, xFact(28) = 3.04888344611713860501504E+29, xFact(1E7) = 1.2024234005159034561401534879443076E+65657059, xFact(xFact(25)) = 3.5679279579588489448587652949509 × E+384000963322077998379052338.

xFact2 (n [,D]) Double factorial n n (2n)! k n odd: (2n −1)!!= (2i −1) = ; n even: (2n)!!= (2i) = n!2 ∏ k ∏ i=1 n!2 i=1 xFact(27) = 10888869450418352160768000000, xFact(28) = 3.04888344611713860501504E+29, xMult(xFact2(27),xFact2(28)) = 3.04888344611713860501504E+29 = xFact(28).  n  n! xComb (n, m [,D])   = m m!(n − m)!

616

xComb(20,10) = 184756, xComb(200,100) = 9.0548514656103281165404177077484164E+58, xComb(2000,1000,45) = 2.048151626989489714335162502980825 04439642489E+600 or, displayed in its full 600-decimal glory, as xComb(2000,1000, D) with D ≥ 601.  n  n! xComb_Big (n, m [,D]) Binomial coefficient for large numbers   = m m!(n − m)! xComb_Big(10000000,9000000,28) = 1.093540446065167765202685186E+1411814

vAB xCorrel (A, B [,D]) Correlation coefficient rAB = s A sB xCorrel({1,2,3,4,5,6},{7,5,8,6,9,7},21) = 0.377964473009227227215; xDiv(xCovar(A12:A17,A19:A24),xMult(xStDevP(A12:A17),xStDevP(A19:A24)),21) = 0.3779644730092272272145, see (2.10.2), when A12:A17 = {1,2,3,4,5,6} etc. xCorrel({1,2,3,4,5,6},{3,4,5,6,7,8},21) = 1. A and B are data sets, addressed either as a listing of their individual values (see the above examples) or by reference to their spreadsheet addresses ranges. Note: in this book we deal with physical laws, and a correlation coefficient rxy ≤ 0.9 is usually considered insignificant. However, in the social sciences, where there are often many complicating factors, andrxy= 0.9 may be viewed as highly significant. It all depends on the context. 1 N xCovar (n, m [,D]) Covariance ∑(ai,k − ai,av )(a j,k − a j,av ) N k=1 xCovar({1,2,3,4,5,6},{7,5,8,6,9,7}) = 0.83333333333333333333333333333333333, xCorrel({1,2,3,4,5,6},{1,2.1,3,4,5,6}) = 0.9997952055948281569160316960045599.

xStatis (A[,D]) Univariate statistical summary of a data range A Yields five parameters in row format (deposit the instruction with block-enter): number of data N; their mean; sample standard deviation; population standard n-1 n 2 deviation; and autocorrelation with lag 1 = Σ1 {(xi–xav) (xi+1–xav)}/ Σ1 {(xi–xav) . xStatis({1,2,3,4,5,6},18) = {6, 3.5, 1.87082869338697069, 1.70782512765993306, 0.5}.

xRand ([,D]) Random number between 0 and 1 U(0, 1) xRand() = 0.36884713172912601715122290811538286.

xRandD (a,b [,D]) Random number between a and b U(a, b) xRandD(4.1,4.3) = 4.1971631407737729339958908101987838. Note that a can be smaller or larger than b.

xRandI (a,b [,D]) Random integer between a and b xRandI(4.2,-11.3) = -2; a can be smaller or larger than b, and neither needs to be integer. D.5 Least squares functions

xIntercept (y, x [,D]) Intercept of least squares straight line with y-axis a0

xSlope (y, x [,D]) Slope of least squares straight line a1

xRegLinCoef (y, x [,D] [,intercept]) Least squares coefficients a0 through ap y is the vector of n dependent variables; x is the vector of n (or the matrix of n×m) independent variables; intercept forces the y-intercept through y = intercept for x = 0. The output yields the least squares coefficients, in row format.

xRegLinCov (y, x , coef [,D] [,intercept]) Least squares covariance matrix CM y is the vector of n dependent variables, x is the vector of n (or the matrix of n×m) independent variables, coef refers to the output of xRegLinCoef, and intercept forces the y-intercept through y = intercept for x = 0. The output yields the covariance matrix.

617

xRegLinErr (y, x, coef [,D] [,intercept]) Standard deviations of LS coefficients s0 through sp y is the vector of n dependent variables; x is the vector of n (or the matrix of n×m) independent variables; and intercept forces the y-intercept through y = intercept for x = 0. The output yields the standard deviations of the coefficients, in row format.

xRegLinEval (coef, x [,D]) Evaluating a least squares fit at a specified x-value Coef refers to the output of xRegLinCoef, and x is the specific value at which the fitting function is to be evaluated. 2 xRegLinStat (y, x , coef [,D] [,intercept]) More statistical least squares information r and sf y is the vector of n dependent variables, x is the vector of n (or the matrix of n×m) independent variables, coef refers to the output of xRegLinCoef, and intercept forces 2 the y-intercept through y = intercept for x = 0. Outputs r and sf in row format.

xRegPolyCoef (y, x, degree [,D] [,intercept]) Least squares coefficients a0 through ap y is the vector of n dependent variables; x is the vector of n independent variables; degree is the highest polynomial order; and intercept forces the y-intercept through y = intercept for x = 0. The default, intercept = TRUE, is to include a0 in the analysis. In default mode (D = 35), xRegPolyCoef(B3:B84,C3:C84,10) aces the NIST LLS test Filip.dat (see exercise 11.13.3) provided that (1) the y-values in B3:B84, and the x-values in C3:C84, are in string format, i.e., preceded by an apostrophe, either manually or, faster, with the instruction xCStr(xRoundR(number,15)), and (2) the output data z are copied with the instruction = xCDbl(xRoundR((address,15)) where number is an input value read from the spreadsheet, and address an output result displayed there. If (1) and/or (2) are disregarded, the output may ‘only’ agree to pE = 14.0 instead of to pE = 15. Use a block-enter; the output is in row format.

xRegPolyErr (y, x, degree , coef [,D] [,intercept]) Standard deviations of LS coefficients s0 through sp y is the vector of n dependent variables; x is the vector of n independent variables; degree is the highest polynomial order; and the optional intercept forces the y-intercept through y = intercept for x = 0. Do not forget to enter the coefficients from xRegPolyCoef! The default, intercept = TRUE, is to include a0 in the analysis. The output yields the standard deviations s of the coefficients. 2 xRegPolyStat (y, x,degree , coef [,D] [,intercept]) More statistical least squares information r and sf y is the vector of n dependent variables; x is the vector of n independent variables; degree is the highest polynomial order; and the optional intercept forces the y-intercept through y = intercept for x = 0. Do not forget to enter the coefficients from xRegPolyCoef! The de- 2 fault, intercept = TRUE, is to include a0 in the analysis. The output yields r and the standard devia- tions sf of the over-all fit of the model function to the data.

xRegrL (y, x [,D] [,intercept] [,ε] [,tol]) Least squares coefficients obtained by SVD a0 through ap This function uses SVD rather than the traditional pseudo-inverse; y is the vector of n dependent variables; x is the vector of n (or the matrix of n×m) independent variables; and intercept forces the y-intercept through y = intercept for x = 0; ε is the resolution (default: 10–D); tol (for tolerance, default: 0) specifies the largest absolute value that should be considerd round-off error and therefore can be set to 0 (similar to Tiny).

xRegrLC (y, x [,cf] [,D] [,intercept] [,ε] [,tol]) Least squares coefficients of complex data by SVD The extension of xRegrL to complex data. cf defines the complex format used; default = 1 for split format. D.6 Statistical functions Note: even though their names have the prefix x, the functions xGamma, xGammaLn, xGammaLog, xGammaQ and xBeta used to be double precision. John Beyers has now converted them to fully extended precision. If you have used them earlier in programs that plotted their output, make sure to use them now within an x CDbl() command so that their outputs will still be read properly by the graph. While Excel’s functions treat numerical strings as numbers, Excel’s graphs do not recognize such strings as valid input data.

618

xGamma (x [,D]) Gamma function Γ(x) Γ(n) = ±∞ for n a non-positive integer, Γ(n) = (n – 1)!, Γ(1/2) = √π. xGamma(-101.01,50) = 1.01316813059536869258112405851033723855160984E-158, xGamma(0.5,40) = xSqr(xPi(40),40) = 1.772453850905516027298167483341145182798, xGamma(1000,50) = 4.0238726007709377354370243392300398571937486421071E+2564. xGamma(0.000000001) = 999999999.42278427380593167581398533 for Ddefault = 35.

xGammaLn (x [,D]) Natural logarithm of the gamma function ln Γ(x) xGammaLn(0.5,70) = xLn(xGamma(0.5,70),70) = xLn(xSqr(xPi(70),70),70) = 0.5723649429247000870717136756765293558236474064576557857568115357360689.

xGammaLog (x [,D]) 10-based logarithm of the gamma function log Γ(x) xGammaLog(1000,70) = xLog(xGamma(1000,70),,70) = xLog(xFact(999,70),,70) = 2567.604644222132848771423057804523691677114513162463461310044207289183.

xGammaQ (x1 ,x 2 [,D]) Ratio of two gamma functions Γ(x1)/Γ(x2)

xGammaQ(0.5,1000,25) = 4.404845845680923991421408E-2565, xGammaQ(0.5,1000,65) = xDiv(xGamma(0.5,65),xGamma(1000,65),65) = xDiv(xSqr(xPi(70),70),xFact(999,65),65) = 4.4048458456809239914214080519445322777708010072456291610680796307E-2568. 1 x−1 y−1 xBeta(x,y[,D] Complete Beta function B (x,y) = ∫t (1− t) dt 0 where Β(x, y) = Γ(x) Γ(y) / Γ(x+y), provides an easy check on the function. Let B1, B2, etc are cell addresses, then for x = 1.2, y = 3.4 and x+y = 4.6 we have B1: xGamma("1.2",50) = 0.91816874239976061064095165518583040068682199965868, B2: xGamma("3.4",50) = 2.9812064268103329717913686054439211818356413783808, B3: xGamma("4.6",50) = 13.381285870932449355274522094100253203034374722681, B4: xDiv(xMult(B1,B2,50),B3,40) = 0.2045581106435018057463802648086835068269, finally in B5: xBeta("1.2","3.4") = 0.20455811064350180574638026480868351, and xBeta("1.2","3.4",50) = 2.0455811064350180574638026480868350682689657512436E-1.

xZeta (x [,D]) Riemann zeta function ζ(x) ζ(x) = 0 for x a negative even integer, ±∞ for x = 1: xZeta(1) = #VALUE!, xZeta(-101,50) = -7.2612008803606716303677281510706847232235031164793E+78, xZeta(-9,60) = -7.57575757575757575757575757575757575757575757575757575757576E-3, xZeta(0.999999) = -999999.42275565224980209723357694814, xZeta(0,600)= 0.5, xZeta(1.000001) = 1000000.57729800435533, xZeta(50,21) = 1.00000000000000088818 D.7 Statistical distributions type = 0 or FALSE (default) for the probability density f; type = 1 or TRUE for the corresponding cumulative distribution F. exp[−(x − µ)2 /(2σ 2 )] xNormal (x, µ, σ [,type] [,D]) Normal distribution f (x, µ,σ ) = σ 2π Extended-precision version of Excel’s NORMDIST: xNormal(-1000,7,0.5,0,40) = 1.354506334060962146056106217684345437524E-880792, xNormal(-10,7,0.5,,48)=7.58105280018573627361442359669669459333212880463E-252, xNormal(0,7,0.5) = 2.1932131187779426125067829785218123E-43,

xNormal(10,7,0.5) = xNormal(10,7,0.5,0) = 1.2151765699646570973992615481363651E-8, xNormal(45000,7,0.5) = 1.0582474958611311359386964761976518E-1306737131; xNormal(-9876,7,0.5,1) = 9.6676869595648374723957510755689408E-84838294,

xNormal(-10,7,0.5,1,45) = 1.1138987855743793865819505555930236035018809E-253, xNormal(3,7,0.5,1) = 6.2209605742717841235159951725881884E-16, xNormal(12,7,0.5,1,50) = 0.99999999999999999999999238014697583947393402665675, xNormal(14.6,7,0.5,1,50) = 1.

619

exp[−z 2 / 2] xNormalS (z[,type] [,D]) Standard normal distribution f (z) = 2π Extended-precision version of NORM.S.DIST of Excel 2010, with zero mean and unit

st. dev.: xNormalS(-1000,0,16) = xNormal(-1000,,16) = 2.290648437187064E-2171486, xNormalS(-10,0) = xNormal(-10,,1) = 7.6945986267064193463390335800418772E-23, xNormalS(0,0) = xNormal(0) = 0.39894228040143267793994605993438187, xNormalS(10,0) = xNormal(10) = 7.6945986267064193463390335800418772E-23, xNormalS(1000,0,21) = xNormal(1000,,21) = 2.29064843718706368675E-217148; xNormalS(-1000, 1,21) = 7.0452236580171781353528161610508209E-217586, xNormalS(-10, 1) = 7.6198530241605260659733432515993084E-24, xNormalS(0, 1) = 0.5, xNormalS(10,1) = 0.99999999999999999999999238014697584, xNormalS(1000, ,1) = 1. n! p k (1− p)n−k xBinomial (k, n, p [,type] [,D]) Binomial distribution f (k,n, p) = k!(n − k)! k > 0, n > 0, p ≠ 1; typically, k and n are integer, with k ≤ n, and 0 ≤ p ≤ 1. xBinomial(10,8,0.7) = xBinomial(10,8,0.7,0) = 0.3138613877777774857383467859235165, xBinomial(100,80,0.7) = 9.276388034479817828650417593685876E-6, xBinomial(100,80,0.5) = 8.2718061255302767487140869206996285E-25; xBinomial(100,80,0.7,1) = 1.4483734111111107223573231024739338. exp[−(x − µ) / s] xLogistic (x, µ, s [,type] [,D]) Logistic distribution f (x,µ,s) = s[]1− exp[−(x − µ) / s 2 s > 0. xLogistic(1,1,0.5) = xLogistic(1,1,0.5,0) = 0.5, xLogistic(0.1,1,0.5) = 0.24345868057417078321107988837114377, xLogistic(0.5,1,0.5) = 0.39322386648296370507484946717181805, xLogistic(2,1,0.5) = 0.20998717080701303469724836952085072, xLogistic(10,1,0.5) = 3.0459958561616145970616505932086991E-8; xLogistic(0.1,1,0.5,1) = 2.2648142878370235005474413358600984E-2, xLogistic(0.5,1,0.5,1) = 0.14973849934787756480856989948056052, xLogistic(1,1,0.5,1) = 0.3807970779778824440597291413023968, xLogistic(2,1,0.5,1) = 0.76159415595576488811945828260479359, xLogistic(10,1,0.5,1) = 0.88079706274790293129938019689418799.

exp[−(ln x − µ)2 /(2σ 2 )] xLogNorm (x, µ, σ [,type] [,D]) Lognormal distribution f (x,µ,σ ) = xσ 2π x > 0. xLogNorm(0.1,1,0.5,,28) = 2.680284603881915428668405659E-9, xLogNorm(1,1,0.5,,20) = xLogNorm(1,1,0.5,0,20) = 0.1079819330263761039, xLogNorm(10,1,0.5) = 2.6802846038819136119445616856654493E-3; xLogNorm(0.01,1,0.5,1) = 1.8139777883515688426389318351031983E-29, xLogNorm(1,1,0.5,1) = 2.2750131948179207200282637166533437E-2, xLogNorm(50,1,0.5,1) = 0.99999999712801243139612132792027695. 2 −ax 2 3 xMaxwell (x, a [,type] [,D]) Maxwell distribution f (x,a) = 4x e a /π Note that different authors define this distribution differently; here we use a = m/2kT where m is mass, k is the Boltzmann constant, and T the absolute temperature. xMaxwell(0.02,1,,28) = xMaxwell(0.02,1,1,28) = 9.02342324549578354005919324E-4, xMaxwell(1,1) = 0.83021499484118940668053649888267473, xMaxwell(5,1) = 7.8354332655086676541216841613105858E-10; xMaxwell(0.02,1,1) = 6.0165781054863134065267945144474112E-6, xMaxwell(1,1,1) = 0.42759329552912016600095238564127189, xMaxwell(5,1,1) = 0.99999999992010820755048528860859481.

620

−x2 / 2σ 2 2 xRayleigh (x, σ [,type] [,D]) Rayleigh distribution f (x,σ ) = xe /σ x ≥ 0. xRayleigh(0.01,1,,60) = xRayleigh(0.01,1,0,60) = 9.99950001249979187740640069032792883187110465298047034833696E-3, xRayleigh(1,1) = 0.60653065971263342360379953499118045, xRayleigh(10,1) = 1.9287498479639177830173428165270126E-21; xRayleigh(0.01,1,1) = 4.9998750020833075000834902025581322E-5, xRayleigh(1,1,1) 0.39346934028736657639620046500881955, xRayleigh(10,1,1) = 0.99999999999999999999980712501520361. k−1 kx −(x / λ)k xWeibull ((x, k, λ [,type] [,D]) Weibull distribution f (x,k,λ) = e λ k x ≥ 0. xWeibull(0.01,1,0.5,,60) = xWeibull (0.01,1,0.5,0,60) = 1.96039734661351060362544885658056190613736410084899623650741, xWeibull(1,1,0.5) = 0.27067056647322538378799898994496881, xWeibull(10,1,0.5) = 4.122307244877115655931880760311642E-9; xWeibull(0.01,1,0.5,1) = 1.9801326693244698187275571709719047E-2, xWeibull(1,1,0.5,1) = 0.8646647167633873081060005050275156, xWeibull(10,1,0.5,1) = 0.99999999793884637756144217203405962.

D.8 Operations with complex numbers Use the Configuration dialog box (under the X-Edit button on the XN toolbox) to select either i or j for √(–1). Here we will use j. Complex numbers will be denoted by z = a + j b, and must be defined in terms of their separate, real and imaginary components, a and b. The notation has been simplified by allowing single-cell or split formatting of both input and output, simply by highlighting a single cell or specifying two (horizontally or vertically) adjacent cells, see Fig. 11.12.6. Here we will use (except for the first three functions) the default (1, horizontally split) format for both input and output. (Note that this simplified notation applies only to operations on individual complex numbers, as considered in this section; for arrays of complex numbers this short notation would be ambiguous, and cf must be specified when it differs from the chosen default.) In B1 we have used =xCplx(3,4) to place 3+4j, and in E1 likewise =xCplx("5.6","7.8") to deposit 5.6+7.8j. The complex numbers z1 = 3 + 4 j and z2 = 5.6 + 7.8j are stored as strings in row 2: as ′3 in B2, ′4 in C2, ′5.6 in E2, and ′7.8 in F2. They are also stored as regular spreadsheet numbers in row 3, i.e.,as 3 in B3, as 4 in C3, as 5.6 in E3, and as 7.8 in F3. All exam- ples will assume D = 35 unless otherwise indicated. Array output in adjacent cells will be shown as separated by a comma, and must of course be entered with the block enter combination Ctrl∪Shift∪Enter.

xCplx (z [,D]) Converts Re(z) and Im(z) into a complex single-cell format xCplx(3,4) = 3+4j; xCplx("5.6","7.8") = 5.6+7.8j

xReal (z [,D]) Real part of a single-cell complex number a = Re(a + jb) xReal(xCplx(3,4)) = 3

xImag (z [,D]) Imaginary part of a single-cell complex number b = Im(a + jb) xImag(xCplx(3,4)) = 4 2 2 xCplxAbs (z [,D]) Absolute value of single-cell format |z| = a + jb = a + b xCplxAbs(B1) = xCplxAbs(B2:C2) = xCplxAbs(xCplx(3,4)) = 5

xCplxArg (z [,D]) Complex argument arg(z) = arctan(b/a) xCplxArg(B1,70) = xCplxArg(B2:C2,70) = xCplxArg(B2:C2,70) = 0.9272952180016122324285124629224288040570741085722405276218661774403957

xCplxNeg (z [,D]) Negation –z = –(a + j b) = – a – j b xCplxNeg(B1) = –3–4j; xCplxNeg(B2:C2) = xCplxNeg(B3:C3) = –3, –4

xCplxConj (z [,D]) Conjugate z* = a – j b xCplxConj(B1) = 3–4j; xCplxConj(B2:C2) = xCplxConj(B3:C3) = 3, –4

621

xCplxAdd (z1, z2 [,D]) Addition z1+z2 = (a1 + a2) + j (b1 + b2) xCplxAdd(B1,E1) = 8.6+11.8j; xCplxAdd(B2:C2,E2:F2) = 8.6, 11.8; xCplxAdd(B3:C3,E3:F3,21) = 8.59999999999999964473, 11.7999999999999998224

xCplxSub (z1, z2 [,D]) Subtraction z1–z2 = (a1 – a2) + j (b1 – b2) xCplxSub(B1,E1) = -2.6-3.8j; xCplxSub(B2:C2,E2:F2) = -2.6, -3.8; xCplxSub(B3:C3,E3:F3,21) = -2.59999999999999964473, -3.79999999999999982236

xCplxMult (z1, z2 [,D]) Multiplication z1 z2 = (a1a2–b1b2) + j (a1b2+a2b1) xCplxMult(B1,E1) = -14.4+45.8j; xCplxMult(2:C2,E2:F2) = -14.4, 45.8; xCplxMult(B3:C3,E3:F3,21) = -14.4000000000000003553, 45.799999999999998046 n 2 2 xCplxPow (z, n [,D]) Integer power z = a + b exp[n arctan(a / b)] xCplxPow(B1,2) = -7+24j; xCplxPow(B2:C2,2) = xCplxPow(B3:C3,2) = -7, 24

1/n n xCplxRoot (z, n [,D]) Integer root z = a + jb xCplxRoot(B1,2) = xCplxRoot(B3:C3,2) = 2+j, –2–j; xCplxRoot(E1,2) = xCplxRoot(E2:F2,2,21) = 2.75699864955772539922+1.41458175927131251328j in one cell, and -2.75699864955772539922-1.41458175927131251328j in the next; likewise, xCplxRoot(E3:F3,2,21) = 2.75699864955772533513+1.41458175927131251395j in one cell, and -2.75699864955772533513-1.41458175927131251395j in the next.

½ xCplxSqr (z [,D]) Square root z = a + jb xCplxSqr(B1) = 2+j; xCplxSqr(B2:C2) = xCplxSqr(B3:C3) = 2, 1 xCplxSqr(E1,19) = xCplxSqr(E2:F2,19) = 2.756998649557725399, 1.414581759271312513 xCplxSqr(E2:F2,19) = 2.756998649557725335, 1.414581759271312514 (a1a2 + b2b2 ) + j(−a1b2 + a2b1) xCplxDiv (z , z [,D]) Division z /z 1 2 1 2 = 2 2 a2 + b2 xCplxDiv(B2:C2,E2:F2,21) = 0.52060737527114967462, -1.08459869848156182213E-2 xCplxDiv(B3:C3,E3:F3,21) = 0.520607375271149693469, -1.08459869848156286485E-2

1 a − jb xCplxInv (z [,D]) Inversion 1/z = = a + jb a2 + b2 xCplxInv(B1) = 0.12-0.16j when placed in one cell; when placed in two cells, xCplxInv(B1) = xCplxInv(B2:C2) = xCplxInv(B3:C3)= 0.12, –0.16; xCplxInv(E2:F2,21) = 0.060737527114967462039, -8.45986984815618221258E-2 xCplxInv(E3:F3,21) = 6.07375271149674626325E-2, -8.45986984815618263928E-2 z a b xCplxExp (z [,D]) Exponential e = e cos(a) + j e cos(b) xCplxExp(E1,28)=14.59097054392448671115070825+270.0324895489463602631116766j xCplxExp(E2:F2,21) = 14.5909705439244867112, 270.032489548946360263 xCplxExp(E3:F3,21) = 14.5909705439245294948, 270.032489548946261736

xCplxLn (z [,D]) Natural logarithm ln z In one cell: xCplxLn(E1,21) = 2.26198006528127407189+0.948125538037829317382j, in two: xCplxLn(E1,70) = xCplxLn(E2:F2,70) = 2.261980065281274071885982930024169450064511264424455256333274238956, 0.948125538037829317381598341175288215151321283505545372210918578809796; xCplxLn(E3:F3,25) = 2.261980065281274035279931, 0.9481255380378293366479415

xCplxLog (z, b [,D]) Logarithm to base b logb (z) = ln(z) / ln(b) Careful: xCplxLog(E1,,21) = 0.982365460526814654246+0.411765689321380975201j which assumes that the non-specified base is 10, whereas xCplxLog(E1,21) = 0.74296711932683140068942681618616545+0.3114201184034633742533121651615121j for log21(z) with the default number of decimals, here 35. If you need the 10-based log, use: 622

xCplxLog10 (z [,D]) 10-based logarithm log(z) = log10(z) = ln(z) / ln(10) In two cells: xCplxLog10(E1,25) = xCplxLog10(E2:F2,70) = 0.9823654605268146701442103566059571819809685627552493938363525724175293, 0.4117656893213809668342048131500706165852505219562462786489498073138795; xCplxLog10(E3:F3,25) = 0.982365460526814654246404, 0.4117656893213809752014713

xCplxLog2 (z [,D]) 2-based logarithm log2(z) = ln(z) / ln(2) xCplxLog2(E2:F2,25)= 3.263347422770987814603177, 1.367856011867356597452088 xCplxLog2(E3:F3,25) =3.263347422770987761791808, 1.367856011867356625247546 xCplxSin(z [,D]) Sine sin (z) xCplxSin(E2:F2,25)= -770.335431725789249221414, 946.4236495468643587804233 xCplxSin(E3:F4,25)= -770.3354317257894486197362, 946.4236495468639169837239

xCplxCos (z [,D]) Cosine cos (z) xCplxCos(E2:F2,25)= 946.4239673233332876174362, 770.3351730737666499652134 xCplxCos(E3:F4,25)= 946.4239673233328458207013, 770.3351730737668493633767

xCplxTan (z [,D]) Tangent tan (z) xCplxTan(E2:F2,24) = -3.2877408328165508373533E-7, 0.999999931837917456442433 xCplxTan(E3:F4,24) = -3.2877408328165524897145E-7, 0.999999931837917456442642

xCplxASin (z [,D]) Inverse sine arcsin (z) xCplxASin(E2:F2,24)= 0.620108349818012666322386, 2.95600293720697536127987 xCplxASin(E3:F4,24)= 0.620108349818012646903013, 2.95600293720697532483704

xCplxACos (z [,D]) Inverse cosine arccos (z) xCplxACos(E2:F2,24)= 0.950687976976883952908935, -2.95600293720697536127987 xCplxACos(E3:F4,24)= 0.950687976976883972328309, -2.95600293720697532483704

xCplxATan (z [,D]) Inverse tangent arctan (z) xCplxATan(E2:F2,24) = 1.50969874144921909210512, 8.44859768081672965961273E-2 xCplxATan(E3:F4,24) = 1.50969874144921909146551, 8.44859768081673008713949E-2

xCplxSinH (z [,D]) Hyperbolic sine sinh (z) xCplxSinH(E2:F2,24) = 7.29538551206624025612712, 135.018091013076278249296 xCplxSinH(E3:F4,24) = 7.29538551206626164758967, 135.018091013076228986589

xCplxCosH (z [,D]) Hyperbolic cosine cosh (z) xCplxCosH(E2:F2,24) = 7.29558503185824645502359, 135.014398535870082013816 xCplxCosH(E3:F4,24) = 7.29558503185826784721294, 135.014398535870032749833 xCplxTanH(z [,D]) Hyperbolic tangent tanh (z) xCplxTanH(E2:F2,24) = 1.00002718952482972149739, 2.94696926173800019499848E-6 xCplxTanH(E3:F4,24) = 1.00002718952482972151566, 2.94696926173801194879248E-6

xCplxASinH (z [,D]) Inverse hyperbolic sine arsinh (z) xCplxASinH(E2:F2,24) = 2.95426910101325167773266, 0.945549735665370431458319 xCplxASinH(E3:F4,24) = 2.95426910101325164096493, 0.945549735665370450568323

xCplxACosH (z [,D]) Inverse hyperbolic cosine arcosh (z) xCplxACosH(E2:F2,24) = 2.95600293720697536127987, 0.950687976976883952908935 xCplxACosH(E3:F4,24) = 2.95600293720697532483704, 0.950687976976883972328309

xCplxATanH (z [,D]) Inverse hyperbolic tangent artanh (z) xCplxATanH(E2:F2,24)=6.03776070460713078765599E-2, 1.48608980485008744950066 xCplxATanH(E3:F4,24)=6.03776070460713084243571E-2, 1.48608980485008744524278

623

xCplxPolar(z [,D]) Convert to polar z = ρ ejθ xCplxPolar(E1,,35) = xCplxPolar(E2:F2,,35) = xCplxPolar(E2:F2) = 9.60208310732624309126871450256650, 0.94812553803782931738159834117528822 xCplxPolar(E3:F4,,25) = 9.602083107326242739774361, 0.9481255380378293366479415

xCplxRect (z [,D]) Convert to rectangular z = ρ { cos (θ ) + j sin (θ )} xCplcRect(xCplxPolar(E1,,35),21) = 5.6, 7.8000000000000000000000000000000001, xCplcRect(xCplxPolar(E2:F2,35),21) = 5.6, 7.8000000000000000000000000000000001, xCplcRect(xCplxPolar(E3:F3,21),21) = xCplcRect(xCplxPolar(E3:F3,500),21) = 5.59999999999999964472863212, 7.79999999999999982236431606. D.9 Matrix and vector operations D.9.1 Standard operations

We denote vectors as v with elements vi. Matrices are either square real S, rectangular real R or (square or rectangular) complex C, all with elements mij. cf denotes the complex format used: 1 for split (= default), 2 for interspersed, 3 for Ex- cel’s string format. The number of rows of a vector or matrix is indicated by r, the number of colums by c. Absolute ele- ment values mij smaller than ε are set to zero as probable rounding errors; the default value for ε is 1E–D. Noninteger numbers should be placed between quotation marks when their exact rather than their Excel-stored values are to be used. We will use the compact matrix notation {m11, m12, …; m21, m22, …; m31, m32, …; …} to denote a matrix with elements mij where commas separate individual elements in the same row, and semicolons separate different rows. Ddefault = 35. m n 2 xMAbs (R [,D]) Absolute value of a real matrix ||R|| = ∑∑(mi, j ) i==11j xMAbs({1,2;"3.1",-4}) = 5.5326304774492214410001161638167525; xMAbs({1,2; 3.1,-4}) = 5.5326304774492214907658309046178264 m n 2 xMAbsC (C [,cf] [,D]) Absolute value of a complex matrix ||C|| = ∑∑(mi, j ) i==11j xMAbsC({1,2,0,-3; "3.1",-4,-1,0;6,5,2,1}) = 10.325211862233142574713865204941196; xMAbsC({1,2,0,-3; 3.1,-4,-1,0; 6,5,2,1}) = 10.325211862233142601380176151460634

xMAdd (R1, R2 [,D]) Addition of two real matrices R1 + R2

R1 and R2 must have the same size m×n, i.e., c1 = c2 and r1 = r2.

xMAddC (R1, R2 [,cf] [,D]) Addition of two complex matrices R1 + R2

R1 and R2 must have the same size m×n.

xMSub (R1, R2 [,D]) Subtraction of two real matrices R1 – R2

R1 and R2 must have the same size m×n.

xMSubC (R1, R2 [,cf] [,D]) Subtraction of two complex matrices R1 – R2

R1 and R2 must have the same size m×n.

xProdScal (v1, v2 [,D]) Scalar product of two vectors (or matrices) v1 • v2

v1 and v2 must have the same size m. The scalar product is zero if v1 and v2 are perpendicular. This function can also be applied to two matrices R1 and R2 T where c1 = r2 in which case xProdScal(R1,R2) yields the product R1 R2

xProdScalC (v1, v2 [,cf] [,D]) Complex scalar product of two vectors v1 • v2

v1 and v2 must have the same size m. The scalar product is zero if v1 and v2 are perpendicular.

xProdVect (v1, v2 [,D]) Vector product v1 × v2

v1 and v2 must have the same size m.

xMMult (R1, R2 [,D]) Multiplication of two real matrices R1 R2

When R1 is m×p , R2 must be p×n, i.e., c1 = r2. 624

xMMultC (C1, C2 [,cf] [,D]) Multiplication of two complex matrices C1 C2

When R1 is m×p , R2 must be p×n, i.e., c1 = r2.

xMMultS (R, a [,D]) Multiplication of a real scalar a and a real matrix R a R Note the order of terms in the argument: first the matrix R, then the scalar a, regardless of the matrix size. aR will have the size of R.

xMMultSC (R, z [,cf] [,D]) Multiplication of a complex scalar z and a complex matrix C z C Note he order of terms in the argument: first the matrix C, first, then the scalar z, regardless of The matrix size. This order is the reverse of that in the function name. zC will have the size of C. n xMPow (S, n [,D]) power of a square, real matrix S S n must be a positive integer. n xMPowC (C, n [,cf] [,D]) Integral power of a complex matrix C C n must be a positive integer. –1 xMInv (S [,D]) Inversion of a square real matrix S Uses Gauss-Jordan diagonalization with partial pivoting. –1 xMInvC (S [,cf] [,D]) Inversion of a square complex matrix C Uses Gauss-Jordan diagonalization with partial pivoting.

xMDivS (R, a [,D]) Division of a real matrix R by a real scalar a R / a Note the order of terms in the argument: first the matrix R, then the scalar a, regardless of the matrix size. R / a will have the size of R. + -1 T xMPseudoInv (R [,D]) Pseudo-inverse of a rectangular real matrix R = V Σ U based on SVD. When R is m×n, R+ is n×m. When R is square and nonsingular, its pseudoinverse is equal to its inverse. Uses Gauss-Jordan diagonalization with partial pivoting. + -1 H xMPseudoInvC (C [,cf] [,D]) Pseudo-inverse of a complex matrix C = V Σ U based on SVD. When R is m×n, R+ is n×m. When R is square and nonsingular, its pseudoinverse is equal to its inverse. Uses Gauss-Jordan diagonalization with partial pivoting. S xMExp (S [,n] [,D]) Exponentiation of a square real matrix e Exp(S) = 1 + S + S2/2 + S3/6 + S4/24 + … + Sn/n! When n is deleted, the is continues until it converges. C xMExpC (S [,n] [,cf] [,D]) Exponentiation of a square complex matrix e Exp(S) = 1 + S + S2/2 + S3/6 + S4/24 + … + Sn/n! When n is deleted, the series is continues until it converges. n xMExpErr (S ,n [,D]) Error term in xMExp S n! Note that n is required. n xMExpErrC (C ,n [,cf] [,D]) Error term in xMExpC C n! Note that n is required.

xMMopUp (S [,errMin] [,cf] [,D]) Cleans up matrix errors close to zero Replaces matrix elements smaller than ErrMin or ε by 0. D.9.2 More sophisticated matrix operations

xMDet (S [,D]) Determinant of a square real matrix |S| Uses Gauss- Jordan diagonalization with partial pivoting. Returns "?" when S is singular. xMDet({1,2;"3.1",-4}) = -10.2 xMDet({1,2; 3.1,-4}) = -10.20000000000000017763568394

xMDetC (C [,D]) Determinant of a square complex matrix |C| xMDetC({1,2,0,-3;"3.1",-4,1,7}) = -13.2, 14.3; xMDetC({1,2,0,-3;3.1,-4,1,7}) = -13.20000000000000017763568394, 14.30000000000000026645352591

625

xMCond (R [,D]) Condition number of a real matrix κ Based on SVD. xMCond({1,2;"3.1",-4}) = 2.6191817659615200272394889923128097; xMCond({1,2;3.1,-4}) = 2.6191817659615200292582110124456817

xMCondC (C [Cformat ,D, ε, tol]) Condition number of a complex matrix κ Based on SVD. xMCondC({1,2,0,-3;"3.1",-4,1,7},,21) = 4.37608205969300766727, 4.37608205969300766727; xMCondC({1,2,0,-3; 3.1,-4,1,7},,21) = 4.37608205969300761817, 4.37608205969300761817

xMpCond (R [Cformat ,D, ε, tol]) –log10 of the condition number of a real matrix –log10 (κ ) xMpCond({1,2;"3.1",-4}) = -0.41816563863710134091248426474409013; xMpCond({1,2; 3.1,-4}) = -0.41816563863710134124721469286252258

xMpCondC (C [Cformat ,D, ε, tol]) –log10 of the condition number of a complex matrix –log10 (κ ) xMpCondC({1,2,0,-3;"3.1",-4,1,7},,2) = xMpCondC({1,2,0,-3;3.1,-4,1,7},,2) = -0.64 2 xMNormalize (R [,normtype] [,tiny] [,D]) Normalize a real matrix vi ∑vi Normtype: all nonzero vertical vectors normalized; default = 2 for Euclidean norm. 3 6.1 0.6 0.773392104960212657067  R =   , xMNormalize(R,,,21) =   4 − 5 0.8 − 0.633927954885420247631

xMNormalizeC (C [,normtype] [,Cformat] [,tiny] [,D]) Normalize a complex matrix Normtype: all nonzero vertical vectors normalized; default = 2 for Euclidean norm. 3 6.1 −7 0 0.6 0.773392105 −0.6139406135 0 C =   , xMNormalize(R,,,9) =   4 − 5 9 8 0.8 − 0.633927955 0.789352217 1 T xMT (R) Transpose a real matrix R 3 6.1  3 4  R =   , xMT(R) =   , do not specify D. 4 − 5 6.1 − 5 T xMTC (C) Transpose a complex matrix C 3 6.1 −7 0  3 4 −7 9 C =   , xMTC(C) =   , do not specify D. 4 − 5 9 8 6.1 − 5 0 8

H xMTH (C) Hermitean (conjugate, adjoint) transpose a complex matrix C 3 6.1 −7 0  3 4 7 −9 C =   , xMTH(C) =   , do not specify D. 4 − 5 9 8 6.1 − 5 0 − 8 D.9.3 Matrix decompositions

xMLU (S [,Pivot] [,D]) LU decomposition using Crout’s algorithm L U Returns the Lower and Upper triangular matrices that satisfy S = L U or, when Pivot is True, S = P L U where P is the permutation matrix. If Pivot = False, the first diagonal element of S cannot be zero. T xMCholesky (S [,D]) LL decomposition L L Cholesky decomposition of a square matrix. –1 xSysLin (A, B [,D]) Solves simultaneous real linear equations X = A B Uses the Gauss-Jordan diagonalization; A, X and B must be real; A must be m×m; X and B must both be m×1 or m×n. Solves A X = B to yield X = A–1 A X = A–1 B. –1 xSysLinC (A, B [,D]) Solves simultaneous complex linear equations X = A B Equivalent to xSysLin for complex arrays. A, X and B must be complex; A must be m×m; X and B must be m×1 or m×n. Solves A X = B to yield X = A–1 A C = A–1 B.

xGaussJordan (M, n, m, Det, Algo, D) Gauss-Jordan elimination Uses partial pivoting.

626

xSVDD (R [,D] [,ε ]) Matrix Σ from SVD of a real rectangular matrix R Σ SVD used in “compact” format; when R is m×n, and p = min(m,n), Σ is p×p. ε is the ignored rounding error; default: ε ≤ 1E–D.

xSVDDC (C [,c] [,D] [,ε ]) Matrix Σ from SVD of a complex rectangular matrix C Σ SVD used in “compact” format; when C is m×n, and p = min(m,n), Σ is p×p. Default format: c = 1 (split). ε is the ignored rounding error; default: ε ≤ 1E–D.

xSVDU (R [,D] [,ε ]) Matrix U from SVD of a real rectangular matrix R U SVD used in “compact” format; when R is m×n, and p = min(m,n), U is n×p. ε is the ignored rounding error; default: ε ≤ 1E–D.

xSVDUC (C [,c] [,D] [,ε ]) Matrix U from SVD of a complex rectangular matrix C U SVD used in “compact” format; when C is m×n, and p = min(m,n), U is n×p. Default format: c = 1 (split). ε is the ignored rounding error; default: ε ≤ 1E–D.

xSVDV (R [,D] [,ε ]) Matrix V from SVD of a real rectangular matrix R V SVD used in “compact” format; when R is m×n, and p = min(m,n), V is m×p. ε is the ignored rounding error; default: ε ≤ 1E–D.

xSVDVC (C [,c] [,D] [,ε ]) Matrix V from SVD of a complex rectangular matrix C V SVD used in “compact” format; when C is m×n, and p = min(m,n), V is m×p. Default format: c = 1 (split). ε is the ignored rounding error; default: ε ≤ 1E–D. D.10 Miscellaneous functions D.10.1 Manipulating numbers

xCStr (x [,D]) Converts a number x from double precision to string format Ignores Ddefault; when D is deleted, as many digits as needed (up to Digits_Limit) are displayed. xCStr(1) = 1; xCStr(0.1) = 0.1000000000000000055511151231257827021181583404541015625; xCStr(″1.1″) = 1.1; xCStr(1.1) = 1.100000000000000088817841970012523233890533447265625; xCStr(″4.1″) = 4.1; xCStr(4.1) = 4.0999999999999996447286321199499070644378662109375. When B2 holds the number 4.1, xCStr(B2) = xCStr(4.1), see above, but xCStr(″″&B2&″″) = 4.1, i.e., the stored, binary value of x is read unless its spreadsheet value is selected with double quotes. D can be used to limit the output: xCStr(B2,20) = xCStr(4.1,20) = 4.0999999999999996447.

xDec (a) Decimal part of number a xDec(2.99) = 0.99; xDec(–2.99) = –0.99.

xTrunc (a) Truncation xTrunc(2.99) = 2; xTrunc(–2.99) = –2; xTrunc(a) + xDec(a) = a.

xRound (a, [d] [,D]) Round Rounds a to d decimal places; default: d = 0. If least significant digit is 5, rounds it away from zero. xRound(1.5) = 2; xRound(2.5) = 3; xRound(–1.5) = –2; xRound(–2.5) = –3.

vRoundR (a [,s] [,D]) Relative round Uses unbiased (banker’s) relative rounding. Rounds the mantissa of a to s significant digits, while leaving its exponent alone. Note: the default (with s unspecified) is 15.

xRoundR (a [,s] [,D]) Relative round Uses standard rounding to round the mantissa of a to s significant digits, while leaving its exponent alone. Note: the default (with s unspecified) is 15.

xInt (a) Integer part Rounds down: xInt(2.99) = 2; xInt(–2.99) = –3. Warning: in general, for a < 0, xInt(a) + xDec(a) ≠ a.

xComp (a [,b]) Comparison of value of a with b xComp(a, b) = 1 for a > b, xComp(a, b) = 0 for a = b, xComp(a, b) = –1 for a < b. The default assumes that b = 0.

xComp1 (a) Comparison of absolute value of a with 1 xComp1(a) = 1 for a > 1, xComp1(a) = 0 for a = 1, xComp1(a) = –1 for a < 1. 627

xDgt (a) Digit count xDgt(–2.99) = 3; xDgt(–0.00299) = 6.

xDgtS (a) Significant digit count Treats all trailing zeros as not significant: xDgtS(1234000) = 4; xDgtS(1.234) = 28 (counting significant digits in corresponding string number); xDgtS(“–0.0029900”) = 3; xDgtS(–0.0029900) = 28.

xCDbl (a) Converts from extended to double precision Converts an extended precision numerical string into a double precision number. Example: xPi() = 3.1415926535897932384626433832795029; xCDbl(xPi()) = 3.1415927 with up to 15 digits depending on the cell formatting.

x2Dbl (a) Converts from extended to double precision Slower but in rare cases more precise version of xCDbl. D.10.2 Formatting instructions

xFormat (a [,Digit_Sep]) Format formats a string ′a in comma-separated groups of Digit_Sep; default: Digit_Sep = 6. For a = ′1234567.89012345, xFormat(a) = 1,234567.890123,45 and xFormat(a,3) = 1,234,567.890,123,45; when a = 1234567.89012345, a spreadsheet number, the result will reflect the stored value: xFormat(a) = 1,234,567.890,123,449,964,448,809,624.

xUnformat (a) Unformat Removes formatting commas from a

xSplit (a) Splits scientific notation over two cells Converts a number into scientific notation, spread over two adjacent cells. xSplit(a) = {1.234566999999999941758246258, 89} for a = 1.234567E+89; xSplit(a) = {1.234567, 896} for a = 1234567E890 or a = 1234567E+890; xSplit(a) = {1.234567, -884} for a = 1234567E-890.

xMantissa (a) Mantissa of a in scientific format Yields the mantissa of a numerical string a, e.g., xMantissa(a) = -123.4567 for a = ′-1.234567E-890 but -1.23456000000000004997855423 for a = –1.234567E-890.

xExponent (a) Exponent of a in scientific format Yields the exponent of a numerical string a or a number in the cell, e.g., xExponend(a) = -890 for either a = –1.234567E-890 or a = ′-1.234567E-890 because the exponent is always integer.

xCvExp (mant [,exp]) Converts scientific notation into mantissa and exponent =xCvExp(-123.456,789) yields -1.234560000000000030695446185E+791, and =xCvExp(-0.0000123456,0) generates -1.234559999999999916351148266E-5, in both cases showing decimal-to-binary conversion errors. You can avoid these by setting exp to zero: =xCvExp("-0.0000123456",0) leads to –1.23456E-5.

D.10.3 Logical functions

x_And (a,b ) Boolean logic AND AND(a,b) x_And(a,b) = True only when a ≠ 0 (or FALSE) and b ≠ 0 (or FALSE); a blank cell does not count as 0 (or FALSE).

x_Or (a,b) Boolean logic OR OR(a,b) x_Or(a,b) = True when a ≠ 0 (or FALSE)or b ≠ 0 (or FALSE)or both, a blank cell doesn’t count.

x_If (a,b) Boolean logic IF IF() x_If(a,b,c) = b when a = 1 or TRUE, x_If(a,b,c) = c when a = 0 or FALSE

x_Not (a) Boolean logic NOT NOT(a) x_Not(a) = True when a = 0 (or FALSE). Non-zero numbers and strings evaluate as True.

628

D.10.4 Polynomial functions

xPolyTerms (poly [,D]) Extract the coefficients of a polynomial When poly is, e.g., 'x^5-2.1+3*x^3+4*x^2 in cell B2, xPolyTerms(B2) = {–2.1, 0, 4, 3, 0, 1}

xPoly (a,coef [,D]) Evaluate a polynomial at x When the polynomial is defined by its coefficients coef in, e.g., B4:G4 as {–2.1, 0, 4, 3, 0, 1}, xPoly(3,B4:G4) = –374.3.

xPolyAdd(poly1,poly2 [,D]) Adds two polynomials in x The polynomials are poly1 and poly2. Block-enter their coefficients in the same order. Missing coefficients will be interpreted as zero. If enumerated in the argument, use ,, to indicate a missing coefficient.

xPolySub (poly1,poly2 [,D]) Subtracts two polynomials in x The polynomials are poly1 and poly2. Block-enter their coefficients in the same order. Missing coefficients will be interpreted as zero. If enumerated in the argument, use ,, to indicate a missing coefficient.

xPolyMult (poly1,poly2 [,D]) Multiplies two polynomials in x The polynomials are poly1 and poly2. Block-enter their coefficients in the same order. Missing coefficients will be interpreted as zero. If enumerated in the argument, use ,, to indicate a missing coefficient. Assign space in the highlighted area for the higher-order cross-terms.

xPolyDiv (a [,D]) Divides two polynomials in x The polynomials are poly1 and poly2. Block-enter their coefficients in the same order. Missing coefficients will be interpreted as zero. If enumerated in the argument, use ,, to indicate a missing coefficient.

xPolyRem (a [,D]) The remainder of polynomial division The polynomials are poly1 and poly2. Block-enter their coefficients in the same order. Missing coefficients will be interpreted as zero. If enumerated in the argument, use ,, to indicate a missing coefficient. D.10.5 Integer operations p xPowMod (a,p [,D]) Modular power a mod m p p p Returns the remainder of the integer division a , i.e., a – m (a \ m), e.g., xPowMod(10,3,7) = 6 because 103 = 1000 = 142*7 + 6 where 142*7 = 994. Useful for finding the remainders of divisions of very large integers, as in xPow(12,34567) = 1.1432260930295413791181531725537944E+37304 with more than 3700 decimals, yet xPowMod(12,34567,89) = 52. This is the remainder of dividing 1234567 by 89 despite the fact that XN-version used, XN6051–7A, cannot hold more than 630 decimals.

xDivMod (a, b, m) Modular division (a/b) mod m where a and b are integers, and m is a positive prime integer; otherwise the function returns “?”. Example: xPow(12,3939393) = 1.1127850718610753473503619921808241E+4251319, i.e., it is a number with more than 4 million digits! While XN cannot perform the regular division of such a giant number by the prime number 3001, it can find xPowMod(12,3939393,3001) = 2758. D.10.6 Getting (& setting) XN configuration information Here are a number of functions that allow you to read or “get” configuration settings, and to define or “set” them. Since each Get function has a corresponding set counterpart, only the former are listed here; these Get instructions must be followed by empty argument brackets to identify them as functions. A corresponding Set function must have a replacement value as its argument, and is meant for use within a VBA function or macro.

629

GetDigitsLimit () Specifies the current DigitsLimit For XN.xla605 the function =GetDigitsLimit() yields 630, its largest allowed D-value.

GetExcelAppVer () Specifies the current version of Excel used For Excel97: =GetExcelAppVer() yields 8, 9 for 2000, 10 for 2002, 11 for 2003, 12 for 2007, and 14 for 2010.

GetxBase () Specifies the current packet size For XN.xla605 the function =GetxBase() yields the value 7.

GetXnArgSep () Specifies the current VBA argument separator In the US, =GetXnArgSep() should yield a comma.

GetXnCaseSen () Specifies the current case sensitivity If case-insensitive (the default), =GetXnCaseSen() yields FALSE; if case-sensitive, TRUE.

GetXnConfigStatus () Specifies the current configuration settings Needs a 19 rows high, 2 columns wide array to list the names and values of all 19 configuration settings.

GetXnDecSep () Specifies the current VBA decimal separator In the US, =GetXnDecSep() should yield a period. GetXnDefaultDigits() Specifies the currently selected default D-value For the examples in this table, =GetXnDefaultDigits() should yield 35.

GetXnDefCStr () Specifies the current default value for default Dbl2Str digits =GetXnDefCStr() yields 0 for vCStr, 15 to 28 for dCStr, 29 to Digits_Limit for xCStr.

GetXnSMPAdj () Specifies the Digit Max Adjustment of the Simulated Machine Precision For 7-digit packets, the recommended value is 2 × 7 = 14 decimals.

GetXnAddAdj () Specifies the current Digit Max Adjustment for xAdd The recommended value is 0 decimals for all versions of XN.

GetXnDivAdj () Specifies the current Digit Max Adjustment for xDiv The recommended value is 0 decimals for all versions of XN.

GetXnMultAdj () Specifies the current Digit Max Adjustment for xMult The recommended value is 2 packets for all versions of XN. D.11 The Math Parser and related functions The Math Parser can evaluate many formulas f written in quasi-algebra, as a function of the specified parameter Values. It thereby brings an aspect of symbolic calculus to numerical computation. Its formulas resemble those in Excel’s VBA, as a function of the parameter Values. The Math Parser performs two functions: it first “parses” the formula, then evaluates its value. Its extended precision implementations xEval and xEvall, as implemented by John Beyers, uses the original parser developed for double precision expressions, but with XN for value evaluation. This can be especially helpful because writing complicated mathematical expressions in XN can be error-prone, a complication readily avoided by using xEval or xEvall. The Help-on-Line entry xEval (see the XN Toolbar under Help) gives many clear examples. xEvall uses a sophisticated search for the value labels which makes it about ten times slower than xEval; its use is therefore not recommended.

xEval(f, Values, [,D] [,Angle] [,Tiny] [,IntSwapFix]) Evaluates quasi-algebraic formulas

xEvall(f, Values, [,D] [,Angle] [,Tiny] [,IntSwapFix]) xEval using top labels if present xEval assigns the parameter values in the order in which they are listed under Values. D = 0 will use the faster double-precision mode; D = -1 specifies quadruple precision in the Variant Decimal mode. Leaving D unspecified will use the value of Default Digits specified in the XN Toolbar under X-Edit B Configuration.

Angle provides a choice between the default rad(ians), deg(ree), and grad(s). Tiny defines the minimum absolute value that will be considered to be different from zero; for the optional IntSwapFix see the Help-on-Line file. The formula f and its values can be fully specified in the argument, as in xEval("1/x^2+5*x*y+7*sqr(y)",{"2","3"},28) = 42.37435565298214105469212439, or the formula and/or its parameter values can be read from specified spreadsheet cells, as in =xEval("1/x^2+5*x*y+7*sqr(y)",I2:I3,28) or =xEval(I4,{"2","3"},28 or 630

=xEval(B4,B2:B3,28), which all give the same result when cell B4 contains the for- mula 1/x^2+5*x*y +7*sqr(y), and cells B2 and B3 the values 2 and 3 respectively.. For further details about the Math Parser see section 8.16 and, especially, the Help- on-Line entry on xEval. As described there, several functions can also use its quasi- algebraic code, such as the integration functions Integr(), Integr_2D, etc. Here are two extended precision functions that use the Math Parser: xGrad and xJacobi.

 ∂f / ∂x1    ∂f / ∂x2  xGrad (Values, f [,x] [,D] [,Labels]) Gradient of a multivariate function f  M    ∂f / ∂xm  Approximates the gradient of a single function f of several variables, by default called x, y, z, and t in this order, as evaluated at the parameter Values in that same order, using 5-point expressions for the . If you want to use other variable name Labels in your function, specify them as Labels and count your commas, see below. You can specify the Values and the formula for f directly into the expression, as in =xGrad({-1,2,3,7},("(x+2*y-3*z^2)/LN(t)")), or read them from the spreadsheet, as in =xGrad(B2:B5,B6), when B2:B5 contain the values –1, 2, 3, and 7 respectively, and cell B6 the formula (x+2*y-3z^2)/ln(t).

0.51389834 2369750693 0446493893 7018939    0.51389834 2369750693 0446493893 7018939 In both cases you will get    - 9.25017016 2655512474 8036890086 63409    0.90545659 2995580001 2161419931 8047098  Also in both cases, the expression must be written in Math Parser format. The Values, either enumerated or taken from B2:B5, must be in the order x,y,z,t. If you use other names, e.g., a, b, c, and d, then these must be defined in Labels as =xGrad(B2:B55,B6,,,A2:A5) where A2:A5 contains a, b, c, and d respectively.

∂f1 ∂x1 ∂f1 ∂x2 L ∂f1 ∂xm    ∂f2 ∂x1 ∂f2 ∂x2 L ∂f2 ∂xm  xJacobian (Values, f, [,x] [,D] [,Labels] [,MaxPrec]) Jacobian of f  M M O M    ∂fn ∂x1 ∂fn ∂x2 L ∂fn ∂xm  Approximates the Jacobian of a vector f of n functions f , each of m variables, by default called x, y, z, and t in this order, as evaluated at the parameter Values listed in that same order, using 5-point expressions for the derivative. If you want to use other variable name Labels in your function, specify them as Labels and keep track of the commas. As with xGrad you can specify the Values and the formula for f directly into the expression or, as is usually more convenient, read them from the spreadsheet, as in =xGrad(B2:B4,B5:B7), where B2:B5 contain the specific Values at which the function formulas (in Math Parser format) in B5:B7 must be evaluated:

∂f1 ∂x1 ∂f1 ∂x2 L ∂f1 ∂xm   f1(x1, x2,..., xm)  x1        ∂f ∂x ∂f ∂x ∂f ∂x f (x , x ,..., x ) x J =  2 1 2 2 L 2 m  for f =  2 1 2 m  and x =  2 .  M M O M   M   M        ∂fn ∂x1 ∂fn ∂x2 L ∂fn ∂xm   fn(x1, x2,..., xm) xm 

631

Subject index B Courier font identifies VBA instructons. backup files 11 Numbers refer to pages; italic numbers indicate bacterial growth 202 the starting page of section(s) primarily devoted band map 26 to that topic. Excel functions are shown in caps, bat echolocation 298 VBA. Matrix & XN functions in lower case. best fit 120 BigMatrix.xla 8, 545 A add-in macros 545 absolute addressing 2 installation 6, 8 accumulation errors 533 Manager 546 accuracy 47, 56, 342 big-O notation 412 algorithmic 47 binomial coefficient 44 vs. precision viii, 55, 213 bit 343 acid-base titrations 38, 152, 200 black body radiation 140 of acid salt 158 boiling point of water 84, 133 of diprotic base 200 buffer strength 147, 150 acknowledgements xi buffer value 150 ActiveCell 349 activity corrections 154 C additive color scheme 23 calibration curve 77 address window 1 calling a macro 396 adjustable parameters: how many? 104 cancellation errors 529 algorithmic accuracy 47, 529 caret 2 aliasing 224 case sensitivity 3 aligning a chart to the cell grid 17, 378 cell comment 3, 51, 52, 368 AllAddIns folder 5 cell drag & drop 11 Analysis Toolpak 4 cell handle 2, 14 anova 4 cement hardening 118 apodizing 232 centering 70, 90 Application. 34, 39, 50, 360 multivariate 474 aqueous solution equilibria 147 polynomial 476 argument 35 centered, weighted least squares 86, 127 arithmetic progression ix, 2, 13 central differencing 402 ARPREC 544 multipoint 404 array 5, 54, 415 of higher-order 412 vs. matrix 460 tables 403, 410, 412, 418 vs. range viii, 345 chaos 331 Arrhenius chart vs. plot viii, 13 equation 312 checking plot 87 array dimensions 343 arsenic in tuna fish 214 for data overwrite 376 ASINH 345 chemiluminescence decay 160 assignment symbol 337 chevron 4 assume non-negative in Solver 140 chi-square distribution 73 asterisk 2 chlorophyll spectrum 1675 asymptotic expansion 45 circular reference 51 ATAN vs. atn 49 van Cittert deconvolution 281 auditing tools 51, 528 Clausius-Clapeyron equation 84 467 close button 1 autocatalytic reactions 323 CM (covariance matrix) 68, 77, 104 automatic scaling in Solver 140 COBE (COsmic Background Explorer) 140 average of repeat data 14, 56 code debugging 390 637

Cole plot 189 collinearity 84 D ColorIndex 358 Data Analysis Toolpak 4 coloring 358 data array 43 color maps 22 data compression color palette 358 by FT 244 ColumnSolver 186 of fluorescence spectra 246 comma-delimited 33 data input 348 comments through N function 3 with input boxes 352 comparison operators 549 data compatibility issues of Excel 2007 547 output 353 Compatibility Pack for Office XP/Office 2003 13 overwrite, check for 376 compiled code 398 reduction 55 complex matrix operators sampler 4 in double precision 455, 489, 495, 506, 587 transformation 126 in extended numberlength 456, 621 types 344 complex numbers 42, 453 validation 51 compression of data by FT 244 Davies equation 155 conditional statements 346 debugging condition number 498, 626 commands 390 Confidence 57, 73 tools 391 confidence interval 57 toolbar 392 confidence limit 57 Debug.Print 337, 391 Const statement 345 Debye- Hückel formula 155 constrained nonlinear least squares 169 Decimal (quadruple precision) mode 544 continuously stirred reactor 323 XN.xla quadruple precision functions 545 contour map 24 decomposition vs. control loops 348 deconvolution 266 control variable 57 deconstruction an address 361 convolution 259 deconvolution 259 by FT 259 by FT 273 defined mathematically 262 by parameterization 291 of a simulated fluorescence decay 265 Grinvald-Steinberg 289 of Gaussian peaks 266, 271, 291 symbol ∅ ix symbol ⊗ ix vs. decomposition 266 theorem in FT 270 van Cittert 281 convoluting integers 122 with Solver 289 Convolve macro 262 dedication vi ConvolveFT 271 Def statements 345 copying 2 default 1 files and graphs 32 default settings 10 to the Clipboard 7 define chart format 11 copyright credits xii define name dialog box 3 correlation between what and what? 71 Deleted Esophageal Cancer 33 correlation coefficients 70, 90 dependent variable 57 cosmic microwave background 140 Deriv1 421 covariance 68 differentiation covariance matrix 68, 77, 104 by differencing 401 cowboy hat 21 by FT 237 CP29 spectrum 168 by polynomial fitting 123 cubic spline 444, 469 of experimental data 425 CurrentRegion 351 dimensioning 335, 343 custom function or subroutine 35, 308, 335 Do … Loop 46, 347 638 double precision exponentiation vs. negation 49 Matrix.la add-in matrix functions 582 extended numberlength 544, 545, 547, 615 XN.xla(m) add-in functions & macros 538 extrapolation 75, 180 drag & drop 11 extreme parameter values 315 driver macro 374 dynamic named range 3 F factorials 10, 36, 45 E false minima 181 echolocation pulse 298 figurate numbers 481 economic optimization routines 607 Filip.dat 480, 505, 578 edit in cell 11 fill a row or column 2 editing tools in VBA 386 filtering 230, 259 eigenvalue decomposition 495 in FT 230 eigenvalue & eigenvector operations 603 time-dependent 259 electrical circuit analysis routine 607 FINV 73, 106 ELS 123 Fisher function 73, 106 embedding in Word 32 fitting data engineering functions 587 piecewise 177 entering data 33 through fixed points 169 enzyme kinetics 130, 178 lines through a common point 169 equation parser 365 to a discontinuous curve 175 equidistant data, least squares of 122 to a Lorentzian 132, 179 equivalence volume 159 to a multicomponent spectrum 103, 165 ERF 536 to a multivariate function 99 ERFC 45 to an exponential decay 128 error 55 to a parabola 94 error bars 15 to a polynomial 93, 104 error function 536 to a proportionality 57 error function complement (erfc) 45 to a straight line 64 error messages 35, 588 to interrelated sets of curves 173 error propagation 66 to intersecting straight lines 81 error recovery 389 to intersecting parabolas 97 error surface vii, 84, 183 to multiple peaks 162 error trapping 388 to multiple curves 173 ethanol analysis to parallel lines 169 by gas chromatography 110 fluorescence decay 263, 289 by Raman spectrometry 113 For Each … Next 339, 348 Euler-Maclaurin error estimates 427, 431, 435 formatting functions 628 Euler’s integration method formula toolbar 1 explicit 301 formula window 1 implicit 307 For … Next 38, 340, 348 semi-implicit 306 ForwardFT 218 Euler’s rule 217 forward slash 2 even function 218 Fourier transformation 217, 371 Excel 2007 conventions used 256 inserting a toolbar 12 discrete FT 255 transitioning to 12 2-D FFT 354 Excel vs. VBA 49 Frobenius norm 491 explicit (Option Explicit) 46, 335 FT (de)convolution 269, 273 explicit Euler integration 301 F-test 4, 106 exponential decay 128 function evaluation in XN 630 exponential error function complement 45 function key 2 exponentiation 2 functions viii, 2, 35, 37, 482, 528, 547, 599, 611

639

Heisenberg uncertainty 224, 273 G help files 5 Gabor macro 296 Hermitean matrix 491, 599, 626 Gabor transformation 295 hidden links 51 Galton 61 Hilbert matrix 515, 598 gas-chromatographic ethanol analysis 110 hotkey x, 1 Gauss elimination 466 hydrochloric acid infrared spectrum 100 Gaussian distribution 55, 73, 103 Gaussian noise 14 I Gaussian peaks ideal gas law 75 convolution of 291 IEEE-754 protocol 6, 416, 543 vs. Lorentzian peaks 181 If and Iff 49, 346 Gauss-Jordan elimination 467, 607 Iff 49, 346 general least squares fit If … Then 346 for a complex quantity 189 If statements and Solver 291 to a straight line 186 ill-conditioned matrix 489 General Public License 6 Immediate Window 337, 391, 420 generator tool 608 Impedance plot 189 Gibbs phenomenon 286 implicit Euler integration 307 global minimum 181 importing data 33, 51 global weights 126, 189 and their possible corruption 33 tables of global weights 128 through Notepad 33, 34 glow-in-the-dark toys 160 IMEP (Iinternational Measurement GNU General Public License 6 Evaluation Programme) 211 Goal Seek 213 importing graphs into Word 33 good graphing practices 18 imprecision good spreadsheet practices 50, 525 band 71 GoTo 348 contours 71, 109 GradeBySf macro 119 in linear extrapolation 75 gradient of multivariate function 631 measures 58 Gram polynomials 107, 111, 122 of the imprecision 73 Gram-Schmidt orthogonalization 108 independent variable 57 Gran plot 40 infrared spectrum of H 35Cl 100 graph initializing 39, 46 guidelines for good graphs 18 in-phase component 218 inserts 18 input box 352 specifications 378 type designations 352 2-D 13 inserting 3-D 19 a cell comment 3 gridline control 11 a macro in the Tools menu 9 Grinvald-Steinberg deconvolution 289 a chart 12 guidelines for good graphs 18 a VBA module 7 a toolbar 7, 12, 381 H a toolbar in Excel2007 12 Hadamard transform 256 an additional Worksheet 26 Hamming window 231 columns and/or rows 15 handle 2, 26 inserts in graphs 17 Hanes plot 130, 178 installation requirements 5, 590 von Hann window 231 integer operations 629 harmonic oscillator 95 integration Hartley transform 257 and chaos 331 35 H Cl infrared analysis 100 explicit Euler method 301 heat evolution in cement hardening 118 of ordinary differential equations 301

640

semi-implicit Euler method 306 least squares implicit Euler method 307 by singular value decomposition 501, 567 multivariable 438 for equidistant data 122 of experimental data 439 general 186, 189 Romberg midpoint 434 linear 55, 93 Romberg trapezoidal 431 multivariate 99 Romberg-Kahan 437 nonlinear 139 Runge-Kutta method 316, 320 traditional formalism 471 stability 328 weighted 126 trapezoidal 426 Lennard-Jones curve 145 intersection Levenberg-Marquardt optimization 6, 205 of straight lines 81 linear correlation 88 of parabolas 97 linear correlation coefficients 60, 70, 137 intercept 65 linear extrapolation 75, 180 interdependent variables 67 linear least squares 55, 93 interpolation 41, 440 matrix formalism 471 cubic spline 444, 469 routines 55, 93, 607, 617 by continued fractions 448 linear system solvers 604 by Fourier transformation 242 line chart vs. XY plot 19 in contour maps 24 line continuation 310 inverse 185 LinEst 34, 49, 59 Lagrange 37, 443 Lineweaver-Burk plot 130, 178 of noisy data 450 linking & embedding 32 polynomial 37 linking symbol ∪ ix intersection ln vs. log 49 of two parabolas 97 Locals Window 393 of two straight lines 81 LogEst 129 invasive sampling 363 log vs. ln 49 InverseFT 218 logical operators 628 inverse hyperbolic sine 534 Lorentzian peak fitting 132, 179 inverse interpolation 77, 185 Lotka oscillator 323, 326, 327 iodine LRE 400 vapor-phase spectrum 95 LS 37, 63. potential energy vs. distance profile 143 LSPoly 107 ionic equilibrium 147 luminescence decay 160 irreversible changes 33, 526 lutein spectrum 167 isokinetic relationship 88 Isol.xls 24 M downloading 6 macro 36, 335 iteration results shown in Solver 140 vs. subroutine viii, 36 iterative deconvolution MacroBundle 5, 591 with the van Cittert method 281 installation 5 with Solver 289 MacroMorsels 337, 594 IUPAC pH recommendation 156 installation 6, 7 Macro Recorder 387 J add-in for Excel 10 Jacobian 631 Mapper 22 modifying the BitMap 382 L maps Lagrange interpolation 37 band 26, 384 Landolt clock reaction 323 color 22 lateral differencing 410 contour 24 leakage 227 Match 39 641

Mathematica link for Excel 10 microwave background radiation 140 MathParser 6, 365, 630 minimize button 1 matrix minimum path routines 607 addition 461 mismatches between Excel and augmented 467 VBA 49 complex 482, 604 mixture analysis 103 decomposition 495, 498, 601, 626 module 7, 25, 35, 335, 403 diagonal 464 Morse curve 144 custom functions 511 movies 30 eigenvalues 489 moving polynomial fit 122 eigenvectors 489 MPFUN 544 elimination 466 multi-component analysis 103, 165 factorization 495, 498, 601, 626 multiplication 2 functions 624 multivariate generators 608 centering 474 Hermitean 491, 599, 626 data fitting 99 Hilbert 515 linear least squares 99 inversion 462, 485 macros tool 609 N multiplication 462 NAG Statistical Add-Ins for Excel 10 nomenclature 599 Numerical Algorithm Group 10 operations NAG 10 in Excel 43, 459, 588 name box 2 in Matrix.xla 657 name manager dialog box 3 in extended numberlength 545, 635 named cells and ranges 2, 51 partitioning 506 negation vs. exponentiation 49 rank 498 new name box 3 subtraction 461 Newton-Raphson method 213 symmetrical 470 N-function 3 Tartaglia 514 NIST Statistical Reference testing 514 Datasets (StRD) 47, 203, 480, 579 Toeplitz 470 nonlinear least squares 139 transposition 461 with constraints 169 triangular 465 non-negative, in Solver 140 tridiagonal 470 NormDist 103 unit(ary) 463 Notepad 33, 245 Vandermonde 517 numerical constants 611 matrix selector tool 608 numerical differentiation vii, 401, 425 Matrix.xla 6 numerical integration installation 8 of data 439 list of functions 483 of functions 515 maximize button 1 of ordinary differential equations 301 mean Nyquist theorem 225 of repeat measurements 56 medicinal solutions: shelf life 311 O menu bar 1 Object Browser 5, 387 mercury in tuna fish 211 Object Model 5 Mersenne twister 49 odd function 218 message box 353 office button 1 buttons 353 Offset 338 text formatting characters 353 operators Mexican hat 21 comparison 627 Microsoft KnowledgeBase 49 eigenvalue & eigenvector 489

642 operators (cont’d) precision 48 for complex numbers 453, 587 of the standard deviation 73 for complex matrices 604, 621 vs. accuracy viii, 55, 213 logical 628 PrintScreen 33 matrix 459, 588, 599, 624 priority of exponentiation vs. negation 49 string 585 Private Function 34 trigonometric 587, 614 progress curve 152 Optimiz.xla 6, 205, 583 of a diprotic base with a strong monoprotic installation 6, 8, 206 acid 200 optimization of an acid salt with a strong monoprotic base economic 607 158 Levenberg-Marquardt 205, 583 of a triprotic acid with a strong monoprotic simplex 607 base 153 Option Base 344 Propagation 66, 70 Option Explicit 46, 335 propagation of imprecision 66, 67, 70, 369 Ortho 107 proportionality 57 orthogonal polynomials 107 proton excess 16, 40 oscillator, Lotka 323, 326, 327 proton function 147 oscillatory data fits 136 for monoprotic acid 147 out-of-phase component 218 for diprotic acid 148 overdetermined system of equations 471 for triprotic acid 148 overwriting data, check for 376 for strong monoprotic base 147 P pseudo-inverse of a matrix 473, 502, 625 parabola, fitting data to a 94 Q parameter vs. variable viii quadratic formula 531 parameterizing a spectrum 165 quadrature component 218 parameterizing deconvolution 291 quadruple precision 621 parsimony principle 114, 225 Quick Access Toolbar 3, 11 Pascal (= Tartaglia) matrix 514 Quick Watch Window 393 Pascal triangle 481 pdf (portable document format) 32 R pE 399 R, links to 9 pE vs. pδ plots for central differencing 419 Raman spectrometry of ethanol 113 penny weight 136 random number generator 4, 14, 41 Personal Macro Workbook 7 Random_Plot.xls 6, 21, 28 Personal.xls 7 downloading 6 pH calculation 148 rand vs. rnd 49 phantom relations 87 range 3, 14, 345 phase diagram of Lotka oscillator 326 name 2 phosphorescence decay 160 vs. array viii, 345 pit map 84, 183 RC filter 259 pixellation 26, 33 Rcmdr 10 Planck equation 140 reaction rate plot vs. chart viii, 13 isothermal analysis 191 polynomial centering 476 nonisothermal analysis 311 polynomial fitting 93 simulation 190, 301 polynomial functions 629 reconstructing equations 364 potential-distance profile 143 recording a macro 387 potentiometric titration 39, 158, 200 recursive function 36 power spectrum 233 redimensioning 43, 344 precedence of negation vs. exponentiation 49 ReDim Preserve 344 preface vii regression fallacy 62

643

Regression macro 34, 60 shelf life of medicinal solutions 311 relative addressing 2 shortcut key-codes 396, 589 relative standard deviation 73 show iteration results in Solver 139 repeat measurements 56 sign vs. sgn 49 reproducibility 57 signal-to-noise ratio 234 residual 56 simplex optimization 607 Resize 346 Simpson’s formula 431 resolution vs. deconvolution 266 simultaneous equations, solving 464 resolving multiple peaks 162 singular matrix 464 response variable 57 singular value decomposition 498, 601, 627 reversed axis 14 and linear least squares 501 RExcel add-in 10 slope 65 RGB color scheme 23, 359 smoothing Ribbons 1 of data 450 ribbon tabs 1 of a line or curve in a graph 14 riboflavin decomposition 311 Solver 4, 48, 139 rnd vs. rand 49 assume non-negative 140 Romberg-Kahan integration 437 automatic scaling 139 Romberg macro 432 calling as a subroutine 4 Romberg midpoint integration 434 for parameterizing spectra 165 Romberg trapezoidal integration 431 for iterative deconvolution 289 Rosenbrock function 21, 27 how good is it? 203 rotating a 3-D graph 19 installation 4 round in Excel vs. VBA 49 show iteration results 140 rounding 450 vs. Levenberg-Marquardt 6, 201 Runge-Kutta integration 316, 320, 331, 333 Solver.xla installation 4 run-time errors 341 SolverAid 139 Solver 4 S Solver add-in 4 SampleData installation 6 SolverScan 4, 183 SampleFunctionsAndMacros Solver.xla 4 installation 6, 7 sonogram 296 sample mean 56 spectator ions 147 sampling spectral mixture analysis 929 in FT 224 spectrum invasive 363 of hydrochloric acid 100 sampling theorem 225 of iodine 95 ScanF macro 183 of mixtures 103 scatter plot 11 split window panes 51 Schroedinger equation 490 spreadsheet ScreenUpdating 357 auditing 528 scroll bar 1 button 396 Search 8 organization 527 search grid 183 sqr vs. sqrt 49 second(ary) axis 14, 16 SSR, sum of squares of the residuals 60, 65 Select Case 347 stable solution 307, 328 Selection 336, 345, 349 standard addition 79 Selector tool 608 standard deviation semi-implicit Euler integration 306,331 and cancellation errors 530 septin protein 33 criteria based on it 105 sgn vs. sign 49 of a repeat measurement 56 shading in 3-D graphs 20 of the over-all fit 58 sheet tabs 1 precision (of the st. dev.) 73

644 standard toolbar 1 stochastic phenomena 55 start button 1 string operator 585 statistical distributions 73, 619 Student t 73, 105, 355 statistical functions 615, 618 subroutine 34, 335 statistical significance 74, 105 vs. function viii, 35 status toolbar 1 vs. macro viii, 36 StatusBar 357 subtractive color scheme 23 stenosis 231 SumXMY2 3, 125 step-by-step Gauss-Jordan demonstration 607 suppressing screen updating 356 stiff system of differential equations 333 surface maps 22 SVD 498, 501, 601,627 in extended numberlength 614 symbolic mathematics 10 trouble-shooting in VBA 353 truncation errors 402, 450 T truncating 450 tab-delimited 33 tryptophan fluorescence spectrum 245 Tartaglia matrix 514 t-test 4, 73, 105, 355 task bar 1 Tukey window 232 Taylor series expansion 402 tuned FT filtering 231 text box 3, 15 two-dimensional graphs 13 text formatting characters 354 Type of input box data 352 Text Import Wizard 33 three-dimensional graphs 19 U tidal analysis 246 uncertainty principle in finite FT 229 time-dependent filtering 259 unfiltering 266 time-frequency analysis use automatic scaling in Solver 139 timing of procedures 356 UserForms 7 TInv 73, 355 US penny weight 136 Tiny 483 title bar 1 V titration curve 152 van Cittert deconvolution 281 activity-corrected 154 VanderMonde matrix 517 of a diprotic base with a strong monoprotic van de Waals equation 25 acid 200 vapor-phase spectrum of an acid salt with a strong monoprotic base of hydrochloric acid 100 158 of iodine 95 of a triprotic acid with a strong monoprotic vapor pressure of water 133 base 153 variable star 201 Toeplitz matrix 470 variable vs. parameter viii toolbars 1, 11, 381 variance customizing 11 of repeat measurements 56 debugging 392 of fitting data to a line 65 in Excel 2007 12 variance-covariance matrix 87 inserting 381 Variant data type 43, inserting in mt,Xm , 12 VBA 4, 9, 22, 31, 34, 42, 49, 53, 335 Quick Access toolbar 12 editing tools 386 ToolPak 4 help file 5 transfer function 261, 270 vs. Excel 49 transforming variables 109, 126 vector functions 601 transitioning to Excel 2007 12 vibrational spectroscopy 95 Trapez macros 428 viscosity data 199 Trendline 64 vitamin B2 decomposition 311 trigonometric & related operations 587 Volatile 5 645

W Watch Window 393 water boiling point 84, 133 vapor pressure 133 website of John & Steve Beyers: http : // www.

thetropicalevents. com/ Xnumbers60. htm website of Leonardo Volpi: digilander.

libero.it/foxes /SoftwareDownloads .htm website of this book: www.bowdoin. edu / ~rdelevie/excellaneous weighted least squares 126 limitations 179 weight/height ratio 177 weights of US pennies 136 Wiener filter 234 with FT deconvolution 277 window functions 231 WLS 127 WorksheetFunction. 39, 360 X xanthophyll spectrum 167 XN.xla(m) vii, ix, 547, 611 configuration 629 direct use on spreadsheet 554 extended-precision functions 547 table 549 installation 6, 8 rules 581 table of XN functions 549, 611 use in custom routines 563 XN toolbar 9 xnLS 567 Tested against NIST StRD 579 Xnumbers.dll vii, ix, 9 xpE function 580 XY plot 11, 14, 18 Z zero filling in FT 242

638