next up previous contents
Next: Application to atoms Up: Integration Routines Previous: Trapezoidal Rule

Simpson's Rule

 

In either Fortran or C, write a function subroutine of the form

C:        float simpint(float f[],float r[],float dr[],int N)

Fortran:  real function simpint(f,r,dr,N)
          integer N
          real f(N),r(N),dr(N)
which returns the result of Simpson's rule for the same integral

displaymath151

using the same inputs as your routine in (1.1).



Tomas Arias
Tue Feb 8 13:35:07 EST 2000