Biot-Savart routines with minimal floating point error
A set of routines to compute the magnetic vector potential and magnetic field of two types of current carriers is presented. The (infinitely thin) current carrier types are a straight wire segment and a circular wire loop. The routines are highly accurate and exhibit the correct asymptotic behavior far away from and close to the current carrier. A suitable global set of test points is introduced and the methods presented in this work are tested against results obtained using arbitrary-precision arithmetic on all test points. The results are accurate to approximately 16 decimal digits of precision when computed using 64 bit floating point arithmetic. There are a few exceptions where accuracy drops to 13 digits. These primitive current carrier types can be used to assemble more complex arrangements, such as a current along a polygon (by means of defining straight wire segments from point to point along the polygon) and a multi-winding coil with circular cross-section. Reference data is provided along with the code for benchmarks with other implementations.