If I were you I would see if I could get the Perl script referred to on the ERIN web page. You might find that the discrepancy is something as simple as a slightly different value for the Earth's radius. And by the way, math.radians() might be a bit clearer than the pi/180 business.