float *
ballpole(x,jcount,npoles,past,c,out,nvals)
float *x,*past,*c,*out;
long  *jcount,npoles,nvals;
{
	int i,j,nfint;
	float *retval = out;
	float temp;
	for(i=0;i<nvals;++i){
		temp = *x++;
		for(j= *jcount, nfint=0;  nfint<npoles;  nfint++,j++)
			temp += (*(c+nfint) * *(past+j));
		*out++ =  *(past+ *jcount) = *(past+*jcount+npoles) = temp;
		*jcount = (*jcount + 1) % npoles;
		}
	return(retval);
}
