Verifying whether a given function is a probability density function