MATH-866 Method to test for equality with a given relative tolerance (due to Yannick Tanguy and Julien Anxionnat). Original patch provided in JIRA MATH-863 and committed with a few changes.