## Numerical Recipes

Up to version 2.16.1 (released 2013), IRAF contains a number of routines adopted from the book “Numerical Recipes in Fortran”. The FAQ of the NR book about licensing says:

- […] Can you include Numerical Recipes routines as part of that source code, including a notice that they are only allowed to be used with your application?

- Sorry, no. We never give permission for Numerical Recipes source code to be posted on any public server, or distributed with any freeware or shareware package […]
- You want to translate some (or all) the Numerical Recipes routines to a different computer language, and then redistribute the resulting translations.

- […] However, you can’t redistribute the translations in any manner, since they are “derivative works” and still subject to our copyright.

It seems that IRAF was allowed to “use” this code as long as the following lines are included:

```
# Based on Numerical Recipes by Press, Flannery, Teukolsky, and Vetterling.
# Used by permission of the authors.
# Copyright(c) 1986 Numerical Recipes Software.
```

This looks however questionable here: First it says “used” and not “distribute” or “modify”, which makes these files unsuitable for an Open Source project. It is also impossible to link these files with GPL code (like `math/slalib/`

) and redistribute the binaries, as it is done in the binary distributions of IRAF 2.16.1.

The following files are affected:

`pkg/xtools/numrecipes.x`

*(Currently unused)*`GAMMLN`

: natural log of gamma function`POIDEV`

: Poisson deviates for a given mean`GASDEV`

: normally distributed deviate of zero mean and unit var`TWOFFT`

: complex FFTs of two input real arrays`REALFT`

: FFT of a set of 2N real valued data points`FOUR1`

: forward or inverse FFT of the input array`LUDCMP`

: LU decomposition of a square matrix`LUBKSB`

: backsubstitution to solve a system

`noao/onedspec/splot/spdeblend.x`

`GASDEV`

: normally distributed deviate of zero mean and unit var

`noao/rv/numrep.x`

`FOUR1`

: forward or inverse FFT of the input array`REALFT`

: FFT of a set of 2N real valued data points`TWOFFT`

: complex FFTs of two input real arrays

`noao/artdata/numrecipes.x`

`GAMMLN`

: natural log of gamma function`POIDEV`

: Poisson deviates for a given mean`GASDEV`

: normally distributed deviate of zero mean and unit var

`noao/imred/ccdred/ccdtest/t_mkimage.x`

`MKSIGMA`

: Sequence of random numbers of the specified sigma

`sys/mwcs/mwlu.x`

*(no NR copyright statement)*`MW_LUDECOMPOSE`

: LU decomposition of a square matrix`MW_LUBACKSUB`

: backsubstitution to solve a system

`pkg/utilities/nttools/stxtools/`

*(no NR copyright statement)*`noao/astutil/asttools/asttimes.x`

*(no NR copyright statement)*`AST_JULDAY_TO_DATE`

: Convert Julian date to calendar date

`noao/digiphot/daophot/daolib/`

*(no NR copyright statement)*`noao/imred/vtel/mrqmin.x`

*(no NR copyright statement)*`MRQMIN`

: Levenberg-Marquard nonlinear chi square minimization`MRQCOF`

: Evaluate linearized matrix coefficients`GAUSSJ`

: Linear equation solution by Gauss-Jordan elimination`COVSRT`

: Sort covariance matrix

`pkg/utilities/nttools/trebin/`

*(no NR copyright statement)*`vendor/cfitsio/eval.y`

,`vendor/cfitsio/eval_y.c`

*(no NR copyright statement)*`gammln`

: natural log of gamma function`poidev`

: Poisson deviates for a given mean`gasdev`

: normally distributed deviate of zero mean and unit var

This problem was reported as issue #21 and resolved in pull request #37 in the github repository iraf/iraf-v216.

**All Numerical Recipes code is removed and replaced by free code in the community distribution of IRAF.**

## Code taken from the iraf64 project

The IRAF versions with 64 bit support include code taken from the IRAF64 project, without acknowledging the author, and by violating the license conditions:

```
See COPYRIGHTS file for original IRAF.
Do not remove CREDITS_IRAF64 and LICENCE_IRAF64 from IRAF package.
Please display following message when starting IRAF shells;
This product includes results achieved by the IRAF64 project in 2006-
2009 directed by Chisato Yamauchi (C-SODA/ISAS/JAXA).
```

So far, the following files are found to be affected:

This was reported as issue #92 and resolved with pull request #125 in the github repository iraf/iraf-v216.

**The community distribution of IRAF correctly acknowledges the contributions of the IRAF64 project.**