Message Boards Message Boards

1
|
3357 Views
|
9 Replies
|
5 Total Likes
View groups...
Share
Share this post:

How can I best mimic Fortran Double Precision in MMA ?

I am trying to reproduce some results that were originally generated by a Fortran package that executed on a CDC 7600 mainframe (back in the late 1970s). The results are obtained by summing a large number (up to 15000) rapidly oscillating terms in what is called a Partial Wave Sum.

I cannot get my MMA code to match the old results and I think that it may be down to numerical rounding/convergence issues. I believe that Fortran double precision meant that a DP variable was stored as two physical words of memory (each of which had 60 bits on a 7600).

I'm running MMA on a MacBook Pro with 64-bit Apple silicon and I have tried tweaking Working Precision, Accuracy Goal and the like but with no visible benefits.

Is it possible to coerce MMA into using two 64-bit words per variable, or are there more elegant ways of handling these kinds of issue?

Any help gratefully received.

David

POSTED BY: David Mackay
9 Replies
POSTED BY: David Mackay

Many thanks for the help and tips so far.

I have attached a Notebook which illustrates the basic problem. The key numbers that I am trying to calculate are generated in the module etaLIST and are stored in the list etas. At the end of the Notebook you can see how the precision of these data varies with the parameter l.

In my real problem, I have to sum up a series which may contain up to 15000 terms. Each term has three parts. One part is the exponent of an eta and so the precision of the final sum is critically dependent upon the accuracy and precision with which I can compute the etas themselves.

I may have gone too far with my use of backticks !!

David

Attachments:
POSTED BY: David Mackay
Posted 1 year ago
POSTED BY: Eric Rimbey
Posted 1 year ago

Another comment (but this isn't really my area of expertise, so someone else may have more insight)... it looks like you've gone to a lot of trouble to define certain quanties with 50 digits of precision, but in your FindRoot calculations, you are setting WorkingPrecision to 25. Furthermore, the documentation states that AccuracyGoal and PrecisionGoal by default are set to WorkingPrecision/2. So, I think that we can only expect a dozen or so digits of precision in the results. Is that what you want?

Also, after waiting for several minutes for the final two calculations to complete, I just gave up. So I don't know what you're trying to show. Please provide a more focused and manageable example of where you're losing precision unexpectedly (sorry, but I'm just not gonna invest my whole day in this).

POSTED BY: Eric Rimbey
Posted 1 year ago
POSTED BY: Eric Rimbey
POSTED BY: David Mackay
Posted 1 year ago

Have you read the documentation for FindRoot? There are examples of how to use AccuracyGoal, PrecisionGoal, and WorkingPrecision. I am able to get results to very high precision by tweaking those options. Please don't provide a complicated notebook. Just provide a single, simple, representative example of something that doesn't give you what you expect.

POSTED BY: Eric Rimbey
Posted 1 year ago

Off-topic, but:

(not noble, sorry about missing the spell corrector blunder)

You can correct a typo in the title of a discussion you have started. Hit the Edit button below your published post. Then you can edit the title, in the input field on top.

enter image description here

POSTED BY: Hans Milton

Welcome to Wolfram Community! Please provide your efforts in the form of the Wolfram Language code. This will make it easier for other members to help you. Check several methods available to include your code in the rules http://wolfr.am/READ-1ST

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract