How does one generate the table mapping t-test values to p values? In the dark ages, we would map the results of a Student's t-test to a null hypothesis probability p by looking up T and degrees of freedom in a table to get an approximate result. 
What is the mathematical algorithm that generates that table? ie, how can I write a function to generate a precise p given an arbitrary T and df?
The reason I ask is that I'm writing a piece of embedded software that continually monitors hundreds of populations with hundreds of samples each, and raises an alert if successive snapshots of a given population come to differ significantly. Currently it uses a crude z-score comparison, but it would be nice to use a more valid test. 
 A: While it's possible to do it recursively for fixed degrees of freedom (write the cdf for a given d.f. in terms of the cdf for lower degrees of freedom, and the integrals foir the two lowest-integer df may be done directly), I've never seen anyone try to implement it that way.
Some algorithms for the cdf of the $t$ are based on the incomplete beta function (which is a commonly used function in various parts of mathematics or physics). 
There are some for the inverse cdf (quantile function) based on ratios of polynomials.
Plain googling on algorithm cdf|"distribution function" student t turns up plenty of references within the pages linked (e.g. here), such as Abramowitz and Stegun's Handbook of Mathematical Functions (which gives some small-d.f.-exact and approximate calculations), and various other books and papers. 
If you want the noncentral t (e.g. for power calculations) a standard reference is Lenth, R. V. 1989. "Algorithm AS 243: Cumulative distribution function of the noncentral t distribution". Applied Statistics, 38, 185-189.
However, if you're doing many of these, hypothesis tests may not suit your purposes. Something more like a measure of effect size might be better.
