Go to the documentation of this file.
27 #ifndef CHECKASM_STATS_H
28 #define CHECKASM_STATS_H
88 #define CHECKASM_STATS_SAMPLES 256
102 if (
s.sum > 0 &&
s.count > 0) {
111 if (cycles < target_cycles >> 10) {
CheckasmSample samples[CHECKASM_STATS_SAMPLES]
CheckasmVar checkasm_var_inv(CheckasmVar a)
#define CHECKASM_STATS_SAMPLES
CheckasmVar checkasm_var_add(CheckasmVar a, CheckasmVar b)
static CheckasmVar checkasm_measurement_result(const CheckasmMeasurement measurement)
static double checkasm_mode(const CheckasmVar x)
static double checkasm_mean(const CheckasmVar x)
static CheckasmVar checkasm_var_const(double x)
CheckasmVar checkasm_var_sub(CheckasmVar a, CheckasmVar b)
CheckasmVar checkasm_stats_estimate(const CheckasmStats *stats)
static void checkasm_measurement_init(CheckasmMeasurement *measurement)
static CheckasmStats stats
CheckasmVar checkasm_var_div(CheckasmVar a, CheckasmVar b)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static double checkasm_median(const CheckasmVar x)
CheckasmVar checkasm_var_pow(CheckasmVar a, double exp)
static void checkasm_stats_count_grow(CheckasmStats *const stats, uint64_t cycles, uint64_t target_cycles)
static double checkasm_stddev(const CheckasmVar x)
static void checkasm_stats_reset(CheckasmStats *const stats)
CheckasmVar checkasm_var_mul(CheckasmVar a, CheckasmVar b)
static void checkasm_measurement_update(CheckasmMeasurement *measurement, const CheckasmStats stats)
static double checkasm_sample(const CheckasmVar x, const double q)
static void checkasm_stats_add(CheckasmStats *const stats, const CheckasmSample s)
CheckasmVar checkasm_var_scale(CheckasmVar a, double s)