Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Distinguishable From 1.0

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47832] Re: [mg47811] Re: Distinguishable From 1.0
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Thu, 29 Apr 2004 00:33:51 -0400 (EDT)
  • References: <c6ic20$6j5$1@smc.vnet.net> <200404270847.EAA18919@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 27 Apr 2004, at 17:47, Maxim wrote:

> It gets more interesting if we consider arbitrary-precision numbers:
>
> In[1]:=
> 1`2 == 2.2
> 1`2 == 2.3
>
> Out[1]=
> True
>
> Out[2]=
> False
>
> If precision of the number 1`2 equals 2 and scale (decimal logarithm
> of the number) is 0, then accuracy is also 2 and absolute error is
> 10^-accuracy = 0.01. Then why is this number considered equal to 2.2?
> Additionally, 1`2-2.2 is converted to machine number, so it is not
> equal to 0. Also, Equal is not transitive:
>
> In[3]:=
> {99`2 == 0, 0 == -99`2, 99`2 == -99`2}
>
> Out[3]=
> {True, True, False}
>
> Looking at RealDigits doesn't clarify things. And another issue:
>
> In[4]:=
> int = Interval[1`2];
> IntervalMemberQ[int, 0]
> IntervalMemberQ[Sin[int], 0]
>
> Out[5]=
> True
>
> Out[6]=
> False
>
> If the interval contains the point 0, how can Sin map it to an
> interval which doesn't include 0?
>
> Maxim Rytin
> m.r at prontomail.com
>
As Richard Fateman has, in the past, pointed out on this list, 
comparisons of this kind between inexact numbers or inexact and exact 
numbers are bound to lead to weird results and should never be made. 
This problem could be avoided by simply not allowing them at all so 
that instead of getting the answers that seem to worry you, you would 
simply get an error message, rather like the one you get when trying to 
check if one complex number is larger than another. However a better 
solution seems to me to be just to refrain form doing it.
Besides it is well known that Mathematica's high precision arithmetic 
model, based on approximate interval arithmetic,  works well only for 
numbers whose uncertainty is much smaller than the number itself. This 
is the case in all applications I have ever heard of. For very low 
precision numbers like your examples, it is known to give excessively 
pessimistic or wrong answers, but so what?



Andrzej Kozlowski
Chiba, Japan
http://www.mimuw.edu.pl/~akoz/


  • Prev by Date: Re: Re: Question on pattern matching
  • Next by Date: Simplify expressions
  • Previous by thread: Re: Distinguishable From 1.0
  • Next by thread: Interesting integral problem