Inlined pseudo-random number generator for trace()