>>>>> "Raymond" == Raymond Toy <rtoy@earthlink.net> writes:
Raymond> Raymond Toy wrote:
>>>>>>> "James" == James Amundson <amundson@fnal.gov> writes:
James> I think you are asking the right question. When the dumb
>> approach fails,
James> it is obvious why and obvious what to do to fix it. Being smart about
James> plotting is only useful if we are smart enough about it. I am not yet
James> convinced that we are. What happens if you plot sin(1/x) near x=0?
>> FWIW, a google search for "adaptive plotting" returns the following
>> interesting page from yacas:
>> http://homepage.mac.com/yacas/manual/Algochapter3.html
>>
Raymond> Well, is a straightforward port of this algorithm. I've appended it
Raymond> below. Just replace draw2d in plot.lisp with the following. It works
Raymond> pretty well for these bugs, and does a pretty good job with
Raymond> sin(1/x). Unfortunately, plot2d(1/(x-0.5),[x,0,1]) gives a division by
Raymond> 0 error.
Assuming no news is good news :-), this adaptive plotting routine has
been committed, basically as is.
I think new plot options should defined so the user can select a
different depth and epsilon paramaters if necessary. I haven't done
this, pending good names for the options.
Ray