.TI F77/NAG_LIB "Sep. 4, 1985"
NAG Library of Mathematical and Statistical Procedures

The NAG library, which includes about 500 Fortran callable subroutines,
is available for VAX UNIX.  There are both single and double precision
versions; check with your system administrator to see if your system
has the NAG library, and how to access it.  Your administrator can also
tell you where the documentation (6 volumes) is kept.  The rest of
this write-up assumes you have the double precision version,
accessed as '-lnagd'.

While NAG includes mainly mathematical and statistical routines,
the library also includes sorting routines in chapter M01 and
machine and mathematical constant routines in chapter X.
To use the double precision version, specify '-lnagd' to f77:

	f77 prog.f -lnagd

If the NAG library does not include a subroutine for what you are
doing, see "help f77 libraries" for information on other libraries.

The NAG manual is written to be applicable to both single and double
precision versions of the library.  Generally you will have to supply
double precision arguments.  Where the documentation indicates "real"
in italics, use 'double precision' on VAX UNIX.  If you have written
your program in single precision, see "help f77 to_double" to see what
changes are needed to use double precision.

There are five common errors in using NAG routines:

.IP "1."
Using single precision when double precision is required.

.IP "2."
Not checking the error flag.  Most routines have an error flag that
NAG sets to an error value when something goes wrong; it is your
responsibility to check it.

.IP "3."
Omitting arguments.  NAG routines often have many
arguments that are required even if you don't use the result.

.IP "4."
Not dimensioning arguments.  Especially make sure work areas are
appropriately dimensioned.

.IP "5."
Supplying incorrect 'row dimension' of matrices.  Many NAG routines
have a calling sequence of the form:

	      call sub( a, ia, n, ... )

where 'a' is a matrix, 'ia' is it's first dimension as declared in
the calling program, and 'n' is it's order.
\&'ia' and 'n' are often different and must be specified correctly.
