Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Eng-Tips
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

jgbeckett (Aeronautics) (OP)
15 Mar 05 6:30
Can anyone help?

I am trying to recreate some arrays using a subroutine written by someone else.  By using real*8 throughout the program I get one set of results, by changing the precision in the subroutine to real at certain functions I get a differnt array resulting.  The array I want is the exact average of the two!

Any ideas?

Are there any problems with using a subroutine, written in 77, for a program in CVF.

John
johnhors (Aerospace)
15 Mar 05 9:04
John

By default I only use double precision. When dealing with array manipulation, especially if it involves equation solving then single precision is a non-starter. It is bad practice to have mixed precision expressions, just because the result may be stored in a double precision variable doesn't mean you have double precision accuracy if it was calculated using single precision variables.

How do you know the result that you want? Are you trying to match results made years ago on a different computer system?

There should be no problem in using F77 with any later standard of Fortran.
jgbeckett (Aeronautics) (OP)
15 Mar 05 9:45
thanks for the advise,

I am trying to match results done a few years ago (1987), but I beleive these to be accurate as they correspond to other results.  
Also, the two matrices I get by varying the precision have the same amount of error when compared to the origional, only in different directions.
johnhors (Aerospace)
15 Mar 05 14:40
In that case I don't beleive you will be able to match your 1987 results. I suspect your old results were produced on something like a digital VAX computer running under VMS, in which case you will never get an exact match on a PC.
Helpful Member!  DanTex (Structural)
30 Mar 05 12:15
You might want to read up on how a computer does floating point operations and how variable precision plays a role. The Lahey.com website has an article on "The Perils of Floating Point" which you may find illuminating. Based on what I've read here so far...  I feel quite safe in saying that you currently have no way of knowing for sure what the correct results should be.  I would tend to guess that your double precision version is more likely to give good answers, however, that is not even close to guarantteed either.

Your results are dependant on several things.  The particular computer used,  CPU and possibly other hardware also,  the operating system used, the fortran compiler used and the compiler switches which were set when you compiled the program.  And last of all... the program code itself.  How can you be SURE that the routines logic is sound????

Dan  
www.dtware.com
IRstuff (Aerospace)
30 Mar 05 12:18
Independent of the precision issue, it may simply be that you have ill-behaved algorithms and the errors emanate from poor formation of the equations, resulting in dependence on the least significant bits of the numbers.

TTFN

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!

Back To Forum

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close