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

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

[Octave-bug-tracker] [bug #60539] Slow performance of betaincinv.m


From: Michael Leitner
Subject: [Octave-bug-tracker] [bug #60539] Slow performance of betaincinv.m
Date: Fri, 28 May 2021 05:55:13 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #17, bug #60539 (project octave):

I reported the problem with betainc as bug #60682.

You did understand correctly what I had written, but I was in error. The case
with lost accuracy would have been for alpha=1/4, but in this case I see that
the initial value is so good that it does not need to iterate at all (so after
the first step it has converged, no matter what the stopping criterion).
However, where your stopping criterion is unnecessarily inaccurate is just for
small y: with alpha=2 and beta=1, betainc is just x^2, so betaincinv is just
sqrt(y). My stopping criteria, both the original one as well as the one I
suggested in comment #15 and attach here as newbeta2.m give the correct result
1e-20 for x=1e-40, while your implementation gives 2.22e-16. Yes, on an
absolute level this is correct to eps(1) (it practically is eps(1)), but on a
relative level it is inaccurate by a factor 10000. 


y=1e-40;



(file #51491)
    _______________________________________________________

Additional Item Attachment:

File name: newbeta2.m                     Size:9 KB
    <https://file.savannah.gnu.org/file/newbeta2.m?file_id=51491>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60539>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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