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