Skip to content

Instantly share code, notes, and snippets.

@even4void
Created August 25, 2010 09:57
Show Gist options
  • Select an option

  • Save even4void/549213 to your computer and use it in GitHub Desktop.

Select an option

Save even4void/549213 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require("gsl")
x = 2.0
P = GSL::Cdf::ugaussian_P(x);
printf("prob(x < %f) = %f\n", x, P);
Q = GSL::Cdf::ugaussian_Q(x);
printf("prob(x > %f) = %f\n", x, Q);
x = GSL::Cdf::ugaussian_Pinv(P);
printf("Pinv(%f) = %f\n", P, x);
x = GSL::Cdf::ugaussian_Qinv(Q);
printf("Qinv(%f) = %f\n", Q, x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment