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,28 @@
/* Driver for routine mnbrak */
#include <stdio.h>
#define NRANSI
#include "nr.h"
float func(float x)
{
return bessj0(x);
}
int main(void)
{
float ax,bx,cx,fa,fb,fc;
int i;
for (i=1;i<=10;i++) {
ax=i*0.5;
bx=(i+1.0)*0.5;
mnbrak(&ax,&bx,&cx,&fa,&fb,&fc,func);
printf("%14s %12s %12s\n","a","b","c");
printf("%3s %14.6f %12.6f %12.6f\n","x",ax,bx,cx);
printf("%3s %14.6f %12.6f %12.6f\n","f",fa,fb,fc);
}
return 0;
}
#undef NRANSI