Skip to content

Instantly share code, notes, and snippets.

@even4void
Last active December 28, 2015 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save even4void/7416545 to your computer and use it in GitHub Desktop.
Save even4void/7416545 to your computer and use it in GitHub Desktop.
Computing some probability value from Student distribution
// Time-stamp: <2013-11-11 17:58:52 chl>
// gcc -Wall 1.c -lgsl -lgslcblas -lm
#include <stdio.h>
#include <gsl/gsl_cdf.h>
int main(void) {
double p;
double x = 2.0;
int nu = 6;
p = gsl_cdf_tdist_P(x, nu);
printf ("prob(x < %5.2f) = %10.8f\n", x, p);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment