/* xchcof.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.) * ------------------------------------------------------------------------ */ #include "xpre.h" static struct xpr cs[52]; void xchcof(struct xpr *c,int m,struct xpr (*xfunc)()) { struct xpr a,b; int i,j,k,n; ++m; n=2*m; a=xdiv(pi2,inttox(m)); b=a; cs[0]=one; for(j=0; jn) i=2*n-i; c[k]=xadd(c[k],xmul(a,cs[i]),0); } } b=xpr2(xdiv(one,inttox(m)),1); for(j=0; j