add cdf function from @wiedi

* https://gist.github.com/wiedi/8ac2d8b21b7563041d9d