Sketch divergence testing algorithm