The formula is correct, for a distance of 1 m, the acoustics are less than 1/1000 millimeters. What is wrong is your lat / lon position, which you received from a GPS device that can deflect this 40 m.
For a distance of 10 m, the formula used either in haversine or in distanceFromLocation is absolutely accurate. It begins to become interesting when distances are several kilometers away.
So donβt worry. But the main problem is to get such high positions, and it depends on what you need for this.
You need to remotely measure the coordinates of ONE GPS device (which works) or between different GPS devices (30 meters can be set for two devices in the same position, but usually 3-6 meters GPS accuracy with a good view to open the sky .
Next, make sure you use the desired BestForNavigation or Best function.
source share