btw. R1 should never get exactly 0.0f - this would be no good for the logarithm.