(PC-12xx~14xx) qthsh Tanh-Sinh quadrature
|
04-12-2021, 01:50 PM
Post: #50
|
|||
|
|||
RE: (PC-12xx~14xx) qthsh Tanh-Sinh quadrature
(04-12-2021 12:20 PM)Albert Chan Wrote: And, accuracy affect both edges, not just the "zero" side. An example, with both edge goes to +∞ >>> Q = require 'quad' >>> f = function(x) return 1/sqrt(1-x*x) end lua> Q.qthsh(Q.count(f), -1, 1), Q.n 3.141592644894014 59 lua> Q.quad(Q.count(f), -1, 1), Q.n 3.1415926047697873 115 This is not due to default 0.0 vs previous point. The function has sharp edges. With x in (-1,1), f(x) never returned inf. With IEEE double, this is the highest it goes: lua> f(1 - 0x1p-53) 67108864 There is no zero edge here, and midpoint of (-1,1) is exactly 0. Interpolate from the edges, qthsh use more accurate points. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)