bugGNU Octave - Bugs: bug #54550, inaccurate result of gammainc


bug #54550: inaccurate result of gammainc

Submitted by:  None
Submitted on:  Wed 22 Aug 2018 07:50:39 AM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Fixed Assigned to:  None
Originator Name:  Michael Schmidt Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.4.0
Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

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


Tue 28 Aug 2018 12:25:30 AM UTC, comment #4: 

I pushed the final cset here https://hg.savannah.gnu.org/hgweb/octave/rev/b7e0ed1b2b32.  Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Mon 27 Aug 2018 06:51:27 AM UTC, comment #3: 

Actually, the modification done by Marco solves also another problem: now it gives

octave-default:1> gammainc(1000,2)
ans = 0

with the modification

octave-cli:1> gammainc(1000,2)
ans =  1

which is correct... I don't remember why I put a < 5 in the first place, I think it is actually a refuse from some test I did during GSoC...

I attach a modified version of the .diff of Marco, which add some tests for these values and fixes a comment.

(file #44874)

Michele Ginesi <m_ginesi>
Sun 26 Aug 2018 04:39:09 PM UTC, comment #2: 

Indeed, removing this condition solves the problem.
But, does it cause wrong answers for other arguments?

Avinoam Kalma <avinoam>
Project Member
Thu 23 Aug 2018 01:30:06 PM UTC, comment #1: 

I removed condition "| (a < 5)" from case 8.

(file #44834)

Marco Caliari <caliari>
Project Member
Wed 22 Aug 2018 07:50:39 AM UTC, original submission:  

With octave 4.4.0,  calling

c = (gammainc(77,2)-1)/eps;

delivers c = 31

wheras octave 4.2.1 (presumably correctly) delivers c = 0. For those arguments (x=77) and (a=2), a subfunction gammainc_s is called (case 8). If this call is suppressed (setting flag_s to 0 at line 205), the correct value is computed and the issue disappears.

This is not a fix but it indicates that the subfunction gammainc_s may have an issue or it is applied within a wrong region of arguments.



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

Attach Files:

Attached Files
file #44874:  gammainc.diff added by m_ginesi (2KiB - text/x-patch)
file #44834:  gammainc.diff added by caliari (2KiB - application/x-tex)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by m_ginesi (Updated the item)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by caliari (Updated the item)
  • -email is unavailable- added by None (Submitted the item)

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

    Only project members can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-08-28 rik5 StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2018-08-27 m_ginesi Attached File- => Added gammainc.diff, #44874
    2018-08-23 caliari Attached File- => Added gammainc.diff, #44834
        StatusNone => Patch Submitted

    Back to the top

    Powered by Savane 3.5