aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/prs.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-12-27 18:48:32 +0000
committerdos-reis <gdr@axiomatics.org>2011-12-27 18:48:32 +0000
commiteb169ea3e54a1b24943255f152b1154b57336bc8 (patch)
treec4bb750ce713fd01467c197a00318e8a956367c3 /src/algebra/prs.spad.pamphlet
parent2181cb4813bbe491a56d32218da2d56508bfccfe (diff)
downloadopen-axiom-eb169ea3e54a1b24943255f152b1154b57336bc8.tar.gz
* algebra/prs.spad.pamphlet (PseudoRemainderSequence): Tidy.
Diffstat (limited to 'src/algebra/prs.spad.pamphlet')
-rw-r--r--src/algebra/prs.spad.pamphlet28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/algebra/prs.spad.pamphlet b/src/algebra/prs.spad.pamphlet
index 1155ee6d..30a5b84f 100644
--- a/src/algebra/prs.spad.pamphlet
+++ b/src/algebra/prs.spad.pamphlet
@@ -858,15 +858,13 @@ PseudoRemainderSequence(R, polR) : Specification == Implementation where
dP : polR := differentiate P
rE := resultantEuclidean(P, dP)
d := d - degree(dP) - 1
- if zero?(d) then
- c1 : polR := a * (rE.coef1 exquo LC(P))::polR
- c2 : polR := a * (rE.coef2 exquo LC(P))::polR
- cr : R := a * (rE.resultant exquo LC(P))::R
- else
- c1 : polR := a * rE.coef1 * LC(P)**(d-1)::NNI
- c2 : polR := a * rE.coef2 * LC(P)**(d-1)::NNI
- cr : R := a * rE.resultant * LC(P)**(d-1)::NNI
- return construct(c1, c2, cr)
+ zero? d =>
+ [a * (rE.coef1 exquo LC(P))::polR,
+ a * (rE.coef2 exquo LC(P))::polR,
+ a * (rE.resultant exquo LC(P))::R]
+ [a * rE.coef1 * LC(P)**(d-1)::NNI,
+ a * rE.coef2 * LC(P)**(d-1)::NNI,
+ a * rE.resultant * LC(P)**(d-1)::NNI]
semiDiscriminantEuclidean(P : polR) :
Record(coef2 : polR, discriminant : R) ==
@@ -877,13 +875,11 @@ PseudoRemainderSequence(R, polR) : Specification == Implementation where
dP : polR := differentiate P
rE := semiResultantEuclidean2(P, dP)
d := d - degree(dP) - 1
- if zero?(d) then
- c2 : polR := a * (rE.coef2 exquo LC(P))::polR
- cr : R := a * (rE.resultant exquo LC(P))::R
- else
- c2 : polR := a * rE.coef2 * LC(P)**(d-1)::NNI
- cr : R := a * rE.resultant * LC(P)**(d-1)::NNI
- return construct(c2, cr)
+ zero? d =>
+ [a * (rE.coef2 exquo LC(P))::polR,
+ a * (rE.resultant exquo LC(P))::R]
+ [a * rE.coef2 * LC(P)**(d-1)::NNI,
+ a * rE.resultant * LC(P)**(d-1)::NNI]
if R has GcdDomain then
resultantReduit(P : polR, Q : polR) : R ==