File: watan.f

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (27 lines) | stat: -rw-r--r-- 785 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
      subroutine watan(xr,xi,yr,yi)
c!but
c     watan calcule l'arctangente d'un complexe
c!liste d'appel
c     subroutine watan(xr,xi,yr,yi)
c     double precision xr,xi,yr,yi
c
c     xr,xi : parties reelles et imaginaires du nombre
c     yr,yi : parties reelles et imaginaires du resultat
c             yr,yi peuvent avoir la meme implantation memoire que
c              xr et xi
c!sous programmes appeles
c     wdiv wlog (blas.extensions)
c!
c     y = atan(x) = (i/2)*log((i+x)/(i-x))
c     Copyright INRIA
      double precision xr,xi,yr,yi,tr,ti
      if(xi.ne.0.0d0) goto 20
      yr = atan2(xr,1.0d+0)
      yi = 0.0d+0
      return
   20 call wdiv(xr,1.0d+0+xi,-xr,1.0d+0-xi,tr,ti)
      call wlog(tr,ti,tr,ti)
      yr = -ti/2.0d+0
      yi = tr/2.0d+0
      return
      end