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

« back to all changes in this revision

Viewing changes to Lib/interpolate/fitpack/fprati.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
      real*8 function fprati(p1,f1,p2,f2,p3,f3)
 
2
c  given three points (p1,f1),(p2,f2) and (p3,f3), function fprati
 
3
c  gives the value of p such that the rational interpolating function
 
4
c  of the form r(p) = (u*p+v)/(p+w) equals zero at p.
 
5
c  ..
 
6
c  ..scalar arguments..
 
7
      real*8 p1,f1,p2,f2,p3,f3
 
8
c  ..local scalars..
 
9
      real*8 h1,h2,h3,p
 
10
c  ..
 
11
      if(p3.gt.0.) go to 10
 
12
c  value of p in case p3 = infinity.
 
13
      p = (p1*(f1-f3)*f2-p2*(f2-f3)*f1)/((f1-f2)*f3)
 
14
      go to 20
 
15
c  value of p in case p3 ^= infinity.
 
16
  10  h1 = f1*(f2-f3)
 
17
      h2 = f2*(f3-f1)
 
18
      h3 = f3*(f1-f2)
 
19
      p = -(p1*p2*h3+p2*p3*h1+p3*p1*h2)/(p1*h1+p2*h2+p3*h3)
 
20
c  adjust the value of p1,f1,p3 and f3 such that f1 > 0 and f3 < 0.
 
21
  20  if(f2.lt.0.) go to 30
 
22
      p1 = p2
 
23
      f1 = f2
 
24
      go to 40
 
25
  30  p3 = p2
 
26
      f3 = f2
 
27
  40  fprati = p
 
28
      return
 
29
      end