I think its pretty self explanatory from the code. Obviously I'm no evaluating the same thing over and over, its just example numbers to explain my problem. I'm guessing its over/underflow but I don't know how to deal with it.
double d = (1 / (684985+157781));
System.out.println(d); // returns 0.0
System.out.println(Math.log(d)); // returns -Infinity.