Accuracy of Integral with epsilon

10142021, 02:43 AM
Post: #23




RE: Accuracy of Integral with epsilon
(10122021 04:47 PM)Claudio L. Wrote: So I guess the trick is as long as you don't ask the integration algorithm for an error smaller than the system precision less 9 digits, you'll be fine and get a nice result, with an error in the order of (precision9), regardless of the tolerance you requested. Catastrophic cancellation errors exponentially increase towards negative infinity for this integrand. I may be going off on a tangent in this thread, but what other sources are there for noise, besides cancellation and cosh/sinh/exp roundoff/differences? Can the integration method be noisy? I'd expect that to be insignificant. It may depend on the accuracy of the weight calculations. Simple weights pose no problem, e.g. Simpson, Romberg are exact for (low order) polynomials anyway. Weights derived from tablebased methods, such as GaussKronrod may collect small errors in the weight calculations. I was curious to test this with a simple constant function \( \int_{10}^{10} 2\,dx \) to integrate with eps=10^6 tolerance (or about, what works to get comparable results w.r.t. number of evaluation points):  GaussKronrod G10K21 with IEEE 754 doubles = 40.000000000000007.  WP34S TanhSinh C version with IEEE 754 double: 39.999999999987885 (23 points)  qthsh TanhSinh with IEEE 754 double: 40.000000000000057 (29 points)  Boost Math TanhSinh with IEEE 754 double: 40.000000000001464 (25 points) TanhSinh methods may suffer "weight issues" due to their point distributions. There are also numerical differences in the implementations. WP34S and qthsh use the more efficient MichalskiMosig quadrature method. Boost Math uses the standard TakahashiMori TanhSinh quadrature method. And there are other internal differences. WP34S computes the weights as follows (see forum thread): Code: double ch = cosh(t); Whereas qthsh computes the weights as follows: Code: double u = exp(1/tt); // = exp(2*sinh(j*h)) = 1/exp(sinh(j*h))^2 The noise here is still rather insignificant compared to cancellation and diminishes with smaller given tolerances toward 10^15 with more points evaluated by TanhSinh.  Rob "I can count on my friends"  HP 71B,PrimeTi VOY200,Nspire CXII CASCasio fxCG50...Sharp PCG850,E500,2500,1500,14xx,13xx,12xx... 

« Next Oldest  Next Newest »

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