Accuracy of Integral with epsilon
10-09-2021, 08:37 PM
Post: #18
 robve Member Posts: 287 Joined: Sep 2020
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...
 « Next Oldest | Next Newest »

 Messages In This Thread Accuracy of Integral with epsilon - lrdheat - 10-08-2021, 09:57 PM RE: Accuracy of Integral with epsilon - toml_12953 - 10-08-2021, 10:17 PM RE: Accuracy of Integral with epsilon - Thomas Okken - 10-08-2021, 10:18 PM RE: Accuracy of Integral with epsilon - toml_12953 - 10-08-2021, 10:28 PM RE: Accuracy of Integral with epsilon - lrdheat - 10-08-2021, 11:28 PM RE: Accuracy of Integral with epsilon - toml_12953 - 10-09-2021, 12:47 AM RE: Accuracy of Integral with epsilon - robve - 10-09-2021, 01:41 AM RE: Accuracy of Integral with epsilon - Valentin Albillo - 10-09-2021, 02:22 AM RE: Accuracy of Integral with epsilon - Paul Dale - 10-09-2021, 02:27 AM RE: Accuracy of Integral with epsilon - Thomas Okken - 10-09-2021, 08:47 AM RE: Accuracy of Integral with epsilon - John Keith - 10-09-2021, 05:40 PM RE: Accuracy of Integral with epsilon - robve - 10-09-2021 08:37 PM RE: Accuracy of Integral with epsilon - Claudio L. - 10-12-2021, 04:47 PM RE: Accuracy of Integral with epsilon - robve - 10-14-2021, 02:43 AM RE: Accuracy of Integral with epsilon - robve - 10-09-2021, 09:50 PM RE: Accuracy of Integral with epsilon - Albert Chan - 10-10-2021, 11:51 AM RE: Accuracy of Integral with epsilon - robve - 10-10-2021, 02:07 PM RE: Accuracy of Integral with epsilon - robve - 10-09-2021, 02:01 PM RE: Accuracy of Integral with epsilon - lrdheat - 10-09-2021, 03:13 AM RE: Accuracy of Integral with epsilon - toml_12953 - 10-09-2021, 05:44 AM RE: Accuracy of Integral with epsilon - toml_12953 - 10-09-2021, 11:26 AM RE: Accuracy of Integral with epsilon - lrdheat - 10-09-2021, 05:16 AM RE: Accuracy of Integral with epsilon - lrdheat - 10-09-2021, 03:25 PM

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