~ubuntu-branches/ubuntu/saucy/python-scipy/saucy

« back to all changes in this revision

Viewing changes to scipy/special/cdflib/rexp.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
      DOUBLE PRECISION FUNCTION rexp(x)
 
2
C-----------------------------------------------------------------------
 
3
C            EVALUATION OF THE FUNCTION EXP(X) - 1
 
4
C-----------------------------------------------------------------------
 
5
C     .. Scalar Arguments ..
 
6
      DOUBLE PRECISION x
 
7
C     ..
 
8
C     .. Local Scalars ..
 
9
      DOUBLE PRECISION p1,p2,q1,q2,q3,q4,w
 
10
C     ..
 
11
C     .. Intrinsic Functions ..
 
12
      INTRINSIC abs,exp
 
13
C     ..
 
14
C     .. Data statements ..
 
15
      DATA p1/.914041914819518D-09/,p2/.238082361044469D-01/,
 
16
     +     q1/-.499999999085958D+00/,q2/.107141568980644D+00/,
 
17
     +     q3/-.119041179760821D-01/,q4/.595130811860248D-03/
 
18
C     ..
 
19
C     .. Executable Statements ..
 
20
C-----------------------
 
21
      IF (abs(x).GT.0.15D0) GO TO 10
 
22
      rexp = x* (((p2*x+p1)*x+1.0D0)/ ((((q4*x+q3)*x+q2)*x+q1)*x+1.0D0))
 
23
      RETURN
 
24
C
 
25
   10 w = exp(x)
 
26
      IF (x.GT.0.0D0) GO TO 20
 
27
      rexp = (w-0.5D0) - 0.5D0
 
28
      RETURN
 
29
 
 
30
   20 rexp = w* (0.5D0+ (0.5D0-1.0D0/w))
 
31
      RETURN
 
32
 
 
33
      END