* @param x x > 0
     * @param y y > 1
     * @param div Optimisation parameter...
     * @return true iff x^y < compare
     */
    public static boolean powerTestBelowNoRounding(
            BigDecimal compare,
            BigDecimal x,
            BigInteger y,
            int div) {
        if (div < 3) {
            div = 2;
        } else {
            if (div > 256) {
                div = 256;
            }
        }
        BigInteger div_BigInteger = BigInteger.valueOf(div);
        BigDecimal toCompare = BigDecimal.ONE;
        BigDecimal toCompare0;
        // Deal with special case
        if (y.compareTo(div_BigInteger) == -1) {
            toCompare0 = powerNoRounding(
                    x,
                    y,
                    div);
            if (toCompare0.compareTo(compare) == -1) {
                return true;
            } else {
                return false;
            }
        }
        BigInteger y1 = new BigInteger(y.toString());
        BigInteger[] yDivideAndRemainder;
        while (y1.compareTo(BigInteger.ONE) == 1) {
            if (y1.compareTo(div_BigInteger) == -1) {
                toCompare0 = powerNoRounding(
                        x,
                        y1,
                        div);
            } else {
                yDivideAndRemainder = y1.divideAndRemainder(div_BigInteger);
                boolean powerTest0 = powerTestAboveNoRounding(
                        compare,
                        x,
                        yDivideAndRemainder[0],
                        div);
                if (powerTest0) {
                    return true;
                } else {
                    toCompare0 = powerNoRounding(
                            x,
                            yDivideAndRemainder[0],
                            div);
                }
                toCompare0 = powerNoRounding(
                        toCompare0,
                        div);
                if (toCompare.compareTo(compare) == -1) {
                    return true;
                }
                if (yDivideAndRemainder[1].compareTo(BigInteger.ONE) == 1) {
                    BigDecimal resultRemainder = powerNoRounding(
                            x,
                            yDivideAndRemainder[1],
                            div);
                    if (resultRemainder.compareTo(compare) == -1) {
                        return true;
                    }
                    toCompare0 = toCompare0.multiply(resultRemainder);
                    if (toCompare.compareTo(compare) == -1) {
                        return true;
                    }
                }
            }
            toCompare = toCompare.multiply(toCompare0);
            if (toCompare.compareTo(compare) == -1) {
                return true;
            }
            y1 = y1.divide(div_BigInteger);
        }
        return false;
    }