TP Intégration Numérique
 All Files Functions
essai02.c
Go to the documentation of this file.
1 
8 #include <math.h>
9 
10 #include "mesh1D.h"
11 #include "quad.h"
12 #include "utils.h"
13 
14 double f(double x){
15  return 8.*sqrt(x*(1-x));
16 }
17 
18 int main(){
19  int n;
20  double h,I;
21  printf("n=");scanf("%d",&n);
22  I=quadPMAlloc(f,0.,1,n,&h);
23  printf("Int=%lf\n",I);
24  printf("Error=%.16e\n",fabs(I-M_PI)/M_PI);
25  return EXIT_SUCCESS; /* return 0 */
26 }