Cumulative distribution networks and the derivative-sum-product algorithm