home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / arch / 10505 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  4.1 KB

  1. Xref: sparky comp.arch:10505 comp.lang.misc:3541
  2. Newsgroups: comp.arch,comp.lang.misc
  3. Path: sparky!uunet!usc!sdd.hp.com!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!hrubin
  4. From: hrubin@mentor.cc.purdue.edu (Herman Rubin)
  5. Subject: Re: Hardware Support for Numeric Algorithms
  6. Message-ID: <BxCJwt.47x@mentor.cc.purdue.edu>
  7. Organization: Purdue University Statistics Department
  8. References: <1992Nov5.202412.7266@linus.mitre.org> <1992Nov5.203759.8030@linus.mitre.org> <721104899@sheol.UUCP>
  9. Date: Sat, 7 Nov 1992 12:55:41 GMT
  10. Lines: 67
  11.  
  12. In article <721104899@sheol.UUCP> throopw@sheol.UUCP (Wayne Throop) writes:
  13.  
  14. >: From: bs@gauss.mitre.org (Robert D. Silverman)
  15. >: Message-ID: <1992Nov5.202412.7266@linus.mitre.org>
  16. >: Needless to say, there are people who have to worry about speed FIRST,
  17. >: and that other considerations are (almost) irrelevent.
  18.  
  19. >: From: bs@gauss.mitre.org (Robert D. Silverman)
  20. >: Message-ID: <1992Nov5.203759.8030@linus.mitre.org>
  21. >: Dr. Rubin's main rule is:
  22. >:       "The code should run as fast as possible"
  23. >: For him, all other considerations are secondary. Who are you to tell
  24. >: him what his priorities should be?
  25.  
  26. >Ah, Robert seems to be saying that Dr. Rubin is a member of that large
  27. >class of people for whom it is very very important to get the wrong
  28. >answer as soon as possible.  But wait.... if "The code should run as
  29. >fast as possible" and "all other considerations are secondary", why
  30. >doesn't he just run the null istream?
  31.  
  32. >Since Dr. Rubin *doesn't* suggest running the null istream, I conclude
  33. >that the "(almost) irrelevant" above contains a very, very large point
  34. >swept under the rug.  It is of *primary* importance that the code be
  35. >correct.
  36.  
  37. Now where did you get the idea that either of us wants an incorrect
  38. routine?  Of course it is important that code be correct.  However,
  39. program?  Of course, code to be useful should be correct, but I suspect
  40. that every operating system has some essential bug in it; Murphy's Law
  41. applies to computer programming.  However, any errors in the code I
  42. posted were not due to my use of gotos, or code rearrangement to gain
  43. performance.  One of my respondents suggested that I post to the net
  44. a long explanation of how the algorithm was derived, and that will be
  45. done next week.
  46.  
  47. Certainly code should be checked in whatever way possible for correctness.
  48. In principle, the code I have posted could be so checked by setting up a
  49. good trace program, feeding in random numbers of a higher quality than I
  50. know how to get, and running it more than 10^20 times.  This would be more
  51. than 10^13 of Dr. Silverman's MIPS-years; it cannot be done.  So I am 
  52. required to make a proof of correctness by investigating that the code
  53. follows the algorithm.
  54.  
  55. But it is quite possible to speed up the flow of the code, and in parallel
  56. remove the bugs.  This is not all that different from what language designers,
  57. compiler writers, and hardware designers do.  Designing for the goal does not
  58. mean that all the implementation bugs are removed first; this cannot even be
  59. done, as any change may introduce bugs.  The particular code I posted is not
  60. tailored for a specific machine; hardware can cause things to be done in a
  61. different manner, and what is essentially the same algorithm should be done
  62. somewhat differently on different machines, such as vector and parallel
  63. processors.  The results will be different, so that that method of comparison
  64. cannot be used.
  65.  
  66. As far as readability, portability, and ease of maintenance are concerned,
  67. the code I have posted is quite portable.  The most readable version was
  68. the one which had ONLY gotos for control; this got the most responses,
  69. both to the net and by email, and these responses were quite accurate,
  70. even the ones which would have slowed down the operation of the compiled
  71. version.  Part of the reason is that I find the logic of the goto quite
  72. simple, and I suspect that even those who condemn it do so for reasons
  73. other than understandability of what it means.
  74. -- 
  75. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
  76. Phone: (317)494-6054
  77. hrubin@snap.stat.purdue.edu (Internet, bitnet)  
  78. {purdue,pur-ee}!snap.stat!hrubin(UUCP)
  79.