A posteriori error estimation of the objective functional is considered by means of a differential presentation of a finite-difference scheme and adjoint equations. The local approximation error is presented as a Taylor series remainder in the Lagrangian form. The field of the Lagrange coefficients is determined by a high-accuracy finite-difference template affecting the computation results. The feasibility of using the Lagrange coefficients for refining the solution and for estimating its uncertainty is considered.