docs: public static double cosineOrHaversineRad(double lat1, double lon1, double lat2, double lon2) {
      if(lat1 == lat2 && lon1 == lon2) {
        return 0.;
      }
      final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine
      final double slat1 = sinAndCos(lat1, tmp), clat1 = tmp.value;
      final double slat2 = sinAndCos(lat2, tmp), clat2 = tmp.value;
      final double dlat = lat1 - lat2, dlon = lon1 - lon2;
      // Use cosine, cheaper:
      if(dlat > 0.01 || dlat < -0.01 || dlon > 0.01 || dlat < -0.01) {
        final double a = slat1 * slat2 + clat1 * clat2 * cos(dlon);
        return a < .9999_9999_9999_999 ? acos(a) : 0;
      }
      // Haversine formula, higher precision at < 1 meters
      final double slat = sin(dlat * .5), slon = sin(dlon * .5);
      return 2 * asin(sqrt(slat * slat + slon * slon * clat1 * clat2));
    }