Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7693

Re: For a variety of plotting experiences, maybe bugs?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail
From Richard Fateman <fateman@eecs.berkeley.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: For a variety of plotting experiences, maybe bugs?
Date Mon, 9 Jan 2012 08:26:28 +0000 (UTC)
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <jee8bk$d2m$1@smc.vnet.net> (permalink)
References <je3vti$eeh$1@smc.vnet.net> <je6e5h$q7b$1@smc.vnet.net> <24475751.93762.1326015447306.JavaMail.root@m06> <006601ccce2f$c71c7ee0$55557ca0$@comcast.net>
Lines 82
NNTP-Posting-Date 09 Jan 2012 08:26:40 GMT
NNTP-Posting-Host ac7042a4.news.twtelecom.net
X-Trace DXC=^JZ]RhCWX7>E@ZX[:2Fm`8C_A=>8kQj6=hHXa^^g6TZ40YRlYa_kVh?EFiONJ7[Go69Mh9lVBG3O=
X-Complaints-To abuse@twtelecom.net
Xref x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:7693

Show key headers only | View raw


David:
Thanks. Your suggestions would be useful if I were interested in exploring
the cosine function.  However, I was interested in exploring 
Cos[MachinePrecisionNumbers].
(actually, some other numerical functions. I just used cos to simplify 
the example).

  My interest was whether the numerical subroutine reflected the 
mathematical functions and
were appropriately monotonic in small ranges.  Looking "microscopically" 
one expects to see some kind of step function,
but if poorly implemented there may be some reversals-- i.e. local 
extrema-- that are not
mathematically justified, but are effects of the implemented algorithm, 
roundoff, etc.

I found that Mathematica refused to plot the most straightforward 
versions of these
investigations.


As far as why the powers of 2 instead of 10,  the fraction part of a 
machine float x has, as one
unit in the last place,  one part in  2^(52)  of x.    I find 2^-52 to 
be much nicer to look at than

2.220446049250313*^-16

as well as more accurate.




  On 1/8/2012 10:03 AM, David Park wrote:
> Small domains and small intervals are often treated masochistically. And why
> the powers of 2 instead of 10?
>
> This is the easy way to make the plots. Use a reasonable domain and range
> and enough WorkingPrecision.
>
> With[{n = 140},
>   Plot[(Cos[x 10^-n + 1] - Cos[1]) 10^n, {x, 0, 1},
>    WorkingPrecision ->  n + 3,
>    Frame ->  True,
>    FrameLabel ->  {(y - 1) 10.^n, 10.^n (Cos[y] - Cos[1])}]
>   ]
>
> Or use a series expansion:
>
> Series[10^n (Cos[1 + x 10^-n] - Cos[1]), {x, 0, 2}] // Normal
>
> -2^(-1 - n) 5^-n x^2 Cos[1] - x Sin[1]
>
> and then use MachinePrecision:
>
> With[{n = 145},
>   Plot[-2^(-1 - n) 5^-n x^2 Cos[1] - x Sin[1], {x, 0, 1},
>    WorkingPrecision ->  MachinePrecision,
>    Frame ->  True,
>    FrameLabel ->  {(y - 1) 10.^n, 10.^n (Cos[y] - Cos[1])}]
>   ]
>
> That is the way they do it in technical journals all the time.
>
>
> David Park
> djmpark@comcast.net
> http://home.comcast.net/~djmpark/index.html
>
>
>
>
>
>
> From: Richard Fateman [mailto:fateman@cs.berkeley.edu]
>
>
> try this (I did it on version 7...)
> Table[Plot[Cos[x], {x, 1 , 1 + 2.0^-i}], {i, 40, 45}]
>

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

JordanDecompose[] Leslaw Bieniasz <nbbienia@cyf-kr.edu.pl> - 2012-01-05 11:01 +0000
  Re: JordanDecompose[] danl@wolfram.com - 2012-01-06 09:16 +0000
    For a variety of plotting experiences, maybe bugs? (small intervals) Richard Fateman <fateman@cs.berkeley.edu> - 2012-01-08 09:23 +0000
    Re: JordanDecompose[] Leslaw Bieniasz <nbbienia@cyf-kr.edu.pl> - 2012-01-09 08:16 +0000
      Re: JordanDecompose[] danl@wolfram.com - 2012-01-10 10:59 +0000
    RE:  For a variety of plotting experiences, maybe bugs? (small intervals) "David Park" <djmpark@comcast.net> - 2012-01-09 08:25 +0000
    Re:  For a variety of plotting experiences, maybe bugs? Richard Fateman <fateman@eecs.berkeley.edu> - 2012-01-09 08:26 +0000

csiph-web