Examples:
Rejection sample func up to ymax and xmax.
func
ymax
xmax
size – Number of samples
ymax – Maximum value of y
xmax – Maximum value of x
func – Function