> On 23 May 2011 03:05, François <francois.bis...@canterbury.ac.nz> wrote: > > OK I did some analysis on the failure of > > sage -t -long -force_lib "devel/sage/sage/gsl/interpolation.pyx" > > > > A list of point is initialized with: > > v = [(i + sin(i)/2, i+cos(i^2)) for i in range(10)] > > then a spline is created: > > s = spline(v) > > The failure is when we try this: > > show(point(v) + plot(s,0,11, hue=.8)) > > If you do > > show(point(v) + plot(s,0,9, hue=.8)) > > instead it will work. That's because with a spline you are only supposed > > to do interpolation - not extrapolation! The last point in our set has > > 9+sin(9)/2 as its x coordinate, so if we ask x that are over this limit > > (or smaller than 0 for that matter) we have a failure. > > I am guessing previous version of gsl happily gave you an extrapolation. > > Which is fine if you really want one, knowing that it will diverge from > > whatever > > you are trying to approximate very fast. > > So I say the doctest has to be fixed to do something sensible instead of > > what's currently done. > > Francois > > This seems yet anther bad test, I wonder how the expected value of the > test was verified? It rather suggests it was not. > The test was just a sage rewrite of a gsl example (it says so in sage). So you could say it was mindlessly copied. My wording on the use of spline for extrapolation was a polite really really tuned down version from my original thoughts but not everyone seem to grasp the dangers of extrapolation....
Francois This email may be confidential and subject to legal privilege, it may not reflect the views of the University of Canterbury, and it is not guaranteed to be virus free. If you are not an intended recipient, please notify the sender immediately and erase all copies of the message and any attachments. Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more information. -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org