home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin
- From: hrubin@pop.stat.purdue.edu (Herman Rubin)
- Newsgroups: comp.programming
- Subject: Re: floating point routines with double precision
- Message-ID: <54944@mentor.cc.purdue.edu>
- Date: 23 Jul 92 22:38:16 GMT
- References: <2A65BFF1.14443@noiro.acs.uci.edu> <54561@mentor.cc.purdue.edu> <1992Jul22.120724.3466@druid.uucp>
- Sender: news@mentor.cc.purdue.edu
- Organization: Purdue University Statistics Department
- Lines: 33
-
- In article <1992Jul22.120724.3466@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes:
- >hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
- >>Use assembler for you particular machine if you want any speed. Even
- >>setting it up for the compiler will be a major headache, and you will
- >>have just as many problems with object size.
-
- >Here is how I set up my compiler to generate machine code for a floating
- >point operation:
-
- > result = value/4.586; /* Well it does :-) */
-
- >Seriously, there may be cases where the compiler doesn't give the fastest
- >code for a given operation but they are probably the rare exception. With
- >modern compilers the chances are that hand coded assembly won't be as fast
- >and are certainly longer to program. A much better method of speeding up
- >critical sections of code is inlining. That's why the current Gnu compiler
- >internally inlines some of the more common string functions. Function
- >call overhead is still relatively expensive on most popular CPUs.
-
- It depends on what you call double precision. The IEEE standard
- double precision probably should be called single precision, and
- what it calls single precision should be called half precision.
-
- Now I was answering the question assuming that more than the designed
- precision is needed. The routines are not difficult for a human to
- design, but almost hopeless for a compiler. Anyone who writes such
- a procedure for a machine which has forced normalization will curse
- the designers.
- --
- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
- Phone: (317)494-6054
- hrubin@pop.stat.purdue.edu (Internet, bitnet)
- {purdue,pur-ee}!pop.stat!hrubin(UUCP)
-