Sherlock, Ric wrote:
> While working on this Rosetta Code task:
> "http://rosettacode.org/wiki/Numerical_Integration";
> I came across the following question regarding the base library
> implementation of Simpson's Rule.

> I'm wondering whether the simpson conjunction in 'math/misc/integrat' is
> "correct" as is or whether it should be changed to include "steps=.
> +:steps" so that it gives the same answer as simpsonWK given the same
> inputs?
>

This depends as to whether you are specifying panes or subintervals. 
Rosetta Code uses n panes and 2n subintervals, simpsonBL and simpsonJR use
n subintervals and n%2 panes (so n necessarily has to be even).  You can
argue it either way.  Perhaps subintervals make the most sense when
comparing methods, since you then have the same number of functional
evaluations.

The Rosetta Code specification does not bring out the coefficients for
Simpson's rule particularly well: simpsonBL and simpsonJR do.  I have
written an explanation of where the coefficients come from at

http://www.jsoftware.com/jwiki/JohnRandall/Quadrature

Best wishes,

John



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to