Post Reply 
(PC-12xx~14xx) qthsh Tanh-Sinh quadrature
04-29-2021, 07:33 PM
Post: #73
RE: (PC-12xx~14xx) qthsh Tanh-Sinh quadrature
(04-26-2021 03:08 PM)Albert Chan Wrote:  An improvement to previous post Q.peak().

Great! The overhead cost to evaluate the peak per integrand is low, only 3.4 on average for the 208 integrals Smile

The overall results with respect to reducing the number of Exp-Sinh evaluations needed per integrand for eps=1e-9:
91 improved by 65.9 fewer evaluations on average
91 are worse by 45.3 more evaluations on average

Funny the split in 91 and 91. Coincidence?

To compare, the current version of exp_sinh_opt_d for eps=1e-9 gives:
29 improved by 63.2 fewer evaluations on average
14 are worse by 11.3 more evaluations on average (almost all oscillatory cases that are known to be problematic for Exp-Sinh and are marked N/A)

I noticed that when a sign change is detected, peak() also does overall very well, except for one strange case that costs a lot more, 180 points more for log(1+9*(x*x))/(1+16*(x*x)) where d=10.9477 which for a small d<1 is better, meaning the movement of d is in the wrong direction? However, for the remaining 28 (or so) cases peak() can be closer to the optimum, simply because exp_sinh_opt_d() produces geometric values for d up to a large d=2^16 while peak() assumes the optimum is close to the given d (according to Albert). However, for exp_sinh_opt_d() we could refine d, e.g. with another step or with interpolation, which not done in the current exp_sinh_opt_d() version.

The tentative(!) results are in the attached PDF for exp_sinh_opt_d() (left) and peak() (right), with yellow rows indicating exp_sinh_opt_d() was applicable due to a sign change and orange rows also having a sign change but are marked N/A for bad ACCURACY because of large errors of the integration due to oscillatory functions etc. so these are not interesting to compare. The column ACCURACY shows IMPROVED if the abs.err is lower than the original unoptimized Exp-Sinh integral abs.err (not shown in the PDF). However, ACCURACY can be noisy because the abs.err is so small. The abs.err of the relevant cases is mostly better than the specified eps=1e-9 anyway, meaning we should be fine anyway:

.pdf  exp-sinh.pdf (Size: 127.29 KB / Downloads: 6)

I feel that progress has been made for both methods. However, when I have time, I plan to take a closer look at further improvements and directions to go with this.

Also, I assume something similar can be done for Sinh-Sinh to split the integral at a more optimal point in some cases.

Albert, you have the following "magic numbers" hardcoded without explanation:
while L/C > 2.353 do
while R/C > 0.425 do

Are these empirically established?

- Rob

"I count on old friends to remain rational"
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-29-2021 07:33 PM



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