strange fast_float (?) bug:
>
> On 2012-08-15, P Purkayastha <ppu...@gmail.com> wrote:
>> On 08/15/2012 10:58 PM, Dima Pasechnik wrote:
>>> On 2012-08-15, P Purkayastha<ppu...@gmail.com>  wrote:
>>>> On 08/15/2012 01:47 PM, Dima Pasechnik wrote:
>>>>> The following produces a nice plot, all the way down to the horisontal
>>>>> axis:
>>>>> rr=2.5000000001
>>>>> y=9 -(9/rr)*x^2
>>>>> plot(sqrt(y) ,(-sqrt(rr),sqrt(rr))).show()
>>>>>
>>>>> but changing rr to rr=2.5
>>>>> makes the plot to stop approximately 0.25 units above
>>>>> the horisontal axis.
>>>>>
>>>>> Is this a bug, or a feature?
>>>>> Thanks,
>>>>> Dima
>>>>>
>>>>>
>>>>
>>>> The error comes from quite an unusual stage. Doing set_verbose(1) shows
>>>> us the real reason why it doesn't plot the end points.
>>>>
>>>> sage: set_verbose(1)
>>>> sage: rrr=2.5; yy=9 -(9/rrr)*x**2;  plot(sqrt(yy) ,(-sqrt(rrr),sqrt(rrr)))
>>>> verbose 1 (2392: plot.py, generate_plot_points)
>>>> Unable to compute f(-1.58113883008) (time = -0.044146)
>>>> verbose 1 (2392: plot.py, generate_plot_points)
>>>> Unable to compute f(1.58113883008) (time = -0.044146)
>>>>
>>>> This seems to stem from here:
>>>>               data[i] = (float(xi), float(f(xi)))
>>>>               if str(data[i][1]) in ['nan', 'NaN', 'inf', '-inf']:
>>>>
>>>> Note that f is a "fast_float" version of yy. This version of yy computes
>>>> the value as nan. Computing yy(sqrt(rrr)) itself works just fine.
>>>>
>>> so this is a bug, I suppose... But where?
>>
>> Probably somewhere in fast_float or FastDoubleFunc. I can not say 
>> exactly where because I am unfamiliar with that code.
>>

-- 
-- 
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



Reply via email to