[R] Alternative to Numerical Recipes

John Aitchison jaitchis at lisp.com.au
Tue Nov 14 03:12:24 CET 2000

On 13 Nov 00, at 7:20, Prof Brian D Ripley wrote:

> On Mon, 13 Nov 2000, Kim Horn wrote:
> > We have had problems with licensing with Numerical Recipes.
> > We wanted to use the code in our product but never got a
> > reply from them about licensing. So we built our own.
> > It is a pity that such a resource cannot be used :-)
> > 
> > The original algorithms are mostly published in Appl. Statistics
> > journal. You can down load the Fortran code from StatLib web
> > site and then use F2C to translate to C code.
> R uses some Appl Statistics algorithms.  They too have conditions, and we
> obtained permission to include code (even translated code) in R. >From the
> Statlib site:
>    The Royal Statistical Society holds the copyright to these routines,
>    but has given its permission for their distribution provided that no
>    fee is charged. 
> R itself is a source of routines for this sort of thing, we
> believe with documented sources, and of course with strong
> usage conditions (GPL).
Surely the *algorithms*  themselves are not subject to copyright?  for 
instance if I look up Abramowitz and Stegun and find some suggestion for 
estimating the approximation and then code it myself .. no problem. If I 
look at the original ACM paper for some algorithm and code it myself.. no 
problem. If I look at the APSTAT code to implement some algorithm then 
code it myself  'as inspired by AS241' .. presumably, no problem. If I 
directly translate (using a conversion program) that code to another 
language then perhaps there is a grey area, but then often that translated 
code will need significant modification, so maybe again there is no 

It is interesting that no copyright notice appears in the AS code itself : 
I have in front of me AS241  (function PPND7) , just a reference to the

It may be that 
>    The Royal Statistical Society holds the copyright to these routines,
>    but has given its permission for their distribution provided that no
>    fee is charged. 
is intended to apply to the DISTRIBUTION of the raw SOURCE (eg on a CD 
shovelware compilation) and that incorporation into a larger work in 
compiled form would not be an issue of concern to the RSS. 

It seems to me that,at least in practice, widely and freely disseminated 
implementations of algorithms are pretty much inevitably public domain or 
at least that the provenance is so complex that untangling it isn't worth 
the candle. 

I quote from the Cephes readme  

"   Some software in this archive may be from the book _Methods and
Programs for Mathematical Functions_ (Prentice-Hall or Simon & Schuster
International, 1989) or from the Cephes Mathematical Library, a
commercial product. In either event, it is copyrighted by the author.
What you see here may be used freely but it comes with no support or


   Stephen L. Moshier
   moshier at na-net.ornl.gov
most of the source contains comments like 
/* Cephes Math Library Release 2.8:  June, 2000
Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshier

but it is clear that a) (at least some of)  the copyright is unclear b) 
the putative copyright owner gives you permission to 'use freely'.  

I have not looked in depth at GPL'd mathematical/statistical code eg in 
GSL, but it seems probable that much of this is a 'port' of earlier work 
rather than 'completely original' code, thus calling into question the 
validity of the GPL if there exists copyright over the earlier work.

imho, these issues of licensing of fundamental algorithms and the 
expression/implementation of those, should NOT arise and need not arise.

It seems very arguable that the authors of various AS algorithms intended 
to place those algorithms and the expressions thereof in the public 
domain. I think it likely that Press et al ('Numerical Recipes') had the 
same intent .. here is the cookbook (based on other people's work : the 
shoulders of giants, if you will), use it at your own risk .. ok. 

Most implementations of algorithms are in the context of a larger work : 
imo, licensing is irrelevant, 'copyright' also (not so if you attempt to 
make money with a thin wrapper around an extant body of work).


As an aside, it seems that the default 'reply to' address for this list is 
set to the sender, rather than the list .(I am using Pegasus, not that it 
should matter). Is there a reason for this? (probably in the FAQ somewhere 

John Aitchison
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list