static double relativeError(double expected, double result) {
		if (Double.isNaN(expected) || Double.isInfinite(expected)
				|| Double.isNaN(result) || Double.isInfinite(result)
				|| expected == 0)
			return 0;
		return Math.abs(result - expected) / Math.abs(expected);
	}