add numerical recipes library

This commit is contained in:
2025-09-12 18:55:25 +09:00
parent d4dff245bd
commit 2c75620ec9
1344 changed files with 63869 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
void rebin(rc,nd,r,xin,xi)
float r[],rc,xi[],xin[];
int nd;
{
int i,k=0;
float dr=0.0,xn=0.0,xo=0.0;
for (i=1;i<nd;i++) {
while (rc > dr)
dr += r[++k];
if (k > 1) xo=xi[k-1];
xn=xi[k];
dr -= rc;
xin[i]=xn-(xn-xo)*dr/r[k];
}
for (i=1;i<nd;i++) xi[i]=xin[i];
xi[nd]=1.0;
}