~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to Lib/special/cdflib/bcorr.f

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T. Chen (new)
  • Date: 2005-03-16 02:15:29 UTC
  • Revision ID: james.westby@ubuntu.com-20050316021529-xrjlowsejs0cijig
Tags: upstream-0.3.2
ImportĀ upstreamĀ versionĀ 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      DOUBLE PRECISION FUNCTION bcorr(a0,b0)
 
2
C-----------------------------------------------------------------------
 
3
C
 
4
C     EVALUATION OF  DEL(A0) + DEL(B0) - DEL(A0 + B0)  WHERE
 
5
C     LN(GAMMA(A)) = (A - 0.5)*LN(A) - A + 0.5*LN(2*PI) + DEL(A).
 
6
C     IT IS ASSUMED THAT A0 .GE. 8 AND B0 .GE. 8.
 
7
C
 
8
C-----------------------------------------------------------------------
 
9
C     .. Scalar Arguments ..
 
10
      DOUBLE PRECISION a0,b0
 
11
C     ..
 
12
C     .. Local Scalars ..
 
13
      DOUBLE PRECISION a,b,c,c0,c1,c2,c3,c4,c5,h,s11,s3,s5,s7,s9,t,w,x,
 
14
     +                 x2
 
15
C     ..
 
16
C     .. Intrinsic Functions ..
 
17
      INTRINSIC dmax1,dmin1
 
18
C     ..
 
19
C     .. Data statements ..
 
20
      DATA c0/.833333333333333D-01/,c1/-.277777777760991D-02/,
 
21
     +     c2/.793650666825390D-03/,c3/-.595202931351870D-03/,
 
22
     +     c4/.837308034031215D-03/,c5/-.165322962780713D-02/
 
23
C     ..
 
24
C     .. Executable Statements ..
 
25
C------------------------
 
26
      a = dmin1(a0,b0)
 
27
      b = dmax1(a0,b0)
 
28
C
 
29
      h = a/b
 
30
      c = h/ (1.0D0+h)
 
31
      x = 1.0D0/ (1.0D0+h)
 
32
      x2 = x*x
 
33
C
 
34
C                SET SN = (1 - X**N)/(1 - X)
 
35
C
 
36
      s3 = 1.0D0 + (x+x2)
 
37
      s5 = 1.0D0 + (x+x2*s3)
 
38
      s7 = 1.0D0 + (x+x2*s5)
 
39
      s9 = 1.0D0 + (x+x2*s7)
 
40
      s11 = 1.0D0 + (x+x2*s9)
 
41
C
 
42
C                SET W = DEL(B) - DEL(A + B)
 
43
C
 
44
      t = (1.0D0/b)**2
 
45
      w = ((((c5*s11*t+c4*s9)*t+c3*s7)*t+c2*s5)*t+c1*s3)*t + c0
 
46
      w = w* (c/b)
 
47
C
 
48
C                   COMPUTE  DEL(A) + W
 
49
C
 
50
      t = (1.0D0/a)**2
 
51
      bcorr = (((((c5*t+c4)*t+c3)*t+c2)*t+c1)*t+c0)/a + w
 
52
      RETURN
 
53
 
 
54
      END