Thankyou for the links. These crates do provide functions for working with samples in statistics, but they lack some features I need. I basically want the probability density function, culmulative distribution function, and quantile function (inverse of cdf) for various distributions. The closest I got was statsrs, which seems to have pdf and cdf, but not qantile functions. Anyway I solved the problem for myself by re-implementing the R stats module in rust (or at least the bits I needed). It's at https://github.com/derekdreery/r_stats.
The R routines (written in C) handle a lot of edge cases, aim to propagate infinity and NaN correctly, and use a multitude of techniques to stay accurate across the whole domain. They are well worth a look if anyone has an interest.