[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] bug in binomial pdf function

From: Kyle L. Jensen
Subject: [Bug-gsl] bug in binomial pdf function
Date: Fri, 25 Feb 2005 07:47:02 -0500

I think the gsl_ran_binomial_pdf function is
returning incorrect values. (code snippet
at the bottom).  This code is compiled with 

gcc -lgsl -lgslcblas foo.c

Here's the output of my 'gcc -v'
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/specs
Configured with: /var/tmp/portage/gcc-3.3.5-r1/work/gcc-3.3.5/configure 
--enable-version-specific-runtime-libs --prefix=/usr 
--host=i686-pc-linux-gnu --disable-altivec --enable-nls 
--without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu 
--with-system-zlib --disable-checking --disable-werror 
--disable-libunwind-exceptions --enable-shared --enable-threads=posix 
--disable-multilib --enable-java-awt=gtk --enable-languages=c,c++,f77,java
Thread model: posix
gcc version 3.3.5  (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-

My system is
Linux 2.6.9, i686 Pentium III (Coppermine) GenuineIntel GNU/Linux

Please let me know when a human gets this!

Thanks, Kyle

PS.  GSL rocks -- thanks for all your hard work!

/*  Start of code  */
#include <gsl/gsl_cdf.h>
#include <stdio.h>

        double prob;
        double p = 0.5;
        unsigned int k = 1;
        unsigned int n = 4;

        prob = gsl_ran_binomial_pdf (k, p, n);
        printf("gsl_ran_binomial_pdf (%d, %f, %d) = %f\n", k,p,n,prob);
        /* this prints
         * gsl_ran_binomial_pdf (1, 0.500000, 4) = 1.000000
         * on my system

        return 0;
/*  End of code  */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]