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,45 @@
#include "nrutil.h"
extern float **d,*x;
void rzextr(iest,xest,yest,yz,dy,nv)
float dy[],xest,yest[],yz[];
int iest,nv;
{
int k,j;
float yy,v,ddy,c,b1,b,*fx;
fx=vector(1,iest);
x[iest]=xest;
if (iest == 1)
for (j=1;j<=nv;j++) {
yz[j]=yest[j];
d[j][1]=yest[j];
dy[j]=yest[j];
}
else {
for (k=1;k<iest;k++)
fx[k+1]=x[iest-k]/xest;
for (j=1;j<=nv;j++) {
v=d[j][1];
d[j][1]=yy=c=yest[j];
for (k=2;k<=iest;k++) {
b1=fx[k]*v;
b=b1-c;
if (b) {
b=(c-v)/b;
ddy=c*b;
c=b1*b;
} else
ddy=v;
if (k != iest) v=d[j][k];
d[j][k]=ddy;
yy += ddy;
}
dy[j]=ddy;
yz[j]=yy;
}
}
free_vector(fx,1,iest);
}