Sorry, I'm a debbugs noob, so here is the manual forward of the answer I got from DrScheme upstream maintainers.
---------- Forwarded Message ---------- Subject: Re: [plt-bug] all/8866: drscheme: plot produces incorrect graph for exponential function Date: August 12, 2007 From: Eli Barzilay <[EMAIL PROTECTED]> To: [EMAIL PROTECTED], [EMAIL PROTECTED] On Aug 12, [EMAIL PROTECTED] wrote: > The code > > (require (lib "plot.ss" "plot")) > (plot (line (lambda (x) (expt 2 x))) (x-max 30) (y-max 1000)) > > draws a graph which looks like the intended exponential function > from -5 to 11 on the X axis, but later goes down apparently linearly > at 25 to 28, which is obviously not what an exponential graph should > look like. > > The lambda seems to return correct values, so there must be an error > in the plot library. Right. Try this: (plot (line (lambda (x) (expt 1.1 x))) (x-max 300) (y-max 10)) and you'll see and even worse picture. Also note that the line that goes down is a straight line -- which indicates that the problem is in the drawing code (in C) -- not dealing correctly with big integers (so you see a straight line going down to some really big negative number). In both cases, setting a better y-max, like (plot (line (lambda (x) (expt 1.1 x))) (x-max 300) (y-max (expt 1.1 300))) shows a correct picture, which also makes it look that the plplot library is dealing fine with numbers (floating point numbers, probably) but messes up the drawing. Unfortunately, we don't have the resources to deal with bugs in the plplot code... The plot library is in PLT in "minimal maintenance" mode -- a much better implementation would re-do the whole thing in Scheme... -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! -------------------------------------------------------
pgp188hMXS2wY.pgp
Description: PGP signature