Post Reply 
Comments and discussion on Valentin's 4th "Then and Now" - Area
01-21-2023, 10:15 AM (This post was last modified: 01-21-2023 10:28 AM by J-F Garnier.)
Post: #13
RE: Comments and discussion on Valentin's 4th "Then and Now" - Area
I want to discuss here one aspect of the challenge, computing the integral:

(01-19-2023 05:08 PM)Valentin Albillo Wrote:  The integral for the big island, however, has two singularities, one at y = 0 (which doesn't cause any problems as this is the ymin extreme and the Width function being integrated is never evaluated there by INTEGRAL,) and another inside the range [ymin, ymax], which causes INTEGRAL to be at least 400% slower and even so it can only produce a value accurate to at most 7-8 digits, not 12.

[...] we can then split the single problematic integral into two parts, the singularities being now at the extremes of the ranges of integration where they do no harm, like this:
      [Image: SRC-12-5-17-ehllav.jpg]

My observations showed me that the singularities do harm actually, both in execution time and accuracy.

To illustrate the effect of the singularity at y=0, let's consider this simpler integral:
I=INTEGRAL(0,1,E,IVAR^(1/6))
that reproduces the behaviour of Valentin's integral near y=0.
The exact value of this integral is 6/7 = 0.857142857143

Here is what happens when trying to evaluate this integral with the 71B with increasing target accuracies:

>FOR N=6 to 12 @ I=INTEGRAL(0,1,10^(-N),IVAR^(1/6)) @ DISP N;I;IBOUND;ABS(I-6/7) @ NEXT N
 N   INTEGRAL       IBOUND           ERROR
 6 .857143021890 8.57147612555E-7  .000000164747
 7 .857142864063 8.57143170419E-8  .000000006920
 8 .857142858515 8.57142936872E-9  .000000001372
 9 .857142857195 8.57142862245E-10 .000000000052
10 .857142857151 8.57142858410E-11 .000000000008
11 .857142857127 8.57142857257E-12 .000000000016
12 .857142857127 -8.57142857257E-13 .000000000016


The accuracy is not improved beyond 1E-10, even if IBOUND seems to indicate better accuracy. At 1E-12, the negative IBOUND indicates that convergence is not detected within the limit of 32768 samples.

The same occurs with Free42 for this example, where the effective accuracy is limited to about 1E-14, far from the 34-digit limit of the arithmetic.

I solved the issue by splitting the main integral into 4 pieces in my solution.
In that way, it is possible to concentrate the samples in the regions that need them, and avoid wasting time with useless samples in the other regions.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Comments and discussion on Valentin's 4th "Then and Now" - Area - J-F Garnier - 01-21-2023 10:15 AM



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