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

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

[Octave-bug-tracker] [bug #62412] integral gives consistent inaccurate r


From: Rik
Subject: [Octave-bug-tracker] [bug #62412] integral gives consistent inaccurate result for improper integral to inf
Date: Wed, 4 May 2022 11:38:26 -0400 (EDT)

Follow-up Comment #3, bug #62412 (project octave):

This is always the case with numerical computing, as opposed to pure math. 
You need to check assumptions and verify that the algorithm has worked as
expected.  In this case, there are additional outputs from quadcc which give a
bound on the absolute error as well as the number of points used for
evaluation.  When I call the function requesting this information I get


[q, err, num_pts] = quadcc (f, 1, Inf)
q = -9.7842
err = 2.2304
num_pts = 3101


The absolute error of +/- 2.23 indicates that the algorithm essentially failed
since the default absolute tolerance is 1e-10.

I would note that quadgk also has an ERR output.  It might be useful to have
integral.m compare this output with output q and issue a warning if they are
too divergent.

Another possibility is to have integral also map some integrands to quad.  I
don't believe quad can handle complex integrands, but it can handle infinite
endpoints.  I did some benchmarking and I don't see much difference between
quad and quadcc as they are both compiled functions (the first in Fortran and
the second in C++).


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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