Introduction to the Software Library

The NM_LIB software library is a collection of mathematical routines written in the C, FORTRAN and Pascal programming language. They include routines to perform the basic numerical operations of equation solving, function minimization and function integration. For each class of numerical operation, the routines in the library have been chosen with the emphasis on versatility and robustness. Well ... actually, the selection represents some of our computational interests over the past 15 years The routines have similar capabilities to some of the routines available in the NAG and IMSL libraries and, because they are supplied as source code, you can use them wherever you have access to a suitable compiler.

This particular collection is a revamp of our CMATH library of C routines that we built way back in pre-World-Wide-Web days. We continue find the routines useful and so have updated the documentation to provide a more convenient mode of access our wider collection of FORTRAN and Pascal routines. Most of these pieces of code started life in the days when, if we wanted a particular function, we would have to read the journal article, type in the source code and debug it ourselves. With so much effort invested in the source code, it is really hard to just throw it away...

This manual is a reference manual only. It tells you how to interface your program to the routines but does not describe the fine details of the algorithms used. If you would like general advice on numerical methods or information on the specific algorithms used in the library then the following references are a good starting point.

We also assume that you are a reasonably proficient programmer.

Access to the Library Routines and Documentation

If you already know the routine name, look up the function index. It shows where to find the CMATH routines in the distribution. A number of the functions mentioned in the table are not documented in this reference section. They are service routines and are not intended to be called directly by the your program. If you want to find a suitable routine for a particular problem, look up the main contents page.

Note that nearly all of the routines need the header file "cmath.h" to compile correctly and that some CMATH routines use other CMATH routines.

The documentation for each routine (except for the COMPLEX number routines) has the following format.

  1. The purpose of the routine or function. This is usually a single mathematical operation: e.g. the integration of a user supplied function.
  2. How to use the routine. This section includes a description of the function parameters. The "old-style" function declarations are used in this manual but, for ANSII standard compilers, full function prototypes are available. We recommend their use.
  3. A brief description of the method employed within the routine.
  4. A reference to the literature on the algorithm used.
  5. A sample program that uses the routine. The sample "driver" usually performs a small test and then prints out the computed result together with the expected result. These programs are supplied so that the user may test the CMATH functions when installing the library on a new machine. They also provide a basic "shell" when applying the CMATH routine to a new problem.
  6. Program Results. A record of the output produced by the sample program in the Turbo-C environment. Note that this may vary slightly for other compilers.


NM_LIB (C) P. A. Jacobs
Last Updated: 1-Mar-1998