sourcestats: limit minimum value of std_dev

This commit is contained in:
Miroslav Lichvar 2018-02-23 12:30:20 +01:00
parent 666ece122e
commit e79a6c2116

View file

@ -51,6 +51,9 @@
#define MIN_SKEW 1.0e-12
#define MAX_SKEW 1.0e+02
/* The minimum standard deviation */
#define MIN_STDDEV 1.0e-9
/* The asymmetry of network jitter when all jitter is in one direction */
#define MAX_ASYMMETRY 0.5
@ -571,7 +574,7 @@ SST_DoNewRegression(SST_Stats inst)
inst->estimated_offset = est_intercept;
inst->offset_time = inst->sample_times[inst->last_sample];
inst->estimated_offset_sd = est_intercept_sd;
inst->std_dev = sqrt(est_var);
inst->std_dev = MAX(MIN_STDDEV, sqrt(est_var));
inst->nruns = nruns;
inst->skew = CLAMP(MIN_SKEW, inst->skew, MAX_SKEW);