bool result_recorder<Value_Type>:: add_result(value_type res) { m_l.push_back(res); m_sample_mean = sample_mean(m_l.begin(), m_l.end()); m_sample_var = sample_variance(m_l.begin(), m_l.end(), m_sample_mean); size_t dist = std::distance(m_l.begin(), m_l.end()); return sample_mean_confidence_checker(m_sample_mean, m_sample_var, dist, 0.1); }
double one_sample_t(double *x, int n) { double var; double mean; double t; if(n<2) { return(0.0); } var = sample_variance(x,n,mean); if(var<=0.0) { return(0.0); } t = sqrt(1.0*n)*mean/sqrt(var); return(t); }