axiom-math
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-math] Curious behavior of Taylor series


From: Ralf Hemmecke
Subject: Re: [Axiom-math] Curious behavior of Taylor series
Date: Mon, 21 Aug 2006 09:37:46 +0200
User-agent: Thunderbird 1.5.0.5 (X11/20060719)

On 08/21/2006 03:38 AM, Jay Belanger wrote:
Martin Rubey <address@hidden> writes:

"Igor Khavkine" <address@hidden> writes:

Can someone explain the following behavior of Taylor series in Axiom?

(113) -> y := taylor x
   (113)  x
                         Type: UnivariateTaylorSeries(Expression Integer,x,0)
(114) -> x*y
   (114)  x x
                         Type: UnivariateTaylorSeries(Expression Integer,x,0)
(115) -> coefficient(%,1)
   (115)  x
                                                     Type: Expression Integer
The reason is that Axiom cannot really know whether you meant x in (114) to be
an element of the coefficient Ring EXPR INT, or to be a univariate Taylor
series. In case of doubt, it usually chooses the wrong possibility :-)

When multiplying two elements, shouldn't Axiom try to coerce them to
be in the same structure?  (I realize it doesn't, particularly here,
but wouldn't that be reasonable behavior?)

But Axiom coerced the two x to the same domain!!! The first x is a coefficient, and the second x is the variable from the Taylor series. So you cannot complain.

The only problem is that it is terribly confusing. Unfortunately, I cannot even blame that the user did anything wrong since Axiom came up with this strange type UnivariateTaylorSeries(Expression Integer,x,0).

But I could blame the user for trying to do "x * y". Here you instruct the compiler to guess since there is no function

*: (Symbol, UTS(Expression Integer,x,0))->UTS(Expression Integer,x,0)

so the interpreter has to do something with the x. It coerces it to Expression(Integer). That is perfectly legal. But it is probably not what you want. Once again. The result "x x" for "x*y" shows two DIFFERENT x.

Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]