realpart strangeness, was: besselarray bug, was: Bessel plotting problem



Robert Dodier escribi?:
> On 6/10/08, Richard Hennessy <rvh2007 at comcast.net> wrote:
> 
>> I downloaded the new bessel.lisp and still get an error.
>>
>>  (%i75) draw2d(parametric(realpart(bessel_j(1/6,-(sqrt(1)*t^3)/3)*sqrt(t)), imagpart(bessel_j(1/6,-(sqrt(1)*t)/3)*sqrt(t)), t, -3, 3))$
>>
>> Maxima encountered a Lisp error:
>>
>>  Error in > [or a callee]: ((MTIMES SIMP) 0.32163376045133785
>>                             ((MPLUS SIMP) 0.22273258887231484
>>                              ((MTIMES SIMP) 0.12859472014273318 $%I))) is not of type (OR
>>                                                                                        RATIONAL
>>                                                                                        LISP:FLOAT).
> 
> OK -- there are 2 errors here.
> 
> The less serious is that draw2d doesn't handle non-float values gracefully.
> 

The origin of the problem is that draw expects the returned values of 
functions defined by coerce-float-fun in plot.lisp to be always real 
numbers, but sometimes they are and sometimes they are not.

The above complex result was returned by

(funcall fcn x)

where fcn was previously defined via coerce-float-fun

For example, this problem appears here:

draw2d(explicit(bessel_j(1/6,-t), t, 1, 3)) $

but not here:

draw2d(explicit(sqrt((%i+x/5)^3), x, 1, 3)) $

I suppose that draw should make some tests after calling functions 
created by coerce-float-fun.




-- 
Mario Rodriguez Riotorto
http://www.telefonica.net/web2/biomates