Post Reply 
Accuracy of Integral with epsilon
10-09-2021, 08:37 PM
Post: #18
RE: Accuracy of Integral with epsilon
(10-09-2021 02:27 AM)Paul Dale Wrote:  
(10-09-2021 02:22 AM)Valentin Albillo Wrote:  Are you saying that a complex state-of-the-art Tanh-Sinh method requires 27 evaluations of the integrand (the constant 2) to integrate the constant 2 from -10 to 10 ? Really !?

It's neither complex nor state of the art.

How many function evaluations should be performed?

Clearly one evaluation is sufficient to get the correct answer here. Two might be prudent to verify that it is a constant function. Three perhaps?

There is never a guarantee that a given function is constant by probing a few points. That should be obvious, no?

Naive implementations of Gauss-Legendre quadrature methods may stop at two or three points to fit a constant (polynomial). However, it would be detrimental to give up that early. Evidently, calculators run quite a bit longer on this function for a good reason.

My point about Tanh-Sinh was simply that this method doesn't require a huge number of points to converge accurately and it is used in the WP 34S... so make your own conclusions. Tanh-Sinh simply works well for this type of function based on its syntactical structure (duh). More importantly, the function is NOT numerically constant in its present non-simplified form, which is to be expected: noise increases quickly towards -10 and beyond. This noise is already in the order of 10^-2 at x=-18. Tabulating the error in Excel from -10 to -8.9 gives:

-5.31248E-08
-6.01538E-08
-5.39791E-08
-1.77564E-08
-1.86315E-08
-1.64802E-08
-5.18465E-10
-8.54069E-09
-1.47008E-08
1.40072E-08
-6.26628E-09
-5.77673E-09

This amount of noise is sufficient to trip up quadrature methods. Of course, the noise may differ with non-IEEE 754 double precision and different implementations of the constituent functions EXP, SINH and COSH. However, a general consequence of the noise and floating point limitations, you can either get lucky to get to the exact result 40 with a few points or unlucky, which can cost you a great deal of time wasted to evaluate points in the presence of noise. The WP 34S and qthsh points reported show exactly what I mean. Also, attempting to push the accuracy beyond 10^8 (or about) is pointless. There is too much noise to make definitive conclusions.

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Accuracy of Integral with epsilon - robve - 10-09-2021 08:37 PM



User(s) browsing this thread: 1 Guest(s)