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)
7
real*8 a,b,par,sia,coa,sib,cob,ress,resc
10
real*8 ab,ab4,ai,alfa,beta,b2,b4,eps,fac,f1,f2,one,quart,six,
12
c ..function references..
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.
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)
36
c ress and resc are found by evaluating a series expansion.
46
if(abs(fac).le.eps) go to 300
51
if(abs(fac).le.eps) go to 300
53
300 ress = ab4*(coa*f2+sia*f1)
54
resc = ab4*(coa*f1-sia*f2)