A sample size calculation algorithm was developed in a prototype version to select inspection samples in domestic bulk handling facilities. This algorithm determines sample sizes of three verification methods satisfying target detection probability for defected items corresponding to one significant quantity (8 kg of plutonium, 75 kg of uranium 235). In addition, instead of using the approximation equation-based algorithm presented in IAEA report, the sample size calculation algorithm based on hypergeometric density function capable of calculating an accurate non-detection probability is adopted. The algorithm based the exact equation evaluates non-detection probability more accurately than the existing algorithm based on the approximation equation, but there is a disadvantage that computation time is considerably longer than the existing algorithm due to the large amount of computational process. It is required to determine sample size within a few hours using laptop-level performance because sample size is generally calculated with an inspector’s portable laptop during inspection activity. Therefore, it is necessary to improve the calculation speed of the algorithm based on the exact equation. In this study, algorithm optimization was conducted to improve computation time. In order to determine optimal sample size, the initial sample size is calculated first, and the next step is to perform an iterative process by changing the sample size to find optimal result. Most of the computation time occurs in sample size optimization process performing iterative computation. First, a non-detection probability calculation algorithm according to the sample sizes of three verification methods was improved in the iterative calculation process for optimizing sample size. A computation time for each step within the algorithm was reviewed in detail, and improvement approaches were derived and applied to some areas that have major effects. In addition, the number of iterative process to find the optimal sample size was greatly reduced by applying the algorithm based on the bisection method. This method finds optimal value using a large interval at the beginning step and reduces the interval size whenever the number of repetitions increases, so the number of iterative process is less than the existing algorithm using unit interval size. Finally, the sample sizes were calculated for 219 example cases presented by the IAEA report to compare computation time. The existing algorithm took about 15 hours, but the improved algorithm took only about 41 minutes using high performance workstation (about 22 times faster). It also took 87 minutes for calculating the cases using a regular laptop. The improved algorithm through this study is expected to be able to apply the sample size determination process, which was performed based on the approximate equation due to the complexity and speed issues of the past calculation process, based on the accurate equation.