bugGNU Scientific Library - Bugs: bug #24897, problem with large a in...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #24897: problem with large a in gsl_ran_beta

Submitted by:  Brian Gough <bjg>
Submitted on:  Fri 21 Nov 2008 03:47:34 PM UTC  
 
Category: Accuracy problemSeverity: 3 - Normal
Operating System: Status: Fixed
Assigned to: NoneOpen/Closed: Closed
Release: 1.11

Sun 30 Nov 2008 09:26:00 AM UTC, comment #1:

fixed by 210a09f8b02ad88ce949e8d56cccf89c93e877af

Brian Gough <bjg>
Project Administrator
Fri 21 Nov 2008 03:47:34 PM UTC, original submission:

From: "Wang, Frank" <frank.wang@validusre.bm>
Subject: RE: [Bug-gsl] bug with function gsl_ran_beta
Date: Tue, 18 Nov 2008 18:59:54 -0400

Hi Ralph,

Thank you very much for your quick response.

The problem is cuased by the truncation of double to unsiged int in the function gsl_ran_gamma() in file gamma.c:

double
gsl_ran_gamma (const gsl_rng * r, const double a, const double b)
{
/* assume a > 0 */
unsigned int na = floor (a);

//Frank Wang add 11/18/2008 for fix bug when big a is inputed
if(a >= UINT_MAX )
return b*(gamma_large(r, floor(a)) + gamma_frac(r, a - floor(a)) );

if (a == na)
{
return b * gsl_ran_gamma_int (r, na);
}
else if (na == 0)
{
return b * gamma_frac (r, a);
}
else
{
return b * (gsl_ran_gamma_int (r, na) + gamma_frac (r, a - na)) ;
}
}

When this fix is applied, I get simulation compatible with R or Matlab.

Best Regards,

Frank

Brian Gough <bjg>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bjg (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 30 Nov 2008 09:26:00 AM UTCbjgOpen/ClosedOpen=>Closed
    Sun 30 Nov 2008 09:25:59 AM UTCbjgStatusConfirmed=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup