6
$\begingroup$

What is meant by a machine number in the Mathematica documentation? What is the difference between machine-precision and fixed-point precision? What is arbitrary precision?

$\endgroup$

closed as off-topic by Sjoerd C. de Vries, MarcoB, user9660, Bob Hanlon, ubpdqn Jun 21 '16 at 8:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Sjoerd C. de Vries, MarcoB, Community, Bob Hanlon, ubpdqn
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    $\begingroup$ Have you read the tutorial on Numerical Precision? $\endgroup$ – Simon Woods Jun 19 '16 at 11:35
  • $\begingroup$ @SimonWoods Oh I didn't see that. Thank you very much! $\endgroup$ – Undertherainbow Jun 19 '16 at 11:45
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Jun 19 '16 at 13:07
  • 1
    $\begingroup$ Type in "arbitrary precision" in Mathematica's help browser and the second and third hit tell you all you need to know. The first one is relevant too. Same for a search on "machine precision". $\endgroup$ – Sjoerd C. de Vries Jun 19 '16 at 13:36
11
$\begingroup$

This is not an answer. But I don't believe we should close this question as "easily found in the documentation".

Numerics in Mathematica is an extremely complicated and mostly undocumented subject, where several mathematical concepts run up against each other in subtle and non-trivial ways. I have been thinking for some time that we ought to address this properly. Here is an outline for how I thought this could be approached.

There are three main headings, each containing enough material for several answers:

  1. The formalist's view: floating-point numbers as rationals

    • Decimal vs. binary digits
    • $MachineEpsilon
    • SetPrecision and Rationalize
    • IEEE issues: Infinity/Indeterminate vs. Inf/NaN; rounding modes; LAPACK vs. C definition of $MachineEpsilon
  2. Mathematica's view: floating-point numbers as distributions

    • The nature of the distribution: interval arithmetic versus Gaussian error propagation
    • $EqualTolerance; $SameQTolerance; Internal`CompareNumeric
    • Significance arithmetic and error propagation
  3. Practicalities: floating-point numbers as a model of the reals

    • Accuracy and Precision
    • $MinPrecision/$MaxPrecision
    • Dealing with numerically unstable functions
    • Adaptive-precision evaluation; $MaxExtraPrecision
    • "CatchMachineUnderflow" system option
    • PossibleZeroQ and associated system options "ZeroTestMaxPrecision" and "ZeroTestNumericalPrecision"

Anyone should feel free to add to these lists of topics in case I forgot anything. There are answers covering some of them already, but a lot of it is not widely known. I propose that, as a collaborative effort, we could address this question comprehensively (it's too much work for me to do by myself). This thread seems like a golden opportunity to do so.

$\endgroup$
  • $\begingroup$ The challenge is to explain everything adequately without having to write an entire numerical analysis textbook… in any event, one will have to also consider whether a problem is due to an unstable algorithm or an ill-conditioned problem. $\endgroup$ – J. M. is away Jun 19 '16 at 15:32
  • $\begingroup$ @OleksandrR. what does Internal`CompareNumeric do? $\endgroup$ – QuantumDot Sep 19 '16 at 1:32
  • 2
    $\begingroup$ @QuantumDot Internal`CompareNumeric[prec, a, b] returns -1, 0, or 1 according to whether a is less, equal, or greater than b when compared at the precision of a or b (whichever is less) minus prec decimal digits of "tolerance". It is the fundamental operation underlying Less, Equal, Greater, LessEqual etc. for finite-precision numeric types. $\endgroup$ – Oleksandr R. Sep 19 '16 at 22:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.