home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4789 < prev    next >
Encoding:
Text File  |  1992-12-17  |  2.9 KB  |  89 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!news.univie.ac.at!pm
  3. From: pm@cc.univie.ac.at (Peter Marksteiner)
  4. Subject: Re: Uglifier (was Re: Real Programmers)
  5. Message-ID: <1992Dec17.102911.8075@newssrv.edvz.univie.ac.at>
  6. Sender: news@newssrv.edvz.univie.ac.at (News System - Vienna University)
  7. Nntp-Posting-Host: katz.cc.univie.ac.at
  8. Organization: Vienna University Computer Center
  9. X-Newsreader: TIN [version 1.1 PL6]
  10. References: <1992Dec16.164347.21210@craycos.com>
  11. Date: Thu, 17 Dec 1992 10:29:11 GMT
  12. Lines: 75
  13.  
  14. Here's my favourite ugly program (uglified by hand, not by an automatic
  15. uglifier).
  16.  
  17.       IMPLICITDOUBLE PRECISION(A-H,O-Z)
  18. 173210 WRITE(6,76123)
  19.       READ(5,*,END=17213)X
  20.       OOO0=OOO0O(X)
  21.       WRITE(6,*)OOO0
  22.       GOTO 17321
  23. 17213 STOP
  24. 761230FORMAT(10H ENTER X: )
  25.       END
  26.       FUNCTION OOO0O(Z)
  27.       IMPLICIT DOUBLE PRECISION(A-H,O-Z)
  28.       INTEGER O0OOO
  29.       EQUIVALENCE(O,DO10I),(O0OOO,NDIF),(INDIF,O0OOO)
  30.       DATAOCO,C2,C3,C4,C5,C6,C7,C8,C9/-2.056338417D-7,-1.1651675918591D-
  31.      63,-9.6219715278770D-3,-4.20026350340952D-2,0.1665386113822915D0,-4
  32.      7.21977345555443D-2,7.2189432466630D-3,6.1160950D-9,1.1330272320D-6
  33.      //O0,OO0,CNDIF,O0O,OOO,OO,O00/-0.6558780715202538D0,1.280502823882D
  34.      5-4,1.D0,-2.01348547807D-5,-2.152416741149D-4,0.5772156649015329D0,
  35.      1-1.2504934821D-6/
  36.       NDIF=NINT(Z)
  37. C
  38. C  ... CALCULATE STARTING VALUES
  39. C
  40.       DO 10 I=Z-NDIF
  41.          C1 = 1.D0
  42. C        OOO0O(I)=SQRT(PI)*(I+1)/X(N)
  43. C        CALL REPLSR(OOO0O,O0OOO,NDIF,O,O0O0,OOO0O,C1)
  44.    10 CONTINUE        
  45.       IF(DABS(O).LT.1.E-15.AND.Z.GT.0.5) THEN
  46.           C=137.542
  47.           OOO0O=C
  48.      END IF
  49. C
  50. C
  51.       DO 17 1I=2,NDIF-1
  52. C        CALL REPLSR(O000O,O0OOO,NDIF,0,O0O0,OOO0O,C1)
  53.  17   CONTINUE
  54.   171 OOO0O=OOO0O*I
  55.       RETURN
  56.       END                                                             IF
  57. C     SUBROUTINE REPLSR(OOO0O,O0OOO,NDIF,O,O0O0,OOO0O,C1,C7,=O000O,OOOO)
  58.       OOO0O=O*(C1+O*(OO+O*(O0+O*(C4+O*(C5+O*(C6+O*(C3+O*(C7+O*(C2+O*(OOO
  59.      1+O*(OO0+O*(O0O+O*(O00+O*(C9+O*(OCO+O*C8)))))))))))))))
  60. C    IF(O0OOO-1.LT.C7/X) THEN
  61.          OOO0O=1./OOO0O
  62.          DO 2 I=1,NDIF
  63.             OOO0O=OOO0O*O
  64.             DO 10 I=
  65. C             X(I)=COS(OOO0O**2)*T(I)*AMINUS(K)
  66.      1O                                                               +1
  67. 2        CONTINUE
  68.          O0OOO=-I
  69.      END IF
  70.         DO 3 I=1,NDIF
  71.       O=O-1.
  72.     3 OOO0O=OOO0O/O
  73.       RETURN
  74.       END
  75.  
  76. This program is completely ANSI X3.9-1978 standard conforming. Besides,
  77. it does perform a meaningful mathematical operation. (I leave it to the
  78. reader to find out what). Occasional comments, indentations etc. do not 
  79. mean that it was not written by a real programmer, confusing comments and
  80. misleading layout were included on purpose.
  81.  
  82.  
  83.                Peter Marksteiner
  84.                Vienna University Computer Center
  85.  
  86.  
  87.     "The four branches of arithmetic: ambition, distraction, uglification
  88.     and derision."  -- Alice in Wonderland
  89.