From: Richard Fateman Subject: Re: Strange plotting behaviour of Maple V.5 - possibly a bug? (Re: Date: Tue, 24 Oct 2000 14:55:55 -0700 Newsgroups: sci.math.symbolic,comp.soft-sys.math.maple I just tried Plot[(1+1/n)^n,{n,C}] in Mathematica 3.0 and got a nice sawtooth curve. This is not a consequence of plotting point up, point down etc. The plot actually includes intermediate points going up and down. Macsyma 2.2 defaults to plotting (1+1/n)^n in single floats, which leads it astray at even smaller values. However plotting (1+1.0D0/n)^n does somewhat better. Yet it has problems with this example too, ending up with a blank plot. Seems something is throwing a fit, perhaps overflowing. RJF Robert Israel wrote: > > In article <39F48563.9C5F5C01@fmi.uni-konstanz.de>, > Gottfried Barthel wrote: > > >motivated by the above posting, I wanted to have a look at the graph of > >the (linearly interpolated) sequence, so for some positive integers a, > >b, a < b, I run the following command in Maple V.5 (on a SUN Ultra 10): > > >> plot([seq([n, (1-1/n)^n],n=a..b); > > >That works nicely for small ranges, but for [a,b]=[101,200], the > >horizontal (n)-axis surprisingly ends somewhere near 143, and the range > >[a,b]=[151,200] yields an empty plot. More precisely, for > >[a,b]=[141,200] the displayed n-range is [141,142], and the plot is a > >line joining [141, .366571...] and [142, .366580...], so that's fine; > >for [a,b]=[142,200] the displayed n-range is [142,143], and the plot > >shows just that part of the horizontal axis, and the interval -0.62..1.4 > >on the vertical axis, but no curve; for [a,b]=[143,200] I get an empty > >plot. > > >Is there any reasonable explanation for that strange behaviour? > > The problem is that if n >= 143, (1-1/n)^n is a fraction whose > numerator and denominator are integers that are too big to be represented > as hardware floats (the largest possible hardware float being > approximately 10^308). The result is that evalhf (which is called > by plot) returns Float(undefined). > > It works if you use evalf on your list, or if you use plots[pointplot] > instead of plot. BTW, plots[pointplot] is also much faster for plotting > long lists of points. > > Robert Israel israel@math.ubc.ca > Department of Mathematics http://www.math.ubc.ca/~israel > University of British Columbia > Vancouver, BC, Canada V6T 1Z2