Skip to content

Numerical Recipes Benchmarks

This post considers the question of whether it is possible to obtain C code for the tasks exemplified in the well-known Numerical Recipes in C series so it can be used in a public benchmark repository that be used under a sensible license. Although the Numerical Recipes series is very well-known, its licensing restrictions mean that the GNU Scientific Library (GSL) seems to be a more likely source of such benchmarks. This short post briefly considers the Numerical Recipes, Netlib and GSL resources.

The Numerical Recipes series is published by Numerical Recipes Software ( The latest version of book (Numerical Recipes: The Art of Scientific Computing, Third Edition, 2007) actually gives the code in C++ not in C. This source code can be accessed (for personal use) following purchase of the book or it can be purchased separately for electronic download or on CD-ROM. However licensing restrictions apply and the code cannot be freely distributed.

An old version of the book (Numerical Recipes in C: The Art of Scientific Computing, Second Edition,1992) is freely available for viewing online ( and the legacy C code is bundled with the latest code. Nevertheless licensing restrictions apply and the code cannot be freely distributed.

However a small number of utility files (nrutil.c, nrutil.h, complex.c, complex.h) and wavelet routines (wt1.c, daub4.c, pwt.c, pwtset.c, wtn.c) written in C have been put in the public domain by Numerical Recipes Software ( The code for these is freely available and can be freely distributed.

Some people have argued in various online discussions that the Numerical Recipes code is not all that good compared to some of its competitors, and that the status of the copyright is debatable (as it has been argued that many of the functions seem to be ported directly from earlier Fortran code). Many with this view advocate the use of a free online resource called NetLib ( Most  NetLib code seems to be in Fortran, but a number of C routines are also available ( According to the FAQ “most NetLib software packages have no restrictions on their use” but they “recommend you check with the authors to be sure”.

Another excellent online resource is  the GNU Scientific Library or GSL ( It contains a wealth of scientific software and is written mostly in ANSI-89 C. It is free software under the GNU General Public License (GPL). GSL is well structured, well documented, well supported, and seems to be the most likely source of benchmarks from the options considered above.

No comments yet

Leave a Reply

You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS

Couldn't connect to server: Connection timed out (110)