next up previous index
Next: D102 Adaptive Gaussian Up: CERNLIB Previous: C349 Jacobian Theta

D101 Integration by Simpson's Rule

Routine ID: D101
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 15.01.1988
Language: FortranRevised: 15.03.1993

Function subprograms SIMPS and DSIMPS use Simpson's rule to compute an approximate value of the integral

I = ∫ABf(x)dx.

On CDC or Cray computers, the double-precision version DSIMPS is not available.

Structure:

FUNCTION subprograms
User Entry Names: SIMPS, DSIMPS
Files Referenced: Unit 6
External References: MTLMTR (N002), ABEND (Z035)

Usage:

In any arithmetic expression, SIMPS(F,A,B,N) or DSIMPS(F,A,B,N)

has the approximate value of the integral I, where SIMPS is of type REAL and DSIMPS is of type DOUBLE PRECISION, and F, A, B have the same type as the function name. N is of type INTEGER.

F
One-dimensional array with dimension (0:d), where d ≥N , containing the value of f(x) at N+1

equally-spaced points xi, (i=0,1,...,N) , with x0= A and xN= B .

A,B
End-points of integration interval.
N
As defined above. N must be positive and even.

Error handling:

Error D101.1: N ≤0 or N odd. The function value is set equal to zero, and a message is written on Unit 6, unless subroutine MTLSET (N002) has been called.

D102


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995