This numerical integration method is a closed Newton-Cotes formula; for each integral slice, Simpson's rule samples each endpoint and the midpoint and combines them into an area estimate for this slice using the following formula:
Loading...Given a window of Loading... and a "step size" of Loading.... The point Loading... is the point Loading... steps into the window.
There are a few simpler ways to understand this:
Simpson's rule is simply the trapezoid method (see trapezoid.cljc
), subject to a single refinement of "Richardson extrapolation".
The trapezoid method fits a line to each integration slice. Simpson's rule fits a quadratic to each slice.
Simpson's rule Loading... is the weighted average of the Midpoint rule Loading... and the trapezoid rule Loading...:
The test namespace contains a symbolic proof that the Richardson-extrapolated Trapezoid method is equivalent to using the formula above to calculate Simpson's rule directly.