On the Accuracy of the Banerjee Test

Abstract The Banerjee test is commonly considered to be the more accurate of the two major approximate tests used in automatic vectorization/parallelization of loops, the other being the GCD test. From its derivation, however, there is no simple explanation of why the Banerjee test should be nearly as accurate as it is given credit for. We prove a sufficient condition for the Banerjee test's accuracy and explain the test's perceived superiority by showing that under circumstances which occur extremely frequently in actual code, it is, in fact, not approximate, but perfectly accurate.