From: David Bailey on 2 Feb 2010 03:23 Daniel Lichtblau wrote: > I had in mind the spoiler answer Richard Fateman provided in his first > post mentioning this particular tangent, err, example. > > http://forums.wolfram.com/mathgroup/archive/2010/Jan/msg00638.html > > At the bottom we find: > --- > I would especially avoid .nb objects, and most especially on topics of > numerical analysis, where the design flaws are, in my opinion, so > fundamental. Example (mathematica 7.0): > {x >= 1, x > 1, x > 0, x} > evaluates to > {True, False, False, 0.} > > can you construct x? > > RJF > > One possible answer, below.... > > x=0``-.5 > --- > > The point is that with Mathematica's version of significance arithmetic, > equality, I believe, is effectively treated as having a nontrivial an > intersection (of the implicit intervals defining two numbers). If > neither has any fuzz (i.e. both are exact), then Equal allows for no > fuzz, so this is only a subtlety if at least one of the values is > approximate. > > One implication is that a "zero" of sufficiently low (as in bad) > accuracy can be regarded as 1, or -1, or Pi, if those values happen to > fall within the accuracy (which I refer to as fuzz). > > The other inequalities follow from the preservation of trichotomy. For > explicitly real values we regard that as important. mathematica makes no > pretense that Equal is transitive and I do not see any way to do that > and also have useful approximate arithmetic. > > There has been some amount of communication off-line on this topic, > which is why some of us (well, me, at least) sometimes forget the > examples are not universally obvious to those who have not memorized the > enitre thread. > > Daniel > Maybe an notebook option to flag numbers of extremely low precision with a colour might be useful. I guess this might be useful more generally in numerical analysis. David Bailey http://www.dbaileyconsultancy.co.uk
From: Richard Fateman on 3 Feb 2010 06:13 David Bailey wrote: .... >> > > Maybe an notebook option to flag numbers of extremely low precision with > a colour might be useful. I guess this might be useful more generally in > numerical analysis. > This (previously posted) program will do it. $LowPrecisionWarningLimit=1 PrintShowFuzz[x_] := x /. (r_Real /; (Precision[r] < $LowPrecisionWarningLimit) -> Style[InputForm[r], Red]) $PrePrint=PrintShowFuzz RJF
First
|
Prev
|
Pages: 1 2 Prev: Ha! a document that FAILS because it is in notebook form! Next: distance to quadratic surface |