Post Reply 
(PC-12xx~14xx) qthsh Tanh-Sinh quadrature
04-09-2021, 02:54 AM
Post: #44
RE: (PC-12xx~14xx) qthsh Tanh-Sinh quadrature
(04-08-2021 10:43 PM)Albert Chan Wrote:  
(04-08-2021 06:17 PM)robve Wrote:  Perhaps there is also a difference between Inf and NaN, because with
Inf the limit is clearly not finite and with NaN we don't necessarily know.

Unless formula is very simple, there is not enough information to claim returning inf implied infinite true result.

Cas> f(u) := atanh(u*u*(3-2*u)) * 6*u*(1-u)
Cas> u = 1 - 10^-9
Cas> f(float(u))       → ∞
Cas> float(f(u))       → 1.23123199576e-07

The function is a black box and we cannot trust ill-conditioned functions. With NaN and Inf we don't know what the cause is. Tracing the points toward an endpoint may be suggestive of the "missing" values by extrapolation (reusing the previous point). However, a small change in the bounds can make a huge difference in the result and cause Inf or NaN.

For example, 1/(1+cos(x)^x) integrated on [-pi/2,pi/2] is OK but produces NaN with the inexact bounds [-1.570796327,1.570796327] see the spreadsheet row 64. Earlier I mentioned that fp and fm reuse appears to be better than zero for this function and for two other functions. But there is more noise than signal to use these examples as sufficient evidence to make a determination. I can't tell yet if a decay approach can help to control singularities at an endpoint. It may be moot attempt. If so, there is not much left that remains to do for further improvements of Tanh-Sinh.

- 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-09-2021 02:54 AM



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