calcAccuracy function

Calculate the accuracy of an index