~ubuntu-branches/ubuntu/oneiric/python-scipy/oneiric-proposed

« back to all changes in this revision

Viewing changes to scipy/interpolate/fitpack/fpcsin.f

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine fpcsin(a,b,par,sia,coa,sib,cob,ress,resc)
 
2
c  fpcsin calculates the integrals ress=integral((b-x)**3*sin(par*x))
 
3
c  and resc=integral((b-x)**3*cos(par*x)) over the interval (a,b),
 
4
c  given sia=sin(par*a),coa=cos(par*a),sib=sin(par*b) and cob=cos(par*b)
 
5
c  ..
 
6
c  ..scalar arguments..
 
7
      real*8 a,b,par,sia,coa,sib,cob,ress,resc
 
8
c  ..local scalars..
 
9
      integer i,j
 
10
      real*8 ab,ab4,ai,alfa,beta,b2,b4,eps,fac,f1,f2,one,quart,six,
 
11
     * three,two
 
12
c  ..function references..
 
13
      real*8 abs
 
14
c  ..
 
15
      one = 0.1e+01
 
16
      two = 0.2e+01
 
17
      three = 0.3e+01
 
18
      six = 0.6e+01
 
19
      quart = 0.25e+0
 
20
      eps = 0.1e-09
 
21
      ab = b-a
 
22
      ab4 = ab**4
 
23
      alfa = ab*par
 
24
c the way of calculating the integrals ress and resc depends on
 
25
c the value of alfa = (b-a)*par.
 
26
      if(abs(alfa).le.one) go to 100
 
27
c integration by parts.
 
28
      beta = one/alfa
 
29
      b2 = beta**2
 
30
      b4 = six*b2**2
 
31
      f1 = three*b2*(one-two*b2)
 
32
      f2 = beta*(one-six*b2)
 
33
      ress = ab4*(coa*f2+sia*f1+sib*b4)
 
34
      resc = ab4*(coa*f1-sia*f2+cob*b4)
 
35
      go to 400
 
36
c ress and resc are found by evaluating a series expansion.
 
37
 100  fac = quart
 
38
      f1 = fac
 
39
      f2 = 0.
 
40
      i = 4
 
41
      do 200 j=1,5
 
42
        i = i+1
 
43
        ai = i
 
44
        fac = fac*alfa/ai
 
45
        f2 = f2+fac
 
46
        if(abs(fac).le.eps) go to 300
 
47
        i = i+1
 
48
        ai = i
 
49
        fac = -fac*alfa/ai
 
50
        f1 = f1+fac
 
51
        if(abs(fac).le.eps) go to 300
 
52
 200  continue
 
53
 300  ress = ab4*(coa*f2+sia*f1)
 
54
      resc = ab4*(coa*f1-sia*f2)
 
55
 400  return
 
56
      end