|
@@ -66,12 +66,12 @@ int finish_incremental_LSF(struct linear_fit_data *lsf) {
|
66
|
66
|
lsf->xbar /= N;
|
67
|
67
|
lsf->ybar /= N;
|
68
|
68
|
lsf->zbar /= N;
|
69
|
|
- lsf->x2bar = lsf->x2bar / N - lsf->xbar * lsf->xbar;
|
70
|
|
- lsf->y2bar = lsf->y2bar / N - lsf->ybar * lsf->ybar;
|
71
|
|
- lsf->z2bar = lsf->z2bar / N - lsf->zbar * lsf->zbar;
|
72
|
|
- lsf->xybar = lsf->xybar / N - lsf->xbar * lsf->ybar;
|
73
|
|
- lsf->yzbar = lsf->yzbar / N - lsf->ybar * lsf->zbar;
|
74
|
|
- lsf->xzbar = lsf->xzbar / N - lsf->xbar * lsf->zbar;
|
|
69
|
+ lsf->x2bar = lsf->x2bar / N - sq(lsf->xbar);
|
|
70
|
+ lsf->y2bar = lsf->y2bar / N - sq(lsf->ybar);
|
|
71
|
+ lsf->z2bar = lsf->z2bar / N - sq(lsf->zbar);
|
|
72
|
+ lsf->xybar = lsf->xybar / N - sq(lsf->xbar);
|
|
73
|
+ lsf->yzbar = lsf->yzbar / N - sq(lsf->ybar);
|
|
74
|
+ lsf->xzbar = lsf->xzbar / N - sq(lsf->xbar);
|
75
|
75
|
|
76
|
76
|
const float DD = lsf->x2bar * lsf->y2bar - sq(lsf->xybar);
|
77
|
77
|
if (fabs(DD) <= 1e-10 * (lsf->max_absx + lsf->max_absy))
|