Redefining `dx` here is confusing.  It used to be (xmax-xmin)/(npoints-1).  Recommend using `dp` instead.  Or `dcdf`

But actually, isn't this just probability*dx?