Contents
ALGORITHMS
Site map
Links
Site and author
News
About the site
FAQ
Contact
TERMS OF USE
Contents - Numerical integration - Simpson's method

Simpson's method

The value of an integral

is calculated using the Simpson method. An interval [a,b] is divided into n=2m parts x=a, x=a+h, ..., x=b with step h=(b-a)/n. The values y = F(x) in points x are calculated and then the integral value is calculated using the Simpson formula:

S = S+R,

where

The number of points of the division is doubled and an accuracy estimation is performed:

R = |S2n -S|/15

If R > e, the number of points of the division is doubled. The value of the sum 2(y+y+...+y2m-1 ) isn't changed, therefore it is required to calculate the values y only in the new points.

Report a bug

Source codes

C#

C# 1.0 source.
simpsonq.csharp.zip - Simpson's method


C++

C++ source.
simpsonq.cpp.zip - Simpson's method
ablas.zip - optimized basic linear algebra subroutines with SSE2 support (for C++ sources only)


Delphi

Delphi source.
Can be compiled under FPC (in Delphi compatibility mode).
simpsonq.delphi.zip - Simpson's method


Visual Basic 6

Visual Basic 6 source.
simpsonq.vb6.zip - Simpson's method


Zonnon beta

Zonnon source.
Zonnon is an experimental language developed at ETH Zurich.
See www.zonnon.ethz.ch for more information.
simpsonq.zonnon.zip - Simpson's method



 
 
Sergey Bochkanov, Vladimir Bystritsky
Copyright © 1999-2008