I am interested in setting up calculations to check if a distance criterion is satisfied: that is, the distance between a vector ${\bf x}_i$ and anther vector ${\bf x}_j$ should be less than some value $r_{\rm max}$. My data is partitioned according to an orthogonal grid of coordinates. Since my cutoff is smaller than the distance between the endpoints of nearest-neighbor coordinates, I'd like to add an "octant" variable to check if things are set up correctly:
if octant[j] in allowed_list continue
as a "short-circuit" to
if dist(x[i], x[j]) < r_max
My question is: how efficient computationally are boolean lookups and comparisons relative to floating-point operations? Is this worth doing on modern architectures?