(PC-12xx~14xx) qthsh Tanh-Sinh quadrature
|
04-08-2021, 06:17 PM
Post: #41
|
|||
|
|||
RE: (PC-12xx~14xx) qthsh Tanh-Sinh quadrature
(04-08-2021 04:27 PM)Albert Chan Wrote:(04-08-2021 01:32 PM)robve Wrote: Using exp(t) in the inner loop instead of the strength-reduced expt recurrence should be the most accurate. Try it. That's really nice. I was stating this more in "theory" that it would be most accurate, but practically makes no difference, which is really nice. On the SHARP Pocket Computers it makes a difference only because variables hold 10 digits whereas expressions are evaluated with 12 digit precision. So using EXP is a tiny bit better than repeated multiplication with a variable, e.g. we get the integral 2.0 exactly instead of 1.999999998. (04-08-2021 04:27 PM)Albert Chan Wrote: Same conclusion when I compared strength-reduced exp vs supposed more accurate expm1. I didn't think about it that way. That is a nice way to confirm. I would also like to confirm that removing if (r == 0 || r == 1) break; makes no difference with all integrals tested. Logically the loop terminates before these conditions are met. This check is redundant and can be removed as you observed correctly. One thing I am still curious about is reusing or setting fp and fm to zero. I will look into the decaying factor idea. 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, but reusing in that case makes sense, I think. But I may be wrong if it makes no difference. I just don't know yet. - 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... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)