Have you tried putting "d0" after your numeric constants in FORTRAN,
 
i.e.
compare 
     easy = 5.11*5.234*4.987
vs.
     easy = 5.11d0*5.234d0*4.987d0
 
Dave

>>> [EMAIL PROTECTED] 6/8/2006 4:22 PM >>>
Hi,
 
I've added a very simply calculation to both the FORTRAN and Numeric calcs, and called it 'easy'.  I've defined easy as ---  easy = 5.11*5.234*4.987
 
the files are attached, and the output is below.  The discrepancy always seems to show up at the 8th or 9th significant digit for simple multiplication, or for Numeric functions.
 
FORTRAN
  M**p =   5.170837517496476E-002
  easy =   133.381011962891
 
 atan term =   -1.01175767177248
 
PYTHON
  M**p =  0.0517083688947
  easy 133.38100538
  atan term =  -1.01175769857
Any diagnosis is greatly appreciated.
 
If anyone out there cares to run these 2 and verify the output on their machine, that would perhaps rule out/in the problem being my pc.
 
Buddy
 
 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Wheeler
Sent: Thursday, June 08, 2006 12:36 PM
To: Multiple recipients of list
Subject: Re: FiPy Precision

It depends on the size of the discrepancy. To diagnose this, we need a very simple calculation that
compares FORTRAN with Numeric for some very simple array manipulation (as Dan Lewis suggested).

On Jun 8, 2006, at 10:48 AM, Damm, Edward F. (E. Buddy) wrote:

Hello,
 
I'm getting some slight differences in some of my coefficients when comparing FiPy to Fortran benchmark code I'm using.  I have confirmed that the equations are the same.  There are some other potential areas that may be responsible for the discrepency, but I wonder if it may be due to precision. 
 
I'm using Double Precision in the fortran code, and for any numbers in FiPy I am ending them in a decimal point and zero if it does not have values after the decimal, and of course anything that does have values after the decimal are input as such.
 
Is it reasonable to think that my descrepencies are due to precision?  If so, do you have suggestions of how to reduce/eliminate the descrepancy?
 
Thanks
 
Buddy





This message and any attachments are intended for the individual or
entity named above. If you are not the intended recipient, please
do not forward, copy, print, use or disclose this communication to
others; also please notify the sender by replying to this message,
and then delete it from your system. The Timken Company / The
Timken Corporation



Daniel Wheeler



Reply via email to