bugGNU Octave - Bugs: bug #36364, DERF.F: Inaccurate results for...

 
 

bug #36364: DERF.F: Inaccurate results for very small values of x

Submitted by:  None
Submitted on:  Tue 01 May 2012 11:32:30 PM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: FixedAssigned to: None
Originator Name: jofrietOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.1
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 14 Jun 2012 03:37:53 PM UTC, comment #5:

SLATEC is a great resource, but completely unsupported. Special functions, like erf(), are available from the Netlib repository either in netlib.org/slatec/fnlib or in netlib.org/fn. I found the following comment at http://www.netlib.org/slatec.

Clearly there is a lot of confusion.

To resolve this I am just going to patch Octave's Fortran source to be correct and not attempt to resolve the upstream repository issues. The fix was done in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/d213da1a16a6).

Rik <rik5>
Project Administrator
Wed 13 Jun 2012 07:42:11 PM UTC, comment #4:

I have confirmed this issue. The Fortran code from SLATEC is in error. The reason it has rarely been a problem is that Octave usually links in the erf() function from the C math library. It is only when that version is unavailable that we switch over to the Fortran version that Octave ships in libcruft. This does occasionally happen as has been reported on the MinGW platform in reference to a different bug. I will take this up on the Octave mailing list soon for the best way to implement a fix.

Rik <rik5>
Project Administrator
Fri 18 May 2012 05:15:15 PM UTC, comment #3:

The issue seems problematic in the same way that updating the ARPACK library to tackle a problem revealed in svds was problematic. According to Wikipedia (http://en.wikipedia.org/wiki/SLATEC), SLATEC was published in 1993 and is probably orphaned in that there isn't a bug tracker or anyone maintaining it. We could update the Fortran code in our repository, but maybe it is better to reach out to the rest of the numerical analysis community and see if there isn't a maintained SLATEC available or maybe we want to set up such a beast as was done for ng-arpack.

Rik <rik5>
Project Administrator
Wed 09 May 2012 04:01:32 AM UTC, comment #2:

(reposting the suggested fix, formatted for the bug tracker)

In the file DERF.F, part of libcruft, the line:

should be:

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Wed 09 May 2012 03:56:56 AM UTC, comment #1:
Rik <rik5>
Project Administrator
Tue 01 May 2012 11:32:30 PM UTC, original submission:

In the file DERF.F, part of libcruft, the line:

IF (Y.LE.SQEPS) DERF = 2.0D0XX/SQRTPI

should be:

IF (Y.LE.SQEPS) DERF = 2.0D0*X/SQRTPI

Note that this should be immediately obvious from the definition of the error function (http://en.wikipedia.org/wiki/Error_function) and from the wrong sign for small negative values of x. The bug is present in the SLATEC version of FNLIB, but not in FN: see http://www.netlib.org/slatec/fnlib/derf.f and http://www.netlib.org/fn/derf.f.

The function erf in octave itself seems to function fine though.

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 jordigh (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by melrobin
  •  

    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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 14 Jun 2012 03:37:53 PM UTCrik5StatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 13 Jun 2012 07:42:11 PM UTCrik5StatusNone=>Confirmed
    Wed 02 May 2012 04:31:08 AM UTCmelrobinCarbon-Copy-=>Added melrobin

    Back to the top


    Powered by Savane 3.1-cleanup1