home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
ANUMR5.ZIP
/
SIMPTEST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-01-13
|
589b
|
39 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;
int n=50;
double lb=1.0;
double ub=10.0;
int errcode;
puts("Test for Simpson function\n"
"-------------------------\n");
printf("Lower bound : %lf\n",lb);
printf("Upper bound : %lf\n",ub);
printf("Number of intervals : %d\n",n);
simpson(lb,ub,
n,
&integ,
&errcode,
bf);
SYSMSG(errcode,stderr);
printf("Value : %lf\n",integ);
}