diff options
Diffstat (limited to 'src/algebra/interval.spad.pamphlet')
-rw-r--r-- | src/algebra/interval.spad.pamphlet | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/algebra/interval.spad.pamphlet b/src/algebra/interval.spad.pamphlet index a15715c9..db070f59 100644 --- a/src/algebra/interval.spad.pamphlet +++ b/src/algebra/interval.spad.pamphlet @@ -131,7 +131,7 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa positive?(u:%):Boolean == inf(u) > 0 negative?(u:%):Boolean == sup(u) < 0 - _< (a:%,b:%):Boolean == + a:% < b:% == if inf(a) < inf(b) then true else if inf(a) > inf(b) then @@ -139,19 +139,19 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa else sup(a) < sup(b) - _+ (a:%,b:%):% == + a:% + b:% == -- A couple of blatent hacks to preserve the Ring Axioms! if zero?(a) then return(b) else if zero?(b) then return(a) if a = b then return qinterval(2*inf(a),2*sup(a)) qinterval(inf(a) + inf(b), sup(a) + sup(b)) - _- (a:%,b:%):% == + a:% - b:% == if zero?(a) then return(-b) else if zero?(b) then return(a) if a = b then 0 else qinterval(inf(a) - sup(b), sup(a) - inf(b)) - _* (a:%,b:%):% == + a:% * b:% == -- A couple of blatent hacks to preserve the Ring Axioms! if one?(a) then return(b) else if one?(b) then return(a) if zero?(a) then return(0) else if zero?(b) then return(0) @@ -160,7 +160,7 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa qinterval(first prods, last prods) - _* (a:Integer,b:%):% == + a:Integer * b:% == if (a > 0) then qinterval(a*inf(b),a*sup(b)) else if (a < 0) then @@ -168,18 +168,18 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa else 0 - _* (a:PositiveInteger,b:%):% == qinterval(a*inf(b),a*sup(b)) + a:PositiveInteger * b:% == qinterval(a*inf(b),a*sup(b)) - _*_* (a:%,n:PositiveInteger):% == + a:% ** n:PositiveInteger == contains?(a,0) and zero?((n pretend Integer) rem 2) => interval(0,max(inf(a)**n,sup(a)**n)) interval(inf(a)**n,sup(a)**n) - _- (a:%):% == exactInterval(-sup(a),-inf(a)) + -(a:%) == exactInterval(-sup(a),-inf(a)) - _= (a:%,b:%):Boolean == (inf(a)=inf(b)) and (sup(a)=sup(b)) - _~_= (a:%,b:%):Boolean == (inf(a)~=inf(b)) or (sup(a)~=sup(b)) + a:% = b:% == (inf(a)=inf(b)) and (sup(a)=sup(b)) + a:% ~= b:% == (inf(a)~=inf(b)) or (sup(a)~=sup(b)) 1 == one : R := normaliseFloat 1 @@ -195,7 +195,7 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa unit?(u:%):Boolean == contains?(u,0) - _exquo(u:%,v:%):Union(%,"failed") == + (u:% exquo v:%): Union(%,"failed") == contains?(v,0) => "failed" one?(v) => u u=v => 1 @@ -256,7 +256,7 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa exp(u:%):% == qinterval(exp inf u, exp sup u) - _*_* (u:%,v:%):% == + u:% ** v:% == zero?(v) => if zero?(u) then error "0**0 is undefined" else 1 one?(u) => 1 expts : List R := sort [inf(u)**inf(v),sup(u)**sup(v), @@ -490,7 +490,7 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa -- From RadicalCategory - _*_* (u:%,n:Fraction Integer):% == interval(inf(u)**n,sup(u)**n) + u:% ** n:Fraction Integer == interval(inf(u)**n,sup(u)**n) @ \section{License} |