From 2092a554d70524bc90440d96367e32c9ede28ee8 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 25 Oct 2011 03:47:29 +0000 Subject: * algebra/perman.spad.pamphlet (Permanent): Specify type of local variable j. * algebra/patmatch1.spad.pamphlet (PatternMatchTools): Tidy. * algebra/padic.spad.pamphlet: Restrict type of literal constants. * algebra/sttf.spad.pamphlet: Likewise. * algebra/puiseux.spad.pamphlet: Likewise. * algebra/odealg.spad.pamphlet (SystemODESolver) [applyLodo0]: Specify type of local variable ans. * algebra/numtheor.spad.pamphlet (IntegerNumberTheoryFunctions): Tidy. * algebra/naalgc.spad.pamphlet (MonadWithUnit) [rightPower]: Specify type of local variable res. [leftPower]: Likewise. * algebra/lodop.spad.pamphlet (NonCommutativeOperatorDivision) [leftLcm]: Specify type of local variable v. * algebra/intfact.spad.pamphlet (IntegerRoots) [approxSqrt]: Specify type of local variables old and new. * algebra/elfuts.spad.pamphlet (EllipticFunctionsUnivariateTaylorSeries): Restrict types of literal constants. * algebra/ffnb.spad.pamphlet (FiniteFieldNormalBasisExtensionByPolynomial): Likewise. * algebra/fnla.spad.pamphlet (FreeNilpotentLie): Likewise. * algebra/intaux.spad.pamphlet (IntegrationResult): Likewise. * algebra/defintef.spad.pamphlet (ElementaryFunctionDefiniteIntegration) [checkSMP]: Specify type in the definition of local variable n. * algebra/combinat.spad.pamphlet (IntegerCombinatoricFunctions): Tidy definition of local variables. * algebra/clifford.spad.pamphlet (CliffordAlgebra): Specify type in the definition of local variables k, exchanges, bz. * algebra/catdef.spad.pamphlet (CartesianTensor): Specify type in the definition of local varibles rx and offz. Remove useless variables zol, xol, oly, and zoly. --- src/algebra/sttf.spad.pamphlet | 98 +++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'src/algebra/sttf.spad.pamphlet') diff --git a/src/algebra/sttf.spad.pamphlet b/src/algebra/sttf.spad.pamphlet index f65e7bbc..682d3fb7 100644 --- a/src/algebra/sttf.spad.pamphlet +++ b/src/algebra/sttf.spad.pamphlet @@ -134,7 +134,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where expre(r,e,dx) == lazyIntegrate(r,e*dx) exp z == - empty? z => 1 :: ST + empty? z => 1@Coef :: ST (coef := frst z) = 0 => YS expre(1,#1,deriv z) TRANSFCN => YS expre(exp coef,#1,deriv z) error concat("exp: ",TRCONST) @@ -165,7 +165,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where -- [lazyIntegrate(rs,st1),lazyIntegrate(rc,st2)] sincos z == - empty? z => [0 :: ST,1 :: ST] + empty? z => [0@Coef :: ST,1@Coef :: ST] l := (coef := frst z) = 0 => YS(sincosre(0,1,#1,deriv z,-1),2) TRANSFCN => YS(sincosre(sin coef,cos coef,#1,deriv z,-1),2) @@ -176,7 +176,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where cos z == sincos(z).cos tanre:(Coef,ST,ST,Coef) -> ST - tanre(r,t,dx,sign) == lazyIntegrate(r,((1 :: ST) + sign*t*t)*dx) + tanre(r,t,dx,sign) == lazyIntegrate(r,((1@Coef :: ST) + sign*t*t)*dx) -- When the compiler had difficulties with the above definition, -- I did the following to help it: @@ -191,13 +191,13 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where -- lazyIntegrate(r,st1) tan z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (coef := frst z) = 0 => YS tanre(0,#1,deriv z,1) TRANSFCN => YS tanre(tan coef,#1,deriv z,1) error concat("tan: ",TRCONST) cotre:(Coef,ST,ST) -> ST - cotre(r,t,dx) == lazyIntegrate(r,-((1 :: ST) + t*t)*dx) + cotre(r,t,dx) == lazyIntegrate(r,-((1@Coef :: ST) + t*t)*dx) -- When the compiler had difficulties with the above definition, -- I did the following to help it: @@ -218,7 +218,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where error concat("cot: ",TRCONST) sec z == - empty? z => 1 :: ST + empty? z => 1@Coef :: ST frst z = 0 => recip(cos z) :: ST TRANSFCN => cosz := cos z @@ -245,12 +245,12 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where "failed" asin z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (coef := frst z) = 0 => - integrate(0,powern(-1/2,(1 :: ST) - z*z) * (deriv z)) + integrate(0,powern(-1/2,(1@Coef :: ST) - z*z) * (deriv z)) TRANSFCN => coef = 1 or coef = -1 => - x := (1 :: ST) - z*z + x := (1@Coef :: ST) - z*z -- compute order of 'x' (ord := orderOrFailed x) case "failed" => error concat("asin: ",MAYFPOW) @@ -260,7 +260,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where (quot := (deriv z) exquo squirt) case "failed" => error concat("asin: ",NOTINV) integrate(asin coef,quot :: ST) - integrate(asin coef,powern(-1/2,(1 :: ST) - z*z) * (deriv z)) + integrate(asin coef,powern(-1/2,(1@Coef :: ST) - z*z) * (deriv z)) error concat("asin: ",TRCONST) acos z == @@ -270,7 +270,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where TRANSFCN => coef := frst z coef = 1 or coef = -1 => - x := (1 :: ST) - z*z + x := (1@Coef :: ST) - z*z -- compute order of 'x' (ord := orderOrFailed x) case "failed" => error concat("acos: ",MAYFPOW) @@ -280,15 +280,15 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where (quot := (-deriv z) exquo squirt) case "failed" => error concat("acos: ",NOTINV) integrate(acos coef,quot :: ST) - integrate(acos coef,-powern(-1/2,(1 :: ST) - z*z) * (deriv z)) + integrate(acos coef,-powern(-1/2,(1@Coef :: ST) - z*z) * (deriv z)) error concat("acos: ",TRCONST) atan z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (coef := frst z) = 0 => - integrate(0,(recip((1 :: ST) + z*z) :: ST) * (deriv z)) + integrate(0,(recip((1@Coef :: ST) + z*z) :: ST) * (deriv z)) TRANSFCN => - (y := recip((1 :: ST) + z*z)) case "failed" => + (y := recip((1@Coef :: ST) + z*z)) case "failed" => error concat("atan: ",LOGS) integrate(atan coef,(y :: ST) * (deriv z)) error concat("atan: ",TRCONST) @@ -298,7 +298,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where TRANSFCN => acot(0)$Coef :: ST error concat("acot: ",TRCONST) TRANSFCN => - (y := recip((1 :: ST) + z*z)) case "failed" => + (y := recip((1@Coef :: ST) + z*z)) case "failed" => error concat("acot: ",LOGS) integrate(acot frst z,-(y :: ST) * (deriv z)) error concat("acot: ",TRCONST) @@ -309,7 +309,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where (coef := frst z) = 0 => error "asec: constant coefficient should not be 0" coef = 1 or coef = -1 => - x := z*z - (1 :: ST) + x := z*z - (1@Coef :: ST) -- compute order of 'x' (ord := orderOrFailed x) case "failed" => error concat("asec: ",MAYFPOW) @@ -321,7 +321,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where (quot2 := (quot :: ST) exquo z) case "failed" => error concat("asec: ",NOTINV) integrate(asec coef,quot2 :: ST) - integrate(asec coef,(powern(-1/2,z*z-(1::ST))*(deriv z)) / z) + integrate(asec coef,(powern(-1/2,z*z-(1@Coef::ST))*(deriv z)) / z) error concat("asec: ",TRCONST) acsc z == @@ -330,7 +330,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where (coef := frst z) = 0 => error "acsc: constant coefficient should not be zero" coef = 1 or coef = -1 => - x := z*z - (1 :: ST) + x := z*z - (1@Coef :: ST) -- compute order of 'x' (ord := orderOrFailed x) case "failed" => error concat("acsc: ",MAYFPOW) @@ -342,13 +342,13 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where (quot2 := (quot :: ST) exquo z) case "failed" => error concat("acsc: ",NOTINV) integrate(acsc coef,quot2 :: ST) - integrate(acsc coef,-(powern(-1/2,z*z-(1::ST))*(deriv z)) / z) + integrate(acsc coef,-(powern(-1/2,z*z-(1@Coef::ST))*(deriv z)) / z) error concat("acsc: ",TRCONST) --% Hyperbolic Trigonometric Functions sinhcosh z == - empty? z => [0 :: ST,1 :: ST] + empty? z => [0@Coef :: ST,1@Coef :: ST] l := (coef := frst z) = 0 => YS(sincosre(0,1,#1,deriv z,1),2) TRANSFCN => YS(sincosre(sinh coef,cosh coef,#1,deriv z,1),2) @@ -359,7 +359,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where cosh z == sinhcosh(z).cosh tanh z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (coef := frst z) = 0 => YS tanre(0,#1,deriv z,-1) TRANSFCN => YS tanre(tanh coef,#1,deriv z,-1) error concat("tanh: ",TRCONST) @@ -381,10 +381,10 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where recip(sinhz) :: ST asinh z == - empty? z => 0 :: ST - (coef := frst z) = 0 => log(z + powern(1/2,(1 :: ST) + z*z)) + empty? z => 0@Coef :: ST + (coef := frst z) = 0 => log(z + powern(1/2,(1@Coef :: ST) + z*z)) TRANSFCN => - x := (1 :: ST) + z*z + x := (1@Coef :: ST) + z*z -- compute order of 'x', in case coefficient(z,0) = +- %i (ord := orderOrFailed x) case "failed" => error concat("asinh: ",MAYFPOW) @@ -401,7 +401,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where TRANSFCN => coef := frst z coef = 1 or coef = -1 => - x := z*z - (1 :: ST) + x := z*z - (1@Coef :: ST) -- compute order of 'x' (ord := orderOrFailed x) case "failed" => error concat("acosh: ",MAYFPOW) @@ -409,16 +409,16 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where odd? order => error concat("acosh: ",FPOWERS) -- the argument to 'log' must have a non-zero constant term log(z + powern(1/2,x)) - log(z + powern(1/2,z*z - (1 :: ST))) + log(z + powern(1/2,z*z - (1@Coef :: ST))) error concat("acosh: ",TRCONST) atanh z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (coef := frst z) = 0 => - (inv(2::RN)::Coef) * log(((1 :: ST) + z)/((1 :: ST) - z)) + (inv(2::RN)::Coef) * log(((1@Coef :: ST) + z)/((1@Coef :: ST) - z)) TRANSFCN => coef = 1 or coef = -1 => error concat("atanh: ",LOGS) - (inv(2::RN)::Coef) * log(((1 :: ST) + z)/((1 :: ST) - z)) + (inv(2::RN)::Coef) * log(((1@Coef :: ST) + z)/((1@Coef :: ST) - z)) error concat("atanh: ",TRCONST) acoth z == @@ -427,7 +427,7 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where error concat("acoth: ",TRCONST) TRANSFCN => frst z = 1 or frst z = -1 => error concat("acoth: ",LOGS) - (inv(2::RN)::Coef) * log((z + (1 :: ST))/(z - (1 :: ST))) + (inv(2::RN)::Coef) * log((z + (1@Coef :: ST))/(z - (1@Coef :: ST))) error concat("acoth: ",TRCONST) asech z == @@ -435,27 +435,27 @@ StreamTranscendentalFunctions(Coef): Exports == Implementation where TRANSFCN => (coef := frst z) = 0 => error concat("asech: ",NPOWLOG) coef = 1 or coef = -1 => - x := (1 :: ST) - z*z + x := (1@Coef :: ST) - z*z -- compute order of 'x' (ord := orderOrFailed x) case "failed" => error concat("asech: ",MAYFPOW) (order := ord :: I) = -1 => return asech(coef) :: ST odd? order => error concat("asech: ",FPOWERS) - log(((1 :: ST) + powern(1/2,x))/z) - log(((1 :: ST) + powern(1/2,(1 :: ST) - z*z))/z) + log(((1@Coef :: ST) + powern(1/2,x))/z) + log(((1@Coef :: ST) + powern(1/2,(1@Coef :: ST) - z*z))/z) error concat("asech: ",TRCONST) acsch z == empty? z => error "acsch: acsch(0) is undefined" TRANSFCN => frst z = 0 => error concat("acsch: ",NPOWLOG) - x := z*z + (1 :: ST) + x := z*z + (1@Coef :: ST) -- compute order of 'x' (ord := orderOrFailed x) case "failed" => error concat("acsc: ",MAYFPOW) (order := ord :: I) = -1 => return acsch(frst z) :: ST odd? order => error concat("acsch: ",FPOWERS) - log(((1 :: ST) + powern(1/2,x))/z) + log(((1@Coef :: ST) + powern(1/2,x))/z) error concat("acsch: ",TRCONST) @ @@ -563,7 +563,7 @@ StreamTranscendentalFunctionsNonCommutative(Coef): _ --% Exponentials and Logarithms exp z == - empty? z => 1 :: ST + empty? z => 1@Coef :: ST (frst z) = 0 => expx := exp(monom(1,1))$STTF compose(expx,z) @@ -581,21 +581,21 @@ StreamTranscendentalFunctionsNonCommutative(Coef): _ --% Trigonometric Functions sin z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (frst z) = 0 => sinx := sin(monom(1,1))$STTF compose(sinx,z) error concat("sin: ",ZERO) cos z == - empty? z => 1 :: ST + empty? z => 1@Coef :: ST (frst z) = 0 => cosx := cos(monom(1,1))$STTF compose(cosx,z) error concat("cos: ",ZERO) tan z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (frst z) = 0 => tanx := tan(monom(1,1))$STTF compose(tanx,z) @@ -607,7 +607,7 @@ StreamTranscendentalFunctionsNonCommutative(Coef): _ error concat("cot: ",ZERO) sec z == - empty? z => 1 :: ST + empty? z => 1@Coef :: ST (frst z) = 0 => secx := sec(monom(1,1))$STTF compose(secx,z) @@ -619,14 +619,14 @@ StreamTranscendentalFunctionsNonCommutative(Coef): _ error concat("csc: ",ZERO) asin z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (frst z) = 0 => asinx := asin(monom(1,1))$STTF compose(asinx,z) error concat("asin: ",ZERO) atan z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (frst z) = 0 => atanx := atan(monom(1,1))$STTF compose(atanx,z) @@ -640,21 +640,21 @@ StreamTranscendentalFunctionsNonCommutative(Coef): _ --% Hyperbolic Trigonometric Functions sinh z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (frst z) = 0 => sinhx := sinh(monom(1,1))$STTF compose(sinhx,z) error concat("sinh: ",ZERO) cosh z == - empty? z => 1 :: ST + empty? z => 1@Coef :: ST (frst z) = 0 => coshx := cosh(monom(1,1))$STTF compose(coshx,z) error concat("cosh: ",ZERO) tanh z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (frst z) = 0 => tanhx := tanh(monom(1,1))$STTF compose(tanhx,z) @@ -666,7 +666,7 @@ StreamTranscendentalFunctionsNonCommutative(Coef): _ error concat("coth: ",ZERO) sech z == - empty? z => 1 :: ST + empty? z => 1@Coef :: ST (frst z) = 0 => sechx := sech(monom(1,1))$STTF compose(sechx,z) @@ -678,14 +678,14 @@ StreamTranscendentalFunctionsNonCommutative(Coef): _ error concat("csch: ",ZERO) asinh z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (frst z) = 0 => asinhx := asinh(monom(1,1))$STTF compose(asinhx,z) error concat("asinh: ",ZERO) atanh z == - empty? z => 0 :: ST + empty? z => 0@Coef :: ST (frst z) = 0 => atanhx := atanh(monom(1,1))$STTF compose(atanhx,z) -- cgit v1.2.3