We describe our proposed algorithm for statistical estimation of the error of the dual energy method due to the quantum nature of radiation as applied to an X-ray inspection system containing sandwich detectors. Its action is demonstrated using a specific example. Recommendations are given for the further use of the algorithm, in particular, for optimizing the structural elements of radiation sandwich detectors.