aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/manip.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/manip.spad.pamphlet')
-rw-r--r--src/algebra/manip.spad.pamphlet30
1 files changed, 10 insertions, 20 deletions
diff --git a/src/algebra/manip.spad.pamphlet b/src/algebra/manip.spad.pamphlet
index e112a811..17fb455a 100644
--- a/src/algebra/manip.spad.pamphlet
+++ b/src/algebra/manip.spad.pamphlet
@@ -33,8 +33,7 @@ FactoredFunctions(M:IntegralDomain): Exports == Implementation where
Implementation ==> add
nthRoot(ff, n) ==
coeff:M := 1
--- radi:List(M) := (one? unit ff => empty(); [unit ff])
- radi:List(M) := (((unit ff) = 1) => empty(); [unit ff])
+ radi:List(M) := (one? unit ff => empty(); [unit ff])
lf := factors ff
d:N :=
empty? radi => gcd(concat(n, [t.exponent::N for t in lf]))::N
@@ -100,8 +99,7 @@ PolynomialRoots(E, V, R, P, F):Exports == Implementation where
zroot : (Z, N) -> Record(exponent:N, coef:Z, radicand:Z)
zroot(x, n) ==
--- zero? x or one? x => [1, x, 1]
- zero? x or (x = 1) => [1, x, 1]
+ zero? x or one? x => [1, x, 1]
s := nthRoot(squareFree x, n)
[s.exponent, s.coef, */s.radicand]
@@ -164,8 +162,7 @@ PolynomialRoots(E, V, R, P, F):Exports == Implementation where
else nthr(x, n) == nthRoot(squareFree x, n)
froot(x, n) ==
--- zero? x or one? x => [1, x, 1]
- zero? x or (x = 1) => [1, x, 1]
+ zero? x or one? x => [1, x, 1]
sn := nthr(numer x, n)
sd := nthr(denom x, n)
pn := rsplit(sn.radicand)
@@ -358,18 +355,15 @@ AlgebraicManipulations(R, F): Exports == Implementation where
q := univariate(p, k)
while (d := degree q) > 0 repeat
term :=
--- one?(g := gcd(d, n)) => monomial(1, k, d)
- ((g := gcd(d, n)) = 1) => monomial(1, k, d)
+ one?(g := gcd(d, n)) => monomial(1, k, d)
monomial(1, kernel(operator k, [a,(n quo g)::F], height k), d quo g)
ans := ans + leadingCoefficient(q)::F * term::F
q := reductum q
leadingCoefficient(q)::F + ans
inroot(op, x, n) ==
--- one? x => x
- (x = 1) => x
--- (x ~= -1) and (one?(num := numer x) or (num = -1)) =>
- (x ~= -1) and (((num := numer x) = 1) or (num = -1)) =>
+ one? x => x
+ (x ~= -1) and (one?(num := numer x) or (num = -1)) =>
inv inroot(op, (num * denom x)::F, n)
(u := isExpt(x, op)) case "failed" => kernel(op, [x, n::F])
pr := u::Record(var:K, exponent:Integer)
@@ -648,13 +642,11 @@ TranscendentalManipulations(R, F): Exports == Implementation where
not (terms case "failed") => logArgs(terms)
expt : Union(POW, "failed") := isPower(e)
--- (expt case POW) and not one? expt.exponent =>
- (expt case POW) and not (expt.exponent = 1) =>
+ (expt case POW) and not one? expt.exponent =>
simplifyLog(expt.val)**(expt.exponent)
kers : List K := kernels e
--- not(one?(#kers)) => e -- Have a constant
- not(((#kers) = 1)) => e -- Have a constant
+ not(one?(#kers)) => e -- Have a constant
kernel(operator first kers,[simplifyLog(u) for u in argument first kers])
@@ -666,10 +658,8 @@ TranscendentalManipulations(R, F): Exports == Implementation where
expandpow k ==
a := expandPower first(arg := argument k)
b := expandPower second arg
--- ne:F := (one? numer a => 1; numer(a)::F ** b)
- ne:F := (((numer a) = 1) => 1; numer(a)::F ** b)
--- de:F := (one? denom a => 1; denom(a)::F ** (-b))
- de:F := (((denom a) = 1) => 1; denom(a)::F ** (-b))
+ ne:F := (one? numer a => 1; numer(a)::F ** b)
+ de:F := (one? denom a => 1; denom(a)::F ** (-b))
ne * de
termexp p ==