home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!news.univie.ac.at!pm
- From: pm@cc.univie.ac.at (Peter Marksteiner)
- Subject: Re: Uglifier (was Re: Real Programmers)
- Message-ID: <1992Dec17.102911.8075@newssrv.edvz.univie.ac.at>
- Sender: news@newssrv.edvz.univie.ac.at (News System - Vienna University)
- Nntp-Posting-Host: katz.cc.univie.ac.at
- Organization: Vienna University Computer Center
- X-Newsreader: TIN [version 1.1 PL6]
- References: <1992Dec16.164347.21210@craycos.com>
- Date: Thu, 17 Dec 1992 10:29:11 GMT
- Lines: 75
-
- Here's my favourite ugly program (uglified by hand, not by an automatic
- uglifier).
-
- IMPLICITDOUBLE PRECISION(A-H,O-Z)
- 173210 WRITE(6,76123)
- READ(5,*,END=17213)X
- OOO0=OOO0O(X)
- WRITE(6,*)OOO0
- GOTO 17321
- 17213 STOP
- 761230FORMAT(10H ENTER X: )
- END
- FUNCTION OOO0O(Z)
- IMPLICIT DOUBLE PRECISION(A-H,O-Z)
- INTEGER O0OOO
- EQUIVALENCE(O,DO10I),(O0OOO,NDIF),(INDIF,O0OOO)
- DATAOCO,C2,C3,C4,C5,C6,C7,C8,C9/-2.056338417D-7,-1.1651675918591D-
- 63,-9.6219715278770D-3,-4.20026350340952D-2,0.1665386113822915D0,-4
- 7.21977345555443D-2,7.2189432466630D-3,6.1160950D-9,1.1330272320D-6
- //O0,OO0,CNDIF,O0O,OOO,OO,O00/-0.6558780715202538D0,1.280502823882D
- 5-4,1.D0,-2.01348547807D-5,-2.152416741149D-4,0.5772156649015329D0,
- 1-1.2504934821D-6/
- NDIF=NINT(Z)
- C
- C ... CALCULATE STARTING VALUES
- C
- DO 10 I=Z-NDIF
- C1 = 1.D0
- C OOO0O(I)=SQRT(PI)*(I+1)/X(N)
- C CALL REPLSR(OOO0O,O0OOO,NDIF,O,O0O0,OOO0O,C1)
- 10 CONTINUE
- IF(DABS(O).LT.1.E-15.AND.Z.GT.0.5) THEN
- C=137.542
- OOO0O=C
- END IF
- C
- C
- DO 17 1I=2,NDIF-1
- C CALL REPLSR(O000O,O0OOO,NDIF,0,O0O0,OOO0O,C1)
- 17 CONTINUE
- 171 OOO0O=OOO0O*I
- RETURN
- END IF
- C SUBROUTINE REPLSR(OOO0O,O0OOO,NDIF,O,O0O0,OOO0O,C1,C7,=O000O,OOOO)
- OOO0O=O*(C1+O*(OO+O*(O0+O*(C4+O*(C5+O*(C6+O*(C3+O*(C7+O*(C2+O*(OOO
- 1+O*(OO0+O*(O0O+O*(O00+O*(C9+O*(OCO+O*C8)))))))))))))))
- C IF(O0OOO-1.LT.C7/X) THEN
- OOO0O=1./OOO0O
- DO 2 I=1,NDIF
- OOO0O=OOO0O*O
- DO 10 I=
- C X(I)=COS(OOO0O**2)*T(I)*AMINUS(K)
- 1O +1
- 2 CONTINUE
- O0OOO=-I
- END IF
- DO 3 I=1,NDIF
- O=O-1.
- 3 OOO0O=OOO0O/O
- RETURN
- END
-
- This program is completely ANSI X3.9-1978 standard conforming. Besides,
- it does perform a meaningful mathematical operation. (I leave it to the
- reader to find out what). Occasional comments, indentations etc. do not
- mean that it was not written by a real programmer, confusing comments and
- misleading layout were included on purpose.
-
-
- Peter Marksteiner
- Vienna University Computer Center
-
-
- "The four branches of arithmetic: ambition, distraction, uglification
- and derision." -- Alice in Wonderland
-