Go to the documentation of this file. 63 #define ADD_SAMPLE(m, s) \ 64 (m.sum_of_samples += (float)(s), \ 65 m.sum_of_squares += (float)(s) * (float)(s), ++m.num_samples) 74 ((m).num_samples ? ((float)((m).sum_of_samples / (m).num_samples)) : 0) 83 #define new_measurement(m) \ 84 ((m).num_samples = 0, (m).sum_of_samples = 0, (m).sum_of_squares = 0) 92 #define number_of_samples(m) \ 101 #define standard_deviation(m) \ 102 ((float) sqrt (VARIANCE (m))) 110 #define VARIANCE(m) \ 111 (((m).num_samples > 1) \ 112 ? ((float)(((m).num_samples * (m).sum_of_squares - \ 113 (m).sum_of_samples * (m).sum_of_samples) / \ 114 (((m).num_samples - 1) * (m).num_samples))) \ 123 #define print_summary(string, measure) \ 124 cprintf("\t%-20s \tn = %d, \tm = %4.2f, \ts = %4.2f\n ", string, \ 125 number_of_samples(measure), MEAN(measure), \ 126 standard_deviation(measure))