Group Abstract Group Abstract

Message Boards Message Boards

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

Limits of Mathematica's numeric precision?

Posted 4 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 BY: EDITORIAL BOARD

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
Posted 4 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
Posted 4 years ago

Hi Leon,

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

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