Precompute xlogx values for speeding up computation