Post Reply 
(PC-12xx~14xx) qthsh Tanh-Sinh quadrature
04-20-2021, 07:25 PM
Post: #69
RE: (PC-12xx~14xx) qthsh Tanh-Sinh quadrature
(04-20-2021 01:58 PM)Albert Chan Wrote:  
(04-20-2021 02:19 AM)robve Wrote:  I have not found a single counter example yet that does not work with the predictor.
...
If the diff is zero, we are at a reasonably good or optimal r to adjust d. This can happen very early
for example 1/(1+(x*x)) and log((1+(x*x))/x)/(1+(x*x)) ...
Is these two already counter-examples ?
...
But, with rounding errors, if lucky, we expected sign changes early on.

I mentioned before that for cases like these the diff h is already zero, or very close to zero. If a sign change happens in that case it is noise/roundoff and should be ignored (as is done in the updated code). These "bad" integrands are easy to filter out without deteriorating the predictions for "good" integrands. Note that the diff h behavior has no peak/cliff with these. A relevant sign change is preceded by some (significant) curve with a peak, that cannot be produced by rounding error noise.

Maybe I will be forced to eat my words later if there are many "bad" cases. But so far the hundreds of examples tested don't appear to suggest there is a fundamental problem with this approach, just minor details.

Honestly, it is not too difficult to create some problematic "bad" cases that are based on periodic/oscillating functions over [0,∞) for which the diff h has a useless sign change more than once. Take \( \sin(40\pi x)/x^2 \) for example. But doing that is a bit "cheating", because these quadrature methods are known to perform poorly with such type of functions anyway (so it does not matter). IMHO it is more interesting to have a preprocessor to adjust d that works well for the Exp-Sinh integrands that we expect to work well with this quadrature. This should exclude "bad" integrands for which a good value of d cannot be determined to begin with, i.e. Exp-Sinh convergence is always bad with a large residual error. Also,guessing a suboptimal d is not fatal for the "good" integrands.

There are several things that are intriguing to look into:
- For large estimated d values the predicted d tends to overshoot the optimum non-linearly for large d in the 1000s. I tried a correction method with interpolation, but the results were mixed. My hunch is that the peak+cliff location should be taken into account somehow to adjust for large d (likewise, adjust for tiny d=1/r).
- Another way to address this sub-optimality problem for large d is to use a recursive scheme to improve d. We can try a sequence of four values, say r=2,10,100,10000 to detect very roughly where a sign change occurs, then adjust d and try again with some smaller points (say powers of 2) and again with a few points of smaller powers, etc.
- The predictor should quit early when d cannot be adjusted (no sign change) by testing the sequence begin/end points first e.g. r=2 and r=10000, to limit this overhead. Checking 1<r<2 is not useful. It only moves d upwards by a fraction which does not help much to improve convergence (downwards by a fraction is done with larger r, i.e. d = d/r).
- A solid theoretical analysis of this method is needed to better understand how robust it is.
- Can this test be used to quickly determine if an integrand is bad for Exp-Sinh to begin with?

- 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: (PC-12xx~14xx) qthsh Tanh-Sinh quadrature - robve - 04-20-2021 07:25 PM



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