home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / fortran / 4310 < prev    next >
Encoding:
Text File  |  1992-11-13  |  2.1 KB  |  63 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!usc!sdd.hp.com!caen!batcomputer!ghost.dsi.unimi.it!univ-lyon1.fr!chx400!news.unige.ch!scsun.unige.ch!pfennige
  3. From: pfennige@scsun.unige.ch (PFENNIGER Daniel)
  4. Subject: Re: ALGAMA function, optimization question
  5. Message-ID: <1992Nov13.081750.29014@news.unige.ch>
  6. Sender: usenet@news.unige.ch
  7. Organization: University of Geneva, Switzerland
  8. References: <1992Nov11.043558.12534@wam.umd.edu> <92317.150302HDK@psuvm.psu.edu>
  9. Date: Fri, 13 Nov 1992 08:17:50 GMT
  10. Lines: 51
  11.  
  12. In article <92317.150302HDK@psuvm.psu.edu>, H. D. Knoble <HDK@psuvm.psu.edu>
  13. sends subroutines about the DGAMMA/DLOGAM functions.
  14.  
  15. The DLGM function reads:
  16.  
  17. >       DOUBLE PRECISION FUNCTION DLGM(W)
  18. > C===Companion function for DGAMMA and DLOGAM.
  19. >       DOUBLE PRECISION C(20), W,W2,PRESUM,CONST,DEN,SUM
  20. >       INTEGER I
  21. >       C(1)=1.D0/12.D0
  22. >       C(2)=-1.D0/360.D0
  23. >       C(3)=1.D0/1260.D0
  24. >       C(4)=-1.D0/1680.D0
  25. >       C(5)=1.D0/1188.D0
  26. >       C(6)=-691.D0/360360.D0
  27. >       C(7)=1.D0/156.D0
  28. >       C(8)=-3617.D0/122400.D0
  29. >       C(9)=43867.D0/244188.D0
  30. >       C(10)=-174611.D0/125400.D0
  31. >       C(11)=77683.D0/5796.D0
  32. >       C(12)=-236364091.D0/1506960.D0
  33. >       C(13)=657931.D0/300.D0
  34. >       C(14)=-3392780147.D0/93960.D0
  35. >       C(15)=1723168255201.D0/2492028.D0
  36. >       C(16)=-7709321041217.D0/505920.D0
  37. >       C(17)=1516286977551.D0/396.D0
  38. >       C(18)=-26315271553053477373.D0/2418179400.D0
  39. >       C(19)=1542102059911661.D0/444.D0
  40. >       C(20)=-261082718496449122051.D0/21106800.D0
  41. >       CONST=.91893853320467274178032973640561763986139747363778D0
  42. > C---CONST=DLOG(SQRT(2*PI))
  43. >       DEN=W
  44. >       W2=W*W
  45. >       PRESUM=(W-.5D0)*DLOG(W)-W+CONST
  46. >       DO 1 I=1,20
  47. >         SUM=PRESUM+C(I)/DEN
  48. >         IF(SUM.EQ.PRESUM) GOTO 2
  49. >         DEN=DEN*W2
  50. > 1     PRESUM=SUM
  51. > 2     DLGM=SUM
  52. >       RETURN
  53. >       END
  54.  
  55. My question to experts in optimization is: 
  56. What is the better way to initialize such an array C of constants
  57. 1) DATA statement
  58. 2) PARAMETER statement
  59. 3) the above example as an optimizing compiler anyway detects that 
  60.    C and CONST are constant. 
  61.  
  62.     Daniel Pfenniger
  63.