bugGNU Octave - Bugs: bug #50919, Beta function throws FORTRAN...

 
 

bug #50919: Beta function throws FORTRAN errors (Windows only)

Submitted by:  None
Submitted on:  Tue 02 May 2017 09:23:28 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Unexpected Error
Status: FixedAssigned to: None
Originator Name: R TaylorOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.1
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 04 May 2017 01:06:14 AM UTC, comment #10:

Took a long while to build a version through MXE, but I can also confirm that the fix works. Closing report.

Rik <rik5>
Project Administrator
Wed 03 May 2017 09:46:55 PM UTC, comment #9:

I see the following result with the patch on a Windows system running in a virtualbox VM:

John W. Eaton <jwe>
Project Administrator
Wed 03 May 2017 04:49:44 PM UTC, comment #8:

I forced an mxe-octave build on the buildbot.

John W. Eaton <jwe>
Project Administrator
Wed 03 May 2017 04:38:44 PM UTC, comment #7:

I verified that it didn't change the behavior on Linux. However, I can build the MXE version right now to test on Windows.

Rik <rik5>
Project Administrator
Wed 03 May 2017 02:00:26 PM UTC, comment #6:

I don't think it's fp87 vs sse that's causing the trouble here. The beta function ultimately calls the rc_gamma function in liboctave/numeric/lo-specfun.cc. That function uses lgamma_r if it is available, otherwise it uses the SLATEC function DLGAMS (or ALGAMS). I can reproduce the problem on my Debian system if I force Octave to use the SLATEC function.

On Windows systems, lgamma is available, but lgamma_r is not, so it uses the SLATEC function. I pushed the following changeset so that Octave will use lgamma if it is available, and only if both lgamma_r and lgamma are unavailable, will it fall back to using the SLATEC function. I'll test with an mxe-octave build when buildbot does its next build.

http://hg.savannah.gnu.org/hgweb/octave/rev/5296657cde44

Maybe it would be good to have a proper replacement for lgamma_r. If so, I think the right place for it is gnulib, not Octave itself.

John W. Eaton <jwe>
Project Administrator
Wed 03 May 2017 01:15:42 AM UTC, comment #5:

It could be an sse vs fp87 thing. I think we discovered some time ago that even 64-bit Win binary uses fp87 for some reason.

Dmitri.

Dmitri A. Sergatskov <dasergatskov>
Tue 02 May 2017 09:57:43 PM UTC, comment #4:

Works for me on Linux as well. But when I run Octave in a Windows XP virtual machine I do get the reported error.

This must be something about the different Fortran environment on Windows.

Rik <rik5>
Project Administrator
Tue 02 May 2017 09:38:18 PM UTC, comment #3:

No error with Octave 4.2.1 on Mac (Homebrew): beta(-4.6, 0.6) gives -8.8814e-16

Nir Krakauer <nir_krakauer>
Tue 02 May 2017 09:35:04 PM UTC, comment #2:

Correction: beta(-4.6, 0.6) = 0.

Anonymous
Tue 02 May 2017 09:33:50 PM UTC, comment #1:

Additional information:
beta(-5.6, 0.6) = 0 is ok
beta(-6.6, 0.6) = -0 is ok
The correct answer for beta(-4.5, 0.6) should be 0.

Anonymous
Tue 02 May 2017 09:23:28 PM UTC, original submission:

beta(-4.5, 0.6) is ok
beta(-4.6, 0.6) throws a FORTRAN error
beta(-4.7, 0.6) is ok

***MESSAGE FROM ROUTINE DGAMMA IN LIBRARY SLATEC.
***POTENTIALLY RECOVERABLE ERROR, PROG ABORTED, TRACEBACK REQUESTED

  • ANSWER LT HALF PRECISION BECAUSE X TOO NEAR NEGATIVE INTEGER
  • ERROR NUMBER = 1

*
***END OF MESSAGE

***JOB ABORT DUE TO UNRECOVERED ERROR.

  1. ERROR MESSAGE SUMMARY

LIBRARY SUBROUTINE MESSAGE START NERR LEVEL COUNT
SLATEC DGAMMA ANSWER LT HALF PRECI 1 1 1

error: lgamma: exception encountered in Fortran subroutine dlgams_
error: called from
beta at line 60 column 10

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

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 jwe (Posted a comment)
  • -unavailable- added by dasergatskov (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by nir_krakauer (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

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

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 04 May 2017 01:06:14 AM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 03 May 2017 02:31:57 PM UTCjweStatusConfirmed=>Ready For Test
    Tue 02 May 2017 09:57:43 PM UTCrik5StatusNone=>Confirmed
      SummaryBeta function throws FORTRAN errors=>Beta function throws FORTRAN errors (Windows only)

    Back to the top


    Powered by Savane 3.1-cleanup1