Message Boards Message Boards

0
|
4342 Views
|
5 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Limits of Mathematica's numeric precision?

Posted 2 years ago

I seem to have bumped up against the limits of Mathematica with regard to number of digits it can handle. See enclosed.computation error I see reference to much greater precision so it makes me wonder if that is really what's going on.

POSTED BY: Leon Fairbanks
5 Replies
Posted 2 years ago

Hi Leon,

Please edit your question and add the code so it can be copied/pasted and reproduced.

POSTED BY: Rohit Namjoshi

The function N usually evaluates with the standard

$MachinePrecision

If you insist in higher precision e.g. like this:

N[((-5551459608 + 3925475120 Sqrt[2]) Sqrt[2 - Sqrt[2]])^2, 100]

and

N[Expand[((-5551459608 + 3925475120 Sqrt[2]) Sqrt[2 - Sqrt[2]])^2], 100]

you get the same result. You could also try

N[((-5551459608 + 3925475120 Sqrt[2]) Sqrt[2 - Sqrt[2]])^2 - (210443293513022896768 - 148805879898289354304 Sqrt[2]), 100]

and study the warning. This link might help.

Cheers, Marco

PS: Note that

Simplify[((-5551459608 + 3925475120 Sqrt[2]) Sqrt[2 - Sqrt[2]])^2 - (210443293513022896768 - 
148805879898289354304 Sqrt[2])]

uses "infinite precision" and vanishes - as expected.

POSTED BY: Marco Thiel

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. Posting code Images doesn't help other members to copy your code. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

You can also embed notebook or attach notebook.

enter image description here

POSTED BY: Moderation Team
Posted 2 years ago

Thanks Marco! I (I will attach a notebook in future questions)

POSTED BY: Leon Fairbanks

As I understand it, N[x] calculates x using machine precision and keeping no track of accumulating errors. Instead, N[x,n] calculates x with all whatever internal precision required to get the result with n correct digits, keeping track of errors. The situation is complicated and you can get apparently contradictory results:

x = ((-5551459608 + 3925475120 Sqrt[2]) Sqrt[2 - Sqrt[2]])^2;
y = 174288;
N[Expand[x]]
N[Expand[x], 6]
N[Expand[x], 7]
y < x < y + 1
y < Expand[x] < y + 1
y < N[Expand[x]] < y + 1
y < N[Expand[x], 6] < y + 1
y < N[Expand[x], 7] < y + 1
POSTED BY: Gianluca Gorni
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