public long discreteLogarithmFromExpectedRange(BigInteger value, long expectedResult, long searchRadius)
	{   
		if(expectedResult - searchRadius < 0 || searchRadius == 0) {
			throw new IllegalArgumentException();
		}
		
		long start = expectedResult - searchRadius;
		long end = expectedResult + searchRadius;
		boolean logFound = false;
		long power = start;
		BigInteger current = raiseGenerator(power);
		
		while(!logFound && power <= end)
		{
			if(current.equals(value)) {
				logFound = true;
			} else {
				power++;
				current = multiplyMod(current);
			}
		}
		
		if(logFound) {
			return power;
		} else {
			return discreteLogarithm(value);
		}
	}