       Re: Interval arithmetic bug

• To: mathgroup at smc.vnet.net
• Subject: [mg90804] Re: Interval arithmetic bug
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Fri, 25 Jul 2008 06:11:34 -0400 (EDT)
• References: <g670mq\$s3n\$1@smc.vnet.net>

On Jul 23, 12:21 pm, green tea <cetec... at gmail.com> wrote:

> In:= Limit[Sin[x], x -> Infinity]
>
> Out= Interval[{-1, 1}]
>
> In:= Limit[Sin[x + Pi/4], x -> Infinity]
>
> Out= Interval[{-Sqrt, Sqrt}]
>
> In:= TrigExpand[Sin[x + Pi/4]]
>
> Out= Cos[x]/Sqrt + Sin[x]/Sqrt
>
> In:= (Limit[#1, x -> Infinity] & ) /@ {Cos[x]/Sqrt,
>   Sin[x]/Sqrt}
>
> Out= {Interval[{-(1/Sqrt), 1/Sqrt}],
>    Interval[{-(1/Sqrt), 1/Sqrt}]}
>
> In:= Plus @@ %
>
> Out= Interval[{-Sqrt, Sqrt}]
>
> In:= \$Version
>
> Out= "6.0 for Microsoft Windows (32-bit) (May 21, 2008)"
>
> oh my god..

I might have missed the point, but as far as I can tell, the interval
arithmetic is correct. What you may have expected is to get the
interval [-1, 1], which is included in the interval [-sqrt(2),
sqrt(2)]; however, when computing limits, they is no guarantee
whatsoever that Mathematica will return systematically the smallest
interval that encompasses all possible values since an *Interval[]*
object has no knowledge of the function that generated it in first
instance (so the standard rules of interval arithmetic applied). For
instance, the following example is perfeclty correct in terms of
interval arithmetic, though one may have wished to get one for the
last expression:

In:= Limit[Cos[x]^2 + Sin[x]^2, x -> Infinity]
Limit[Cos[x]^2, x -> Infinity]
Limit[Sin[x]^2, x -> Infinity]
Limit[Cos[x]^2, x -> Infinity] +
Limit[Sin[x]^2, x -> Infinity]

Out= 1

Out= Interval[{0, 1}]

Out= Interval[{0, 1}]

Out= Interval[{0, 2}]

Regards,
-- Jean-Marc

• Prev by Date: Mathematica in Education and Research
• Next by Date: Is this a bug?
• Previous by thread: Re: Interval arithmetic bug
• Next by thread: How to call or run a NB file in another NB file?