Add minimum skew limit to sourcestats

This commit is contained in:
Miroslav Lichvar 2013-06-19 10:22:49 +02:00
parent 01f797ac05
commit f8d609fee5

View file

@ -51,6 +51,9 @@ int min_samples;
2000ppm, which would be pretty bad */
#define WORST_CASE_FREQ_BOUND (2000.0/1.0e6)
/* The minimum allowed skew */
#define MIN_SKEW 1.0e-12
/* ================================================== */
static LOG_FileID logfileid;
@ -453,6 +456,9 @@ SST_DoNewRegression(SST_Stats inst)
inst->variance = est_var;
inst->nruns = nruns;
if (inst->skew < MIN_SKEW)
inst->skew = MIN_SKEW;
stress = fabs(old_freq - inst->estimated_frequency) / old_skew;
if (best_start > 0) {