axiom-developer
[Top][All Lists]

## [Axiom-developer] Re: partfrac, expand, combine, rewrite and simplify.

 From: Dylan Thurston Subject: [Axiom-developer] Re: partfrac, expand, combine, rewrite and simplify. Date: Tue, 7 Oct 2003 15:12:01 -0400 User-agent: Mutt/1.5.4i

```On Tue, Oct 07, 2003 at 12:56:51PM -0400, Tim Daly wrote:
> (5) -> aa:UP(x,FRAC INT):=2*x^3
>
>           3
>    (5)  2x
>                                Type: UnivariatePolynomial(x,Fraction Integer)
> (6) -> bb:UP(x,FRAC INT):=1-x^2
>
>            2
>    (6)  - x  + 1
>                                Type: UnivariatePolynomial(x,Fraction Integer)
>
> And the call succeeds:
>
> (7) -> partialFraction(aa,bb)
>
>                  1       1
>    (7)  - 2x - ----- - -----
>                x - 1   x + 1
>                Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)
>
> So partialFraction can create the correct call signature. I suspect the
> interpreter created some intermediate type that it couldn't coerce to
> the required target type. I agree that it should have been able to
> give the factored output but did not.

Note that there is some behaviour which seems to definitely be a bug.  To

(32) -> partialFraction(aa,bb)

1       1
(32)  - 2x - ----- - -----
x - 1   x + 1
Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)
(33) -> partialFraction(2*x^3,bb)

1       1
(33)  - 2x - ----- - -----
x - 1   x + 1
Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)

These are fine, but:

(34) -> partialFraction(aa,1-x^2)

2x
(34)  - 2x - ------
2
x  - 1
Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)

This must be a bug, since the output is not actually a PartialFraction!
(I'm curious if this happens with the NAG version.)

The fact that partialFraction(2*x^3,1-x^2) doesn't work is more of a
wishlist item, since it doesn't give a wrong answer.  Note that
explicitly making the coefficients fractional works:

(3) -> partialFraction(x^3/2, (x^2-1)/2)

1       1
-       -
2       2
(3)  x + ----- + -----
x - 1   x + 1
Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)

But we can see the same bug I mentioned above if only the numerator has
a fraction:

(4) -> partialFraction(x^3/2, x^2-1)

1
- x
1       2
(4)  - x + ------
2      2
x  - 1
Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)

> If you really want to see the struggles the interpreter is going thru try:
>
> )lisp (setq |\$monitorNewWorld| t)
>
> and you can see the interpreter trying to find the correct signature
> using various coercions.

Thanks!  It looks pretty painful, though: I tried to follow it, but failed.

Peace,
Dylan
```

signature.asc
Description: Digital signature