Post Reply 
(PC-12xx~14xx) qthsh Tanh-Sinh quadrature
04-01-2021, 04:27 PM (This post was last modified: 04-02-2021 12:30 AM by robve.)
Post: #7
RE: (PC-12xx~14xx) qthsh Tanh-Sinh quadrature
If anyone is interested, I uploaded a draft article here that observes and addresses the following issues in existing (said to be "the best") implementation of Tanh-Sinh:
- fix division by zero in e=fabs(v/s-1), which is not safe to execute, e.g. integrating f(x)=x-.5 causes floating point exception;
- fix underflow in the inner loop condition fabs(q)>fabs(p*eps), e.g. integrating f(x)=sin(pi*x*40) evaluates too many (315) points (versus 15);
- by comparison, Python mpmath Tanh-Sinh implementation's error estimation is not as reliable as can be;
- performance improvements to speed up qthsh Tanh-Sinh in C and BASIC, runs at least 10% faster on a pocket computer;
- permit ±inf singularities close to one or both of the endpoints.

This is work in progress and things may change, e.g. the number of functions tested so far is limited to 21 but those reveal some interesting pro/cons successes and failures of the method.

I hope this is useful to anyone. Any suggestions and comments are much appreciated.

- 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-01-2021 04:27 PM



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