some generic rand function for sampleable
remove sampledim