Message Boards Message Boards

0
|
4906 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Computation precision

Posted 9 years ago

Hi!

I know my question has been asked before, but a (for me) satisfying answer still remains to be given, so I ask again...

Because of a numerical Laplace-Carson inversion algorithm that I am using I need to have all numerical values at very high accuracy, say with at least 20 digits after the comma, otherwise the algorithm does not work. In Maple, it is quite easy to set the precision globally (by means of the digits-command). Now I decided to switch to Mathematica, and I simply could not figure out how to convince Mathematica to compute all numbers at the required accuracy.

Is there a simple way to achieve what I want? Or do I have to tell Mathematica in each and every line that it should strive for the required accuracy?

Thanks a lot for some feedback!

Best regards, Stefan

POSTED BY: Stefan Scheiner
2 Replies

As said above: there is not an easy (1 line or so) way to set the global precision somehow. Mathematica has two types of floating point numbers: one is machine precision and is arbitrary precision. Type machine precision numbers (1.35, 4.2318 et cetera) and the calculation will continue with machine precision numbers. Type arbitrary precision numbers (1040 or 4.1560) and the calculation will use arbitrary precision all the way.

You could, though, ask Mathematica to pre-process everything that you type (through \ $Pre or \$PreRead) in by first applying a function that sets the digits of each number to a specified value.

This is also easy to find on something called 'Google': check this out for example

POSTED BY: Sander Huisman

Hi.

I encountered three same issue some time ago. Usually Mathematics uses machine precision which is 16 digits. This was insufficient for my application,and I had to use arbitrary precision numbers. So all values in the notebook have to be arbitrary precision. If Mathematics once encounters machine precision it assumes all values to have machine precision. So you need to set all values to three precision you want using setprecision or xx'700, where this is a number with 700 digits four instance. To my knowledge there its no command for setting the precision globally. center I recommend reading the chapter about numbers in the Mathematica documentation center. Markus

POSTED BY: Markus Schmidt
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