title: Which one takes less cpu clock cycles to execute? Pythagoras formula or 16 comparisons among ints in "if" clause?
body: <p>Aprox answer is sufficient.
  I am suppose to check if 2 rectangles of same size overlap or not
  1) Existing code checks if all (x,y) of one rectangle is withing the all (x,y) of another. So making 16 comparisons in total
  2) My improvement - Calculating distance between upperl-left corner's of each rectangle and checking if this distance is smaller than diagonal of the rectangle.</p>
  
  <p>Also any book/material that discusses about number of CPU clock cycles/time each operation in coding takes to execute once on CPU is appreciated.</p>