   xj = coords[j].x;
   yj = coords[j].y;
 
-  xd = pow((xi - xj), 2.0);
-  yd = pow((yi - yj), 2.0);
+  xd = (xi - xj) * (xi - xj);
+  yd = (yi - yj) * (yi - yj);
 
   return (int) floor(sqrt(xd + yd) + 0.5);
 }

  register unsigned int iter = iterations;
  register int change;
  register struct best_2opt best = {0,0,999999};

  cities = num_cities;


	  }
      }
  }
  __syncthreads();

  // Intra-block reduction
  // Reductions, threadsPerBlock must be a power of 2 because of the following code
