Numerical Recipes - Is this stuff legal?

I don’t think you can patent an algorithm. Just copywrite actual code.

Also, FWIW, from the 3rd edition:

So I don’t think its true you can’t copy the code into your computer for personnel use.