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

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

[Octave-bug-tracker] [bug #51157] betainc.cc: Inaccurate double precisio


From: anonymous
Subject: [Octave-bug-tracker] [bug #51157] betainc.cc: Inaccurate double precision results
Date: Thu, 1 Jun 2017 08:59:32 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0

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

                 Summary: betainc.cc: Inaccurate double precision results
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Thu 01 Jun 2017 12:59:31 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Inaccurate Result
                  Status: None
             Assigned to: None
         Originator Name: Schinzilord
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.0
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Double precision results of function betainc seem to be incorrect.

The following example should not point out the incompatibility with Matlab,
but the inaccuracy of Octave implementation.
e.g. try the following:

betainc([0.00780;0.00782;0.00784],250.005,49750.995)

Octave's results are:

ans =
   1.000000000000000
   0.999999999998649
   1.000000000000000

while e.g. Matlab or Wolfram Alpha (CDF[BetaDistribution[250.005, 49750.995],
0.00780]) yields:

ans =
   0.999999999999989
   0.999999999999992
   0.999999999999995

To my opinion Octave function betainc.cc
http://octave.org/doxygen/4.0/dd/d3c/betainc_8cc_source.html
returns double precision, while the underlying 
Fortran77 code betai.f:
http://octave.org/doxygen/4.0/d1/dc2/betai_8f_source.html
returns single precision only (according to the source header).
Betainc.cc distinguishes between double and single precision.

All implemented tests performed on betainc.cc go to single precision only
(sqrt(eps) in asset function), even if declared as double precision tests.

The deviations have some real life consequences for e.g. Harrell-Davis
Estimator, which would return negative weights if no error handling is
performed.

Can you please comment on that?




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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