Exponential funciton now checks random variable is nonnegative and
throws a domain error otherwise. Added an invalid value test as well