Fast two-point correlation code