Numerical analysis of sampling algorithms