home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
ANUMR5.ZIP
/
ROMBTEST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-16
|
764b
|
42 lines
#include <math.h>
#include <stdio.h>
#include "anum.h"
#include "sysio.h"
double bf(double x)
{ return exp(3.0*x) + x*x/3.0; }
void main(void)
{ double integ;
double lb=1.0;
double ub=10.0;
double tol=1.e-08;
int maxiter=30;
int errcode, iter;
puts("Test for romberg function\n"
"-------------------------");
printf("Lower bound : %lf\n",lb);
printf("Upper bound : %lf\n",ub);
printf("Maximum number of iterations : %d\n",maxiter);
romberg(lb,ub,
tol, maxiter,
&integ,
&iter,
&errcode,
bf);
SYSMSG(errcode,stderr);
printf("Value : %le\n",integ);
printf("Ran through : %d iterations\n",iter);
}