newsimp.cl and taylor



addk is almost ok, except that it uses numberp. From lisp's point of 
view ((rat)...) is not a number, as you well know. addk recieves its 
input from diffexpt. the solution could be either changing diffexpt a 
bit to turs maxima's rationals to lisp's rational, or chaning the 
numberp test in addk (maybe to mnump? but this surprises kindp then... I 
don't know these little pieces of maxima core).
--
Andrei Zorine

Richard Fateman wrote:
> I suspect that Maxima doesn't ever expect common lisp rational numbers.
> Sometimes it almost works OK anyway. For example, (addk 1/2 '((rat) 1 2))
> gives ((rat simp) 2 2), which is close to the right answer 1.
> 
> 
> I do not know of any place where ((rat) 1 2) is changed to 1/2.
> 
> In newsimp I may have used rational numbers simply because I assumed
> that sometime in the future maxima would use common lisp rational
> numbers instead of ((rat) ...)..   Probably newsimp could be
> changed to use ((rat) ...).
> 
> I do not see how addk is causing a problem.
> 
> 
> 
> Andrei Zorine wrote:
> 
>> hello,
>> I tried to taylor() with new simplifier loaded. Here's what I get
>>
>> (C1) load("c:/src/mac/newsimp/newsimp.cl");
>>
>> (D1)              c:/src/mac/newsimp/newsimp.cl
>> (C4) taylor(erf(x),x,0,10);
>>
>>
>> Error: addk given non-constants to add
>> Fast links are on: do (si::use-fast-links nil) for debugging
>> Error signalled by COND.
>> Broken at ERROR.  Type :H for Help.
>> MAXIMA>>:q
>>
>> (C5) -1/2;
>>
>>                     1
>> (D5)                       - -
>>                     2
>> (C6) :lisp(print $d5)
>>
>> -1/2
>> -1/2
>>
>> ....
>>
>> MAXIMA>>(simplifya '((rat) -1 2) t)
>>
>> ((RAT) -1 2)
>> MAXIMA>>(simplifya '((rat) -1 2) nil)
>>
>> ((RAT) -1 2)
>> MAXIMA>>
>>
>> So, where it transform from ((rat)..) to lisp's rational is done??? 
>> It's addk recieves ((rat)...) instead of a number from diffexpt... if 
>> I want to load new definition for diffexpt, what should I write to 
>> transform from ((rat)...) to a rational?
>> -- 
>> Andrei Zorine
>>
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima@www.math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
> 
> 
> 
> 
>