From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,bf8942033e6cc895 X-Google-Attributes: gid1164f8,public From: lpa@netcom.com (Pierre Asselin) Subject: Re: Large numbers in F90 Date: 1998/02/12 Message-ID: #1/1 X-Deja-AN: 324511236 Sender: lpa@netcom13.netcom.com References: <34E22A42.41C6@rhea.umd.edu> Organization: Netcom On-Line Services Newsgroups: comp.sys.dec "Jeffrey J. Potoff" writes: >I have a Fortran 90 code where on occasion I need to take the >exponential of some large numbers (500+). As you can imagine, >the result is a floating point overflow with real*8. That's normal. >I was able >to avoid the floating overflow by going real*16, but now the >code is incredibly slow. That's normal. The real*16 gives you the extra dynamic range of a longer exponent, but also the extra accuracy of a longer mantissa. Your code works that much harder to compute exponentials to that accuracy. Go back to the math behind the code, factor out the exponent offset analytically, and re-code. -- --Pierre Asselin, Westminster, Colorado lpa@netcom.com pa@verano.sba.ca.us