Syntax Supported Only by the IML Procedure
XMULT Function
XMULT (matrix1, matrix2) ;
This function is supported only by the IML procedure.
The XMULT function computes a matrix product by using extended-precision calculations. For most matrices, the XMULT function is numerically equivalent to the matrix multiplication operator (*). You should use the XMULT function on pathological examples for which extended-precision calculations are required to obtain an accurate product.
The following program demonstrates the use of the XMULT function:
a = 1e13;
b = 1e13;
c = 100*a;
a = a+1;
x = c || a || b || c;
y = c || a || (-b) || (-c);
z = xmult(x,y`); /* correct answer */
print z [format=16.0];
wrong = x * y`; /* loss of precision */
print wrong [format=16.0];
Figure 113: Extended-Precision Multiplication
| z |
|---|
| 20000000000001 |
| wrong |
|---|
| 0 |
Last updated: September 01, 2026