source: tol/tol_tests/gsl/ticket_001398/test_cdf_beta.c

devel
Last change on this file was 49af556, checked in by Jorge Pérez <josp.jorge@…>, 15 years ago

refs #1398, bug in loop

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@4027 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100644
File size: 1.5 KB
Line 
1#include <gsl/gsl_cdf.h>
2
3int main()
4{
5  int i;
6  struct cdf_beta_args {
7    double x;
8    double a;
9    double b;
10  } test_args[] =
11    {
12      {0.9060444950591773,0.2041502528011575,3.577470746807153},
13      {0.9106045018415898,0.1294490217232419,4.295225903094223},
14      {0.9306478824000806,0.159713134506609,4.357303934038536},
15      {0.9015749655663967,0.1769167491596307,3.709593420822396},
16      {0.9056045790202916,0.1844906478517543,3.606277883345159},
17      {0.9067085161805153,0.1903702202487794,3.697913210813661},
18      {0.9155602918472141,0.2029333494515557,3.52015751714325},
19      {0.9124320398550481,0.148724728854337,4.097669113723164},
20      {0.9031198702286929,0.07202908789468146,7.504563898196396},
21      {0.9078737252857536,0.1940092241212835,3.449984239856465},
22      {0.9086117066908628,0.1761127284729697,3.611606788307608},
23      {0.9105308051221073,0.2000373082584609,3.467828750535305},
24      {0.9149131434969604,0.1729368532663472,4.128703338450808},
25      {0.9363559170160443,0.1799456963706892,4.207224837486437},
26      {0.9446900135371834,0.06873371518266619,6.27892521836533},
27      {0.9999999868417623,24.95643274099755,918.6566331776214}
28    };
29
30  for ( i = 0; i < sizeof( test_args ) / sizeof( test_args[ 0 ] ); ++i ) {
31    printf( "gsl_cdf_beta_Pinv(%g,%g,%g)=",
32             test_args[i].x, test_args[i].a, test_args[i].b );
33    double p = gsl_cdf_beta_Pinv( test_args[i].x,
34                                  test_args[i].a,
35                                  test_args[i].b );
36    printf( "%g\n", p );
37  }
38  return 0;
39}
Note: See TracBrowser for help on using the repository browser.