Computation of standard errors in C++