octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #30824] gammaln(0) and gammaln((minus integer)


From: Tatsuro MATSUOKA
Subject: [Octave-bug-tracker] [bug #30824] gammaln(0) and gammaln((minus integer)) give slatec error
Date: Fri, 20 Aug 2010 00:48:38 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.126 Safari/533.4

URL:
  <http://savannah.gnu.org/bugs/?30824>

                 Summary: gammaln(0) and gammaln((minus integer)) give slatec
error
                 Project: GNU Octave
            Submitted by: tmacchant
            Submitted on: 2010年08月20日 00時48分37秒
                Category: Libraries
                Severity: 3 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Tatsuro MATSUOKA
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.3.52
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

I have reported in maintainers list 

http://octave.1599824.n4.nabble.com/gammaln-0-octave-3-3-51-MinGW-td2309223.html#a2309822

gammaln(0) and gammaln((minus integer)) give slatec error
(developement tip)

octave:5> gammaln(0) 
 ***MESSAGE FROM ROUTINE DGAMMA IN LIBRARY SLATEC. 
 ***FATAL ERROR, PROG ABORTED, TRACEBACK REQUESTED 
 *  X IS 0 
 *  ERROR NUMBER = 4 
 * 
 ***END OF MESSAGE 

 ***JOB ABORT DUE TO FATAL ERROR. 
0          ERROR MESSAGE SUMMARY 
 LIBRARY    SUBROUTINE MESSAGE START             NERR     LEVEL     COUNT 
 SLATEC     DGAMMA     X IS 0                       4         2         2 

error: lgamma: exception encountered in Fortran subroutine dlgams_ 

Seeing the code, liboctave/lo-specfun.cc, I found 

double 
xgamma (double x) 
{ 
#if defined (HAVE_TGAMMA) 
  return tgamma (x); 
#else 
  double result; 

  if (xisnan (x)) 
    result = x; 
  else if ((x <= 0 && D_NINT (x) == x) || xisinf (x)) 
    result = octave_Inf; 
  else 
    F77_XFCN (xdgamma, XDGAMMA, (x, result)); 

  return result; 
#endif 
} 

For also xlgamma, is the below to be used 
  else if ((x <= 0 && D_NINT (x) == x) || xisinf (x)) 
instead if   
   else if (xisinf (x)) 

Am I right? 

The attached changeset is my proposal to fix the issue




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: 2010年08月20日 00時48分37秒  Name: slatec_gamma.diff  Size: 1kB  
By: tmacchant
changeset for liboctave/lo-specfun.cc
<http://savannah.gnu.org/bugs/download.php?file_id=21262>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?30824>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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