ACCU Home page ACCU Conference Page
Search Contact us ACCU at Flickr ACCU at GitHib ACCU at Google+ ACCU at Facebook ACCU at Linked-in ACCU at Twitter Skip Navigation

Search in Book Reviews

The ACCU passes on review copies of computer books to its members for them to review. The result is a large, high quality collection of book reviews by programmers, for programmers. Currently there are 1918 reviews in the database and more every month.
Search is a simple string search in either book title or book author. The full text search is a search of the text of the review.
    View all alphabetically
Numerical Recipes Third Edition: The Art of Scientific Programming
William H. Press, Saul A. Teukolsky, William T. Vetterling and B
Cambridge University Press (2007)
Paul Floyd
Appeared in:

Reviewed: May 2014

This is a book that I ought to have read decades ago. The thing that put me off was the very negative comments on usenet and mailing lists about the quality of the C++ example code. More on that in a bit. Perhaps stung by these remarks, there is a put-down of the weak attempts at numerical analysis often found in computer science texts.

I’ve worked in or around numerical analysis for most of my career, so about 1/3 of the material in this book was reasonably familiar to me.

The positive points are that the book offers a lot of example code and is quite compendious, so if you just want to jump in and get something working, it’s a great resource. Beware though that just buying the book doesn’t get you access to the code (unless you’re prepared to type it yourself). I bought book + CD, otherwise you have to pay extra to access the source. If you want to redistribute anything compiled with Numerical Recipes source, that is also licensed. The licensing is fairly draconian, and also something of a bone of contention, being used as another reason to avoid the book.

I have seen some of the code from the 2nd edition, and the 3rd edition is considerably better. It’s still not great, certainly not production quality code. Gone are the 1-based Fortran arrays. It is a great shame that the code integrates poorly with standard library containers – they have their own Vector and Matrix template classes which have interfaces that are incompatible with the standard library algorithms. Some of the code is just ugly. I’ll just give two examples. The Base_interp class contains two pointers to Doub which need to point to arrays with lifetimes at least as long as the Base_interp instance. For reasons that escape me, the constructor takes a pointer and reference to Vector array. One of the member pointers is initialised with the constructor formal argument, the other member pointer with &x[0]. Secondly, the Hash class has a ‘special tweak’ in order to be able to handle C-strings. This is to ‘special case’ elements of size 1 and to treat them as C-strings. I reckon that this could be done cleanly with the right template specialization. It would be interesting to compare the performance with some std::unsorted_map implementations.

Despite these critical remarks, the breadth of the coverage is a great strength, and for this I give quite a high rating.