12 double s1, sx, sy, sxx, sxy;
17 s1 = sx = sy = sxx = sxy = 0.0;
19 for ( ihit = 0; ihit < nUse; ihit++ )
22 if (
sigma[ihit] < 0.0 )
continue;
27 sxx +=
x[ihit] * (
x[ihit] *
weight );
28 sxy +=
y[ihit] * (
x[ihit] *
weight );
38 denom = s1 * sxx - sx * sx;
39 delinv = ( denom == 0.0 ) ? 1.e20 : 1. / denom;
40 intercept = ( sy * sxx - sx * sxy ) * delinv;
41 slope = ( s1 * sxy - sx * sy ) * delinv;
47 for ( ihit = 0; ihit < nUse; ihit++ )
49 if (
sigma[ihit] < 0.0 )
continue;