File: ferfc.f

package info (click to toggle)
yorick 1.5.08-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,508 kB
  • ctags: 7,937
  • sloc: ansic: 75,604; cpp: 1,282; lisp: 1,217; sh: 1,026; makefile: 616; fortran: 19
file content (19 lines) | stat: -rw-r--r-- 540 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
      subroutine ferfc(y, x, n)
      integer n, i
      double precision y(n), x(n), xx, t, z, p
      do i= 1, n
         xx= x(i)
         z= abs(xx)
         t= 1.0/(1.0+0.5*z)
         p= -1.26551223 +
     &      t*(1.00002368 + t*(0.37409196 + t*(0.09678418 +
     &      t*(-0.18628806 + t*(0.27886807 + t*(-1.13520398 +
     &      t*(1.48851587 + t*(-0.82215223 + t*0.17087277))))))))
         p= t*exp(-z*z + p)
         if (xx .lt. 0.) then
            p= 2.-p
         endif
         y(i)= p
      enddo
      return
      end