Francois Maltey wrote:
I play with expressions and I have these questions : 1/ Can I (or cannot) remain Expressions as x+1/(y+1) y+1/(x+1) and do not have a single denominator. " title=" Subject: Axiom-developer about Expression Integer Date: 16 Feb 2006 21:33:45 +0100 From: Francois Maltey <fmaltey@nerim.fr> To: axiom-developer@nongnu.org, fmaltey@nerim.fr I play with expressions and I have these questions : 1/ Can I (or cannot) remain Expressions as x+1/(y+1) y+1/(x+1) and do not have a single denominator. " class="equation" src="images/4888188823115559482-16.0px.png" width="433" height="248"/> You can use Fraction Polynomial Integer as their common domain. axiom a:=x + 1/(y+1)
Type: Fraction(Polynomial(Integer)) axiom b:=y + 1/(x+1)
Type: Fraction(Polynomial(Integer))
Axiom also has a package called axiom c:=partialFraction(a,y)$PFRPAC(INT)
Type: PartialFraction(UnivariatePolynomial(y,Fraction(Polynomial(Integer)))) axiom d:=partialFraction(b,x)$PFRPAC(INT)
Type: PartialFraction(UnivariatePolynomial(x,Fraction(Polynomial(Integer)))) The reason for the package call is that Axiom Interpreter will find the wrong axiom partialFraction(a,y)
Type: PartialFraction(UnivariatePolynomial(y,Fraction(Polynomial(Integer)))) This is NOT a bug, but rather a wrong use. The routine axiom partialFraction(numerator a, factor denominator a)
Type: PartialFraction(Fraction(Polynomial(Integer))) Partial fraction can only be done with respect to a single variable at a time, with all other variables considered in a coefficient domain. So in this sense, it is not possible to retain the two expresssions axiom e:= a:: PFR UP(x, FRAC UP(y, FRAC INT))
Type: PartialFraction(UnivariatePolynomial(x,Fraction(UnivariatePolynomial(y,Fraction(Integer))))) axiom f:= b:: PFR UP(y, FRAC UP(x, FRAC INT))
Type: PartialFraction(UnivariatePolynomial(y,Fraction(UnivariatePolynomial(x,Fraction(Integer)))))
At present the codomain of
You can try something like this: axiom )clear all
Type: Domain axiom dom:=UP(y,fraction)
Type: Domain axiom bdom:=PFR dom
Type: Domain axiom a:=x + 1/(y+1)
Type: Fraction(Polynomial(Integer)) axiom b:=partialFraction(a,y)$PFRPAC(INT)
Type: PartialFraction(UnivariatePolynomial(y,Fraction(Polynomial(Integer)))) axiom c:=b::bdom
Type: PartialFraction(UnivariatePolynomial(y,Fraction(Polynomial(Integer)))) axiom cw:=(wholePart c)::EXPR INT
Type: Expression(Integer) axiom m:=numberOfFractionalTerms(c)
Type: PositiveInteger axiom crList:= [nthFractionalTerm(c,i) for i in 1..m]
Type: List(PartialFraction(UnivariatePolynomial(y,Fraction(Polynomial(Integer))))) axiom cc:=reduce(+,crList)
Type: PartialFraction(UnivariatePolynomial(y,Fraction(Polynomial(Integer)))) axiom ccx:=cc::(FRAC dom)::(EXPR INT)
Type: Expression(Integer) axiom sin(cw)*cos(ccx)+sin(ccx)*cos(cw)
Type: Expression(Integer) I would like to add that attempting to create a
>> Error detected within library code:
reducing over an empty list needs the 3 argument form
axiom sin(f:bdom):EXPR INT == fw:=(wholePart f)::EXPR INT n:=numberOfFractionalTerms(f) frList:= [nthFractionalTerm(f,i) for i in 1..n] ff:=reduce(+,frList) ffx:=ff::(FRAC dom)::(EXPR INT) sin(fw)*cos(ffx)+sin(ffx)*cos(fw) Type: Void axiom sin(c) axiom Compiling function sin with type PartialFraction(
UnivariatePolynomial(y,Fraction(Polynomial(Integer)))) ->
Expression(Integer) William |

