Small optimization for Haversine function