add numerical recipes library
This commit is contained in:
21
lib/nr/k_and_r/recipes/fleg.c
Normal file
21
lib/nr/k_and_r/recipes/fleg.c
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
void fleg(x,pl,nl)
|
||||
float pl[],x;
|
||||
int nl;
|
||||
{
|
||||
int j;
|
||||
float twox,f2,f1,d;
|
||||
|
||||
pl[1]=1.0;
|
||||
pl[2]=x;
|
||||
if (nl > 2) {
|
||||
twox=2.0*x;
|
||||
f2=x;
|
||||
d=1.0;
|
||||
for (j=3;j<=nl;j++) {
|
||||
f1=d++;
|
||||
f2 += twox;
|
||||
pl[j]=(f2*pl[j-1]-f1*pl[j-2])/d;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user