Estimation of the accuracy of approximate wave functions