[Date Index]
[Thread Index]
[Author Index]
Re: Mathematica 4.2 & Strange Plot results
*To*: mathgroup at smc.vnet.net
*Subject*: [mg36328] Re: Mathematica 4.2 & Strange Plot results
*From*: "Ian McInnes" <ian at whisper-wood.demon.co.uk>
*Date*: Mon, 2 Sep 2002 04:08:35 -0400 (EDT)
*References*: <akn016$ljr$1@smc.vnet.net>
*Sender*: owner-wri-mathgroup at wolfram.com
This results from:
a) the fact that Mathematica implements division as multiplication and
reciprocation
b) the use of machine precision for plotting the graph
c) the default scaling of the y axis revealing the resultant inaccuracies
Although Sin[x]/Sin[x] gives 1 when evaluated symbolically (x undefined),
substituting a floating-point value for x results in composite division
being performed numerically, with consequent inaccuracy. This can be
verified by the following:
In[1]:= FullForm[HoldForm[Sin[x]/Sin[x]]
Out[1]//FullForm= HoldForm[Times[Sin[x], Power[Sin[x], -1]]]
By default, Mathematica scales the y axis such that the small discrepancies
are visible. The PlotRange option may be given to explicitly specify the
range for the y axis (for example PlotRange->{0, 2}).
Regards,
Ian McInnes.
"Ken Thomson" <someone at somewhere.com> wrote in message
news:akn016$ljr$1 at smc.vnet.net...
> I would expect that
>
> Plot[Sin[x]/Sin[x], {x, -2.5, -1.5}]
>
> would produce a horizontal line at y=1.
>
> However, on my Windows XP computer it produces a graph where the y value
is
> less than 1 at several points. Most notibly between x=-1.6 and x=-1.8
>
> Is this just an isolated case? Or does it happen to others? If so - why?
>
> Regards,
> Ken.
>
>
>
Prev by Date:
**Re: L2 inner product. Integrate and Conjugate?**
Next by Date:
**Re: L2 inner product. Integrate and Conjugate?**
Previous by thread:
**Bug in Times?! - Nonzero 0*SeriesData[..]**
Next by thread:
**RE: Re: Mathematica 4.2 & Strange Plot results**
| |