Open yakra opened 9 months ago
// haversine formula double sinsq_lat = sin((rlat2-rlat1)/2); sinsq_lat *= sinsq_lat; double sinsq_lng = sin((rlng2-rlng1)/2); sinsq_lng *= sinsq_lng; double ans = asin(sqrt(sinsq_lat + cos(rlat1) * cos(rlat2) * sinsq_lng)) * 7926.2; /* EARTH_DIAMETER */
Is it possible the compiler optimizes away calls to pow(foo,2) anyway? Probably very little time saved, lost in the noise of ReadWptThread. Cook up a test case with a few million random numbers.
pow(foo,2)
Is it possible the compiler optimizes away calls to
pow(foo,2)
anyway? Probably very little time saved, lost in the noise of ReadWptThread. Cook up a test case with a few million random numbers.