/* timintg.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ /* Time numerical integration for complete elliptic integrals. Input parameter: n -> number of k values uniformly spaced over interior of interval [0,1] */ #include #include #include "ccmath.h" double k,fel(double x); double Pi2=1.5707963267949966; double te=1.e-10; void main(int na,char **av) { double x0,x1,dk,dt,*val; int m,j,n; clock_t st,en; if(na!=2){ printf("para: num\n"); exit(1);} n=atoi(*++av); printf(" Timing Numerical Integration\n"); printf(" %d complete elliptic integrals\n",n); val=(double *)calloc(n,sizeof(double)); dk=1./(n+1); x0=0.; x1=Pi2; m=10; k=dk; st=clock(); for(j=0; j