Kolmogorov Smirnov distribution function
Adapted from Press, Teukolsky, Vetterling and Flannery, Numerical Recipes in C p620.