@Override
    public Boolean value(final Double a, final Double b) {
        if (a == null || b == null ||
                Double.isInfinite(a) || Double.isNaN(a) ||
                Double.isInfinite(b) || Double.isNaN(b))
            return false;
        double denominator = Math.max(Math.abs(a), Math.abs(b));
        if (denominator == 0.0)
            return true;
        /*
         * In an attempt to not destroy a large number of significant
         * digits the code does not subtract a from b, but considers
         * if the smallest absolute value times the sign of the product
         * relative to the largest absolute value is close to 1.
         * See [1].
         */
        double numerator = Math.min(Math.abs(a), Math.abs(b)) *
                Math.signum(a * b);
        return 1.0 - this.getPrecision() <= (numerator / denominator);
    }