HELP Sep. 15, 1984 F77/NAG_LIB NAG Library of Mathematical and Statistical Procedures The NAG library, which includes about 500 Fortran callable sub- routines, 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, how to access it. Your administrator can also tell you where the documentation (6 volumes) is kept. The rest of this write-up discusses assumes you have the double precision version. 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 li- braries. 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 documenta- tion 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: 1. Using single precision when double precision is required. 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. 3. Omitting arguments. NAG routines often have many arguments that are required even if you don't use the result. 4. Not dimensioning arguments. Especially make sure work areas are appropriately dimensioned. 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 de- clared in the calling program, and 'n' is it's order. 'ia' and 'n' are often different and must be specified correctly.