Message Boards Message Boards

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

Calculating Products in different Mathematica Versions

Posted 3 years ago

Has anyone an idea, why calculating a product from small numbers in the new Mathematica 12.1 does not give the same results as Mathematica 11.2? For the complete example, which is a part of a likelihood computation, see the attached notebook.

Calculation in Mathematica 12.1

In[1]= 
$MachinePrecision

Times @@ {0.0016214960604198744`, 0.001620019767161015`,  ...,  *[many numbers]*, ... , 
 0.0016116789355172978`}

Out[1]= 15.9546

During evaluation of In[1]:= General::munfl: 2.0705*10^-191 8.36448*10^-186 is too small to represent as a normalized machine number; precision may be lost.

During evaluation of In[1]:= General::munfl: 3.24301*10^-189 1.03749*10^-186 is too small to represent as a normalized machine number; precision may be lost.

Out[2]= 0.

Exactly the same calculation in Mathematica 11.2

$MachinePrecision

Times @@ {0.0016214960604198744`, 0.001620019767161015`, ...,  *[many numbers]*, ... , 0.0016116789355172978`}

Out[1]= 15.9546

Out[2]= 5.82698961568687*10^-751

P.S. Likelihood calculation is not the problem. Its just the surprising difference between two Mathematica versions.

Attachments:
POSTED BY: Jost Adler
2 Replies

Machine arithmetic underflow now becomes 0. As benefits, this means packed arrays will not unpack due to underflow, and certain internal operations need no longer check for underflow.

POSTED BY: Daniel Lichtblau

It may be that the parameter $MinMachineNumber has changed in version 11.3.

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