mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 03:45:07 -05:00
Add minimum skew limit to sourcestats
This commit is contained in:
@@ -51,6 +51,9 @@ int min_samples;
|
|||||||
2000ppm, which would be pretty bad */
|
2000ppm, which would be pretty bad */
|
||||||
#define WORST_CASE_FREQ_BOUND (2000.0/1.0e6)
|
#define WORST_CASE_FREQ_BOUND (2000.0/1.0e6)
|
||||||
|
|
||||||
|
/* The minimum allowed skew */
|
||||||
|
#define MIN_SKEW 1.0e-12
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
static LOG_FileID logfileid;
|
static LOG_FileID logfileid;
|
||||||
@@ -453,6 +456,9 @@ SST_DoNewRegression(SST_Stats inst)
|
|||||||
inst->variance = est_var;
|
inst->variance = est_var;
|
||||||
inst->nruns = nruns;
|
inst->nruns = nruns;
|
||||||
|
|
||||||
|
if (inst->skew < MIN_SKEW)
|
||||||
|
inst->skew = MIN_SKEW;
|
||||||
|
|
||||||
stress = fabs(old_freq - inst->estimated_frequency) / old_skew;
|
stress = fabs(old_freq - inst->estimated_frequency) / old_skew;
|
||||||
|
|
||||||
if (best_start > 0) {
|
if (best_start > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user