return total;
}
+static int filter_outliers_iqr(double *sorted, int n)
+{
+ double q1, q3, iqr, lo, hi;
+ int start = 0, end = n;
+
+ if (n < 8)
+ return n;
+
+ q1 = sorted[n / 4];
+ q3 = sorted[3 * n / 4];
+ iqr = q3 - q1;
+ lo = q1 - 1.5 * iqr;
+ hi = q3 + 1.5 * iqr;
+
+ while (start < end && sorted[start] < lo)
+ start++;
+ while (end > start && sorted[end - 1] > hi)
+ end--;
+
+ if (start > 0)
+ memmove(sorted, sorted + start, (end - start) * sizeof(double));
+
+ return end - start;
+}
+
static void compute_stats(const double *sorted, int n,
struct timing_stats *s)
{
return;
}
+ total = filter_outliers_iqr(all, total);
compute_stats(all, total, &s);
if (t->machine_readable) {