/******************************************************************************
* *
* COMPUTE MERTENS FUNCTION *
* 04/02/10 (dkc) *
* *
******************************************************************************/
#include <math.h>
double fasthic(unsigned int x, unsigned int u, char *mob, int *M) {
unsigned int i,j,m,xom;
double sumb;
int temp;
sumb=0.0;
for (m=1; m<=u; m++) {
temp=mob[m-1];
xom=x/m;
j=(unsigned int)sqrt((double)xom);
j=j+1;
for (i=j; i<=xom; i++) {
if (temp<0)
sumb=sumb-(double)M[xom/i-1];
if (temp>0)
sumb=sumb+(double)M[xom/i-1];
}
}
return(sumb);
}