question: public static void assertRelativelyEquals ( String msg , double expected , double actual , double relativeError ) { if ( Double . isNaN ( expected ) ) { Assert . assertTrue ( msg , Double . isNaN ( actual ) ) ; } else if ( Double . isNaN ( actual ) ) { Assert . assertTrue ( msg , Double . isNaN ( expected ) ) ; } else if ( Double . isInfinite ( actual ) || Double . isInfinite ( expected ) ) { Assert . assertEquals ( expected , actual , relativeError ) ; } else if ( expected == 0.0 ) { Assert . assertEquals ( msg , actual , expected , relativeError ) ; } else { double absError = FastMath . abs ( expected ) * relativeError ; Assert . assertEquals ( msg , expected , actual , absError ) ; } }
target:  Verifies that the relative error in actual vs. expected is less than or equal to relativeError.  If expected is infinite or NaN, actual must be the same (NaN or infinity of the same sign).