home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / compiler / 2274 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.2 KB

  1. Xref: sparky comp.compilers:2274 comp.lang.fortran:5214
  2. Newsgroups: comp.compilers,comp.lang.fortran
  3. Path: sparky!uunet!think.com!spdcc!iecc!compilers-sender
  4. From: dodd@mycenae.cchem.berkeley.edu (Lawrence R. Dodd)
  5. Subject: Re: Wanted: folk theorems in Fortran Programming.
  6. Reply-To: dodd@mycenae.cchem.berkeley.edu (Lawrence R. Dodd)
  7. Organization: Dept of Chemical Engineering, Polytechnic Univ, NY, USA
  8. Date: Wed, 27 Jan 1993 09:20:19 GMT
  9. Approved: compilers@iecc.cambridge.ma.us
  10. Message-ID: <93-01-199@comp.compilers>
  11. References: <93-01-193@comp.compilers>
  12. Keywords: Fortran
  13. Sender: compilers-sender@iecc.cambridge.ma.us
  14. Lines: 18
  15.  
  16. "Steve" Stevenson <steve@hubcap.clemson.edu> writes:
  17. > I am trying to make a catalog of folk wisdom in fortran programming.
  18.  
  19. My personal favorite is the one discussed on page 137 of the 1st edition of
  20. Numerical Recipes (Fortran edition, of course):
  21.  
  22. BAD
  23.  
  24. P = c(1) + c(2)*x + c(3)*x**2 + c(4)*x**3 + c(5)*x**4
  25.  
  26. GOOD
  27.  
  28. P = c(1) + x*(c(2) + x*(c(3) + x*(c(4) + x*c(5))))
  29.  
  30. It is a little harder to read but you won't be `summarily executed'
  31. -- 
  32. Send compilers articles to compilers@iecc.cambridge.ma.us or
  33. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  34.