Re: Gaussian Quadrature Message #11 Posted by Les Wright on 11 Dec 2006, 9:19 p.m., in response to message #5 by Chuck
Thanks for educating me about the TI83's routine.
I have long been interested in the error function, and it so happens that erfc(x) is equal to the function 1/Sqrt[-Pi*Log[t]] integrated from 0 to Exp[-x^2]. (I think, actually, that the 15C Advanced manual discusses this very transformation of the more familiar erfc(x) integral, the function 2/Sqrt[Pi]*Exp[-t^2] integrated from x to Infinity.)
Anyway, as x gets smaller, the bigger the area of integration gets and the longer quadrature on the integral takes. The singularity at the left end of the domain of integration makes life colourful too.
Using the Advantage Pac INTEG or the HP15C to compute erfc(2) using this integral really inspires a bit of a workout--my calcs seem to chug along a goodly couple of minutes to give 5 or 6 digits. The HP33S is a bit faster, and the 48G and 49G+ are faster still, but asking for more than 5 or 6 digits really drags things out to several minutes at least. Likewise with the 42S, though if you only want 4 or 5 digits it seems fast indeed.
The TI83's fnInt function is a whole different ball of wax. By adjusting the tolerance parameter, I can get anywhere from 4 digits almost instantly to 13 digits within 1 ULP (confirmed by digit shifting to see the extra digits) in less than a minute.
A few months ago I denigrated the TI83 as an ostensibly cheaply made piece of junk that looked, felt, and acted like the adolescent market it is pitched at. Well, this little area of strength really heightened my respect for the gizmo. I am even getting used to the algebraic operating system and the on-screen editing, so that when I revert to an HP I get confused!
I believe the TI83 fared poorly in Valentin's integration challenge of the summer, but then again so did a lot of the HPs. It had to do with how the problem was framed in many cases (e.g. the oscillatory nature of sin(x)*sin(x^2) dooms typical quadrature to ignominious failure, since the sampled absicissas miss so much information due to the oscillations and the interpolative nature of of classical quadrature approaches is mismatched).
I am familiar with the basics of Gauss-Legendre quadrature, but right now I am dying to know how Valentin computes the weights and sample points for a given arbitrary N.
Les
Edited: 11 Dec 2006, 9:19 p.m.
|