We investigate a pooling algorithm, which accommodates imperfect tests, to test for a disease. We find that this algorithm belongs to the class of pooling methods that have greater accuracy than individual testing, under reasonable levels of test kit sensitivity and specificity. Additionally, this increase in accuracy is achieved with fewer tests than individual testing for low prevalences of disease. Indeed, the savings can be considerable, making screening for some diseases more economically feasible. Further, results from the implementation of the matrix pooling algorithm can be used to efficiently estimate the prevalence of rare diseases. We explore the benefits of our proposed technique with testing for acute HIV infection. This period immediately following infection is marked with a high viral load, likely increasing infectiousness. However, due to the high costs of these tests, most individuals are currently not routinely tested for acute HIV infection. Not only is matrix pooling algorithm a more economical option for acute HIV infection compared to testing samples singly, our algorithm also reduces the number of false positive and false negative test results. Further, the matrix pooling results can be used to estimate HIV incidence, a critical element of comprehensive monitoring and evaluation of HIV prevention interventions.