Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
1a0e631
Add patch for building factory w/ flint 3.3.0
d-torrance Jun 12, 2025
8435bfc
Merge pull request #4 from d-torrance/intervals
MichaelABurr Jun 30, 2025
22a8b10
Added the CCi type
MichaelABurr Jun 30, 2025
a9dcbab
tostringCCi added
Jun 30, 2025
7c6cdc2
Added conversion functions and mutable CCi
MichaelABurr Jun 30, 2025
bf17233
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Jun 30, 2025
a50f61c
Added CCi to front end
MichaelABurr Jun 30, 2025
a7c27f0
changes in gmp
Jun 30, 2025
86257fd
Merge remote-tracking branch 'refs/remotes/origin/intervals' into int…
Jun 30, 2025
1ec64ad
changes in gmp
Jun 30, 2025
2c3d259
Fixed CCi afterprint
MichaelABurr Jun 30, 2025
f133dbf
changes in gmp
Jun 30, 2025
f5b3c7c
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Jun 30, 2025
35d0bea
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Jun 30, 2025
e3646b1
changes in gmp
Jun 30, 2025
ce7a1bb
changes in gmp1
andrew-tawfeek Jun 30, 2025
839b647
changes in gmp
Jun 30, 2025
d6c971e
Added more to creating CCi's
MichaelABurr Jun 30, 2025
1bf07af
Merged
MichaelABurr Jun 30, 2025
cc4606d
changes in gmp
Jun 30, 2025
1db0ec0
Merge branch 'intervals' of https://github.com/MichaelABurr/M2 into i…
andrew-tawfeek Jun 30, 2025
b7aabc6
changes in actors
Jun 30, 2025
da60a3f
Rename RRball/CCball -> RRb/CCb (for symmetry w/ RRi/CCi)
d-torrance Jul 1, 2025
dc1a7da
Actually, let's call them RRbmutable and CCbmutable
d-torrance Jul 1, 2025
f57988a
changes in actors
Jul 1, 2025
13d074f
Added toCCi functionality for ZZ, QQ, RR
andrew-tawfeek Jul 1, 2025
d868e9c
changes to toCCi
andrew-tawfeek Jul 1, 2025
a2571e7
Added realPart and imagPart
MichaelABurr Jul 1, 2025
0dbcabf
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Jul 1, 2025
5c2aa98
Added demo of two inputs to toCCi
MichaelABurr Jul 1, 2025
cfc6b54
Added CCi to RRi
andrew-tawfeek Jul 1, 2025
7c197b3
toCCi work
andrew-tawfeek Jul 1, 2025
1f28439
More of toCCi
MichaelABurr Jul 1, 2025
e9a3d10
multiplication implemented
Jul 1, 2025
90356b6
integer division by CCi implemented
Jul 1, 2025
a950223
Go back to RRb/CCb naming
d-torrance Jul 1, 2025
6051195
rationals division by CCi implemented
Jul 1, 2025
44d3b72
RR over CCi implemented
Jul 1, 2025
b5c4aa9
Adding interval functions for CCi
MichaelABurr Jul 1, 2025
b5b0301
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Jul 1, 2025
87ce4cc
some trials for spanCCi
klee669 Jul 1, 2025
242654a
some trials for spanCCi
klee669 Jul 1, 2025
9efb6a2
Revert some accidental changes
d-torrance Jul 1, 2025
ea69113
changes in reals
klee669 Jul 1, 2025
19ed512
RRb at top level!
d-torrance Jul 1, 2025
521e73b
toCCi defined for pairs of ZZ, QQ, RR, RRi
andrew-tawfeek Jul 1, 2025
a7a2a0a
RRi division implemented
Jul 1, 2025
9f91908
toCCi for two input done
andrew-tawfeek Jul 1, 2025
8384e34
RRi division implemented
Jul 1, 2025
3240243
CC division implemented
Jul 1, 2025
d4fae3d
promote for CCi' implemented
klee669 Jul 1, 2025
019f417
promote for CCi' implemented
klee669 Jul 1, 2025
e365814
Fix finalization of RRb's
d-torrance Jul 1, 2025
c60c004
Improve printing (and precision, kind of) of RRb's
d-torrance Jul 1, 2025
f552b0c
Construct RRb from RRi
d-torrance Jul 1, 2025
3153cc8
divisions with CCi are implemented
Jul 1, 2025
7e80a93
Begin adding RRb stuff to reals.m2
d-torrance Jul 1, 2025
fcb0f0e
Fix printing of RRb's
d-torrance Jul 1, 2025
a30d0c8
reals updated
klee669 Jul 2, 2025
b4eb0d3
reals updated
klee669 Jul 2, 2025
fb3036b
Finish toRRb constructors
d-torrance Jul 2, 2025
7905039
Fix precision for RRb's
d-torrance Jul 2, 2025
d2075cd
Adding CCi's to reals.m2
MichaelABurr Jul 2, 2025
31f0210
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Jul 2, 2025
8c2e3ca
Add (ring, RRb)
d-torrance Jul 2, 2025
0f07bb8
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Jul 2, 2025
3ab7617
Fixed issue in division
MichaelABurr Jul 2, 2025
ab50335
Add toExpr(RRb,ulong) (and use it in toRRb)
d-torrance Jul 2, 2025
baa65bf
Add addition for RRb's
d-torrance Jul 2, 2025
beaa5fd
Added single inputs to spanRRi
MichaelABurr Jul 2, 2025
306b2d8
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Jul 2, 2025
7ac883a
constructor function interval supports CCi
klee669 Jul 2, 2025
92190e0
Merge remote-tracking branch 'refs/remotes/origin/intervals' into int…
klee669 Jul 2, 2025
5b0fbb1
powers with z
Jul 2, 2025
56f7d93
powers with ZZ
Jul 2, 2025
d075676
added precision to toCCi
andrew-tawfeek Jul 2, 2025
b649e0e
Added spanner for spanning
MichaelABurr Jul 2, 2025
6d4aca9
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Jul 2, 2025
9a75fbe
Merge branch 'intervals' of https://github.com/MichaelABurr/M2 into i…
Jul 2, 2025
00725c6
toCCi precision
andrew-tawfeek Jul 2, 2025
6f05ac6
Merge branch 'intervals' of https://github.com/MichaelABurr/M2 into i…
Jul 2, 2025
d754710
merge
andrew-tawfeek Jul 2, 2025
24c87e0
merging
andrew-tawfeek Jul 2, 2025
a0f3a8c
Add low-level RRb constructors from ZZ/QQ, add RRb + ZZ
d-torrance Jul 2, 2025
f8fd338
merge
andrew-tawfeek Jul 2, 2025
3f82463
CCi to the power of ZZ
Jul 2, 2025
4511f16
Merge branch 'intervals' of https://github.com/MichaelABurr/M2 into i…
Jul 2, 2025
8682928
CCi to the power of ZZ implemented
Jul 2, 2025
f4bbb7b
span function added
klee669 Jul 2, 2025
0d21f7e
RRb plus QQ implemented
Jul 2, 2025
85fc6da
RRb -> RRi conversion
d-torrance Jul 2, 2025
743f8c7
Export CCb to top level
d-torrance Jul 2, 2025
79ccda8
RRb plus RR implemented
Jul 2, 2025
95dc147
additions with RRb implemented
Jul 2, 2025
55ced1e
midpoint for CCi
andrew-tawfeek Jul 2, 2025
8545957
merge
andrew-tawfeek Jul 2, 2025
e18ba01
(an empty interval) tag fixed
klee669 Jul 2, 2025
a2bac6f
(an empty interval) tag fixed
klee669 Jul 2, 2025
91ab790
Add midpoint and radius/diameter for RRb
d-torrance Jul 2, 2025
148fd5a
Fix hash for RRb
d-torrance Jul 2, 2025
1748532
Add realPart/imaginaryPart for CCb
d-torrance Jul 3, 2025
4a6a5b0
Add proper string function for CCb
d-torrance Jul 3, 2025
8bb0193
Add hash function for CCb
d-torrance Jul 3, 2025
04b99fb
Add more CCb constructors
d-torrance Jul 3, 2025
eb660db
CCi as a raw ring element
klee669 Jul 3, 2025
0b05261
midpoint of CCi
andrew-tawfeek Jul 3, 2025
22e3df1
intersect function is added
klee669 Jul 3, 2025
832c97d
isMember for CCi
Jul 3, 2025
5e35526
Merge branch 'intervals' of https://github.com/MichaelABurr/M2 into i…
Jul 3, 2025
62fc4c9
revert changes in reals.m2
klee669 Jul 3, 2025
2d9241e
revert changes in reals.m2
klee669 Jul 3, 2025
e582801
Use unsigned longs for precision
d-torrance Jul 3, 2025
bb37436
isSubset and isMember for CCi implemented
Jul 3, 2025
17f3f2e
merge
andrew-tawfeek Jul 3, 2025
2c22647
merge
andrew-tawfeek Jul 3, 2025
4b99131
basic Documents are added + minor fixes
klee669 Jul 3, 2025
c1960f4
Intervals aring for Anton
MichaelABurr Jul 4, 2025
ff1a7db
Documents for some CCi functions + inverse interval bug fixed
klee669 Jul 4, 2025
6cc5dd3
fixed to_ring_elem
Jul 4, 2025
3bca5ca
Removing debugging code
MichaelABurr Jul 4, 2025
53a4933
Merge
MichaelABurr Jul 4, 2025
f94ad54
Merge pull request #5 from MichaelABurr/intervals2
MichaelABurr Jul 4, 2025
42924a2
new CCi from RawRingElement := (CCCi,x)
Jul 4, 2025
2544659
merge
Jul 4, 2025
de30bfe
Merge branch 'intervals' into intervals2
MichaelABurr Jul 4, 2025
58117af
Merge pull request #6 from MichaelABurr/intervals2
MichaelABurr Jul 4, 2025
1f4e68d
Remove top-level RRb/CCb types
d-torrance Jul 5, 2025
bfe2554
Add CCi <-> CCb conversion functions
d-torrance Jul 8, 2025
c0074e7
Add trig functions for CCi
d-torrance Jul 8, 2025
486c471
Use inheritance for printing inexact fields
d-torrance Jul 8, 2025
28153bc
Add some more special functions for CCi
d-torrance Jul 8, 2025
f853db2
Add gamma function for CCi's
d-torrance Jul 9, 2025
b0e6bb9
Regenerate tvalues.m2 if d directory has been updated
d-torrance Jul 9, 2025
69b9c26
Revert "Regenerate tvalues.m2 if d directory has been updated"
d-torrance Aug 21, 2025
ab05884
CCi support for more special functions
d-torrance Oct 22, 2025
9399c83
Simplify interval w/ one complex argument
d-torrance Oct 22, 2025
22e928e
Pass options to span
d-torrance Oct 22, 2025
082fecb
Update "interval" docs
d-torrance Oct 22, 2025
ecefb3d
Updated "diameter" docs
d-torrance Oct 22, 2025
c4a7e32
Update "midpoint" docs
d-torrance Oct 22, 2025
561b399
Actually fixed "interval"
d-torrance Oct 22, 2025
1e28e15
Update "interval" docs so complex example isn't empty
d-torrance Oct 22, 2025
4b473b3
Move interval, diameter, and midpoint to SeeAlso in CCi doc
d-torrance Oct 23, 2025
6f353fd
Updates to one-argument "interval"
d-torrance Oct 23, 2025
685dc0e
Use Precision option when calling "numeric" in interval(Number)
d-torrance Oct 23, 2025
28344dc
Added a test, fixed some bugs in polynomial rings with CCi and matrices
MichaelABurr Oct 23, 2025
b3a5c93
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Oct 23, 2025
076423a
Add hyperbolic functions, exp, and log for CCi
d-torrance Oct 24, 2025
16fd3b6
Add exponentiation for CCi now that we have exp & log
d-torrance Oct 24, 2025
40678f7
Add agm for both interval types
d-torrance Oct 24, 2025
d351bf2
Add abs(CCi), sign(CCi), and sign(RRi)
d-torrance Oct 24, 2025
b8a5285
abs(CCi) should return an RRi
d-torrance Oct 24, 2025
ec5dfe6
Add sqrt and atan for CCi
d-torrance Oct 24, 2025
b927e4a
Fix numericInterval ii (now returns a CCi instead of an empty RRi)
d-torrance Oct 24, 2025
9b218d4
Simplify span (now a binary method)
d-torrance Oct 24, 2025
4fecd4f
Update span docs
d-torrance Oct 24, 2025
dcd779d
Simplify two-argument "interval" methods
d-torrance Oct 24, 2025
f097a5e
Added == for CCi's
MichaelABurr Oct 27, 2025
6f111b4
Fix 2-argument "interval" when ii is one of the arguments
d-torrance Oct 29, 2025
4f55cfc
Fix precision for 2-argument "interval"
d-torrance Oct 29, 2025
9b3d7cd
fixed the empty interval output when the real parts are zero
Oct 29, 2025
c00544e
Fixing precision in toCCi
MichaelABurr Oct 29, 2025
8f6a3da
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Oct 29, 2025
976f9c9
Added toCCi for CCi input
MichaelABurr Oct 29, 2025
5dd78c4
Add lngamma(CCi)
d-torrance Nov 5, 2025
2f4ea35
Add size2(CCi)
d-torrance Nov 5, 2025
bbbfc4b
Lots o' CCi docs
d-torrance Nov 5, 2025
b0d5c30
Even more CCi docs
d-torrance Nov 7, 2025
3c41263
Add comparison of CCi's
d-torrance Nov 11, 2025
5eb4f32
Fixed empty interval
MichaelABurr Nov 12, 2025
6ca522c
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Nov 12, 2025
e23a541
Use CCi in log(RRi) when input is negative
d-torrance Nov 12, 2025
35eecb9
Allow logs with negative bases
d-torrance Nov 12, 2025
78a7cc8
Add support for acos/asin for RRi's outside [-1, 1]
d-torrance Nov 12, 2025
c4abc0c
Add some RRi/CCi unit tests
d-torrance Nov 12, 2025
24c7121
Another tostringCCi update (fix empty intervals w/ zero real part)
d-torrance Nov 12, 2025
ce9e7f7
Add promoters for CC -> CCi
d-torrance Nov 24, 2025
a0fa2f5
Make InexactNumber' inherit from Number
d-torrance Nov 24, 2025
10295cc
Fixed isMember and added a few promotes
MichaelABurr Nov 24, 2025
8f2ce0c
Merged
MichaelABurr Nov 24, 2025
5c9d303
Fixed a typo/bug converting CC to CCi
MichaelABurr Nov 24, 2025
d96ef14
Improving documentation
MichaelABurr Nov 25, 2025
2b2fe74
Adding tests and improving documentation
MichaelABurr Nov 25, 2025
dd6fcce
Small typo fixed in numbers
MichaelABurr Nov 25, 2025
e36ec65
Merge branch 'development' into intervals
MichaelABurr Nov 25, 2025
a07432a
Fixed merge fail
MichaelABurr Nov 25, 2025
be3d338
Fixed typo in documentation for CCi
MichaelABurr Nov 25, 2025
4b91e7d
Fixed the typo on the typo
MichaelABurr Nov 25, 2025
2ee34f7
Fixed test, I think
MichaelABurr Nov 25, 2025
3d96562
Deleting old backup
MichaelABurr Nov 26, 2025
6e9a775
Reverting the change of toCC to CC
MichaelABurr Nov 26, 2025
6e6a7f8
Add some tests for CCi w/ special functions
d-torrance Nov 28, 2025
02a3ebc
Fix up indentation in .d files
d-torrance Nov 28, 2025
298315b
Remove unused RRb/CCb top-level classes
d-torrance Dec 1, 2025
1038144
Added upperLeft, lowerLeft, upperRight, lowerRight for CCi
MichaelABurr Dec 2, 2025
d5a423c
Added upperLeft, lowerLeft, upperRight, lowerRight for CCi
MichaelABurr Dec 2, 2025
acee11b
Merge branch 'intervals' of github.com:MichaelABurr/M2 into intervals
MichaelABurr Dec 2, 2025
05d5aa5
Simplifying lowerLeft, etc.
MichaelABurr Dec 2, 2025
4b969bf
Make midpoint a method
d-torrance Dec 4, 2025
db394f1
Add midpoint for matrices and polynomials
d-torrance Dec 4, 2025
7bc6156
Fix midpoint for tower rings
d-torrance Dec 5, 2025
cc5033d
Add promoters from RRi and CCi to quotient rings
d-torrance Dec 5, 2025
78b9cd9
Use arb for log1p(CC) and expm1(CC)
d-torrance Dec 8, 2025
88b6050
Use InexactNumber for special function methods
d-torrance Dec 8, 2025
c84f069
Add sqrt for negative RRi (returns CCi)
d-torrance Dec 8, 2025
1e75650
Also use InexactNumber for inverse functions from Boost
d-torrance Dec 9, 2025
b56cf4e
Fix log1p(CC) test now that we use arb
d-torrance Dec 9, 2025
43f4fa1
Also use InexactNumber for inverseErf
d-torrance Dec 9, 2025
e028e53
Don't allow midpoints in quotient rings
d-torrance Dec 12, 2025
4ebd2b1
Add lowerLeft, etc for matrices and polynomials
d-torrance Dec 12, 2025
9b3c8eb
Fix typo
d-torrance Dec 12, 2025
d691002
Make "left" and "right" methods
d-torrance Dec 12, 2025
e6c5824
Preserve grading when calling midpoint(Matrix), etc.
d-torrance Dec 15, 2025
ea2cc0b
Add random(RRi)
d-torrance Dec 15, 2025
354c3de
Add random(CCi)
d-torrance Dec 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
359 changes: 234 additions & 125 deletions M2/Macaulay2/d/actors.d

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions M2/Macaulay2/d/actors2.dd
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ exponent(e:Expr):Expr := (
is x:RRcell do toExpr(exponent(x.v)) -- # typical value: size2, RR, ZZ
is x:RRicell do toExpr(exponent(x.v)) -- # typical value: size2, RRi, ZZ
is z:CCcell do toExpr(exponent(z.v)) -- # typical value: size2, CC, ZZ
is z:CCicell do toExpr(exponent(z.v)) -- # typical value: size2, CCi, ZZ
else WrongArg("a number"));
setupfun("size2",exponent);

Expand All @@ -713,6 +714,7 @@ realPart(e:Expr):Expr := (
is RRcell do e
is RRicell do e
is z:CCcell do toExpr(realPart(z.v))
is z:CCicell do toExpr(realPart(z.v))
is QQcell do e
else WrongArg("a number"));
setupfun("realPart0",realPart);
Expand All @@ -723,6 +725,7 @@ imaginaryPart(e:Expr):Expr := (
is RRcell do zeroE
is RRicell do zeroE
is z:CCcell do toExpr(imaginaryPart(z.v))
is z:CCicell do toExpr(imaginaryPart(z.v))
is QQcell do zeroE
else WrongArg("a number"));
setupfun("imaginaryPart0",imaginaryPart);
Expand Down
561 changes: 407 additions & 154 deletions M2/Macaulay2/d/actors3.d

Large diffs are not rendered by default.

108 changes: 93 additions & 15 deletions M2/Macaulay2/d/actors4.d
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ absfun(e:Expr):Expr := (
is x:RRcell do toExpr(if signbit(x.v) then -x.v else x.v)
is x:RRicell do toExpr(abs(x.v))
is x:CCcell do toExpr(abs(x.v))
is x:CCicell do toExpr(abs(x.v))
is r:QQcell do toExpr(abs(r.v))
else WrongArg("a number, real or complex"));
setupfun("abs0",absfun);
Expand All @@ -111,9 +112,11 @@ sign(e:Expr):Expr := (
is x:ZZcell do toExpr(sign(x.v))
is x:QQcell do toExpr(sign(x.v))
is x:RRcell do toExpr(sign(x.v))
is x:RRicell do toExpr(sign(x.v))
is x:CCcell do (
if isZero(x.v) then toExpr(toCC(0, 0, precision(x.v)))
else toExpr(x.v / abs(x.v)))
is x:CCicell do toExpr(sign(x.v))
else WrongArg("a number, real or complex"));
setupfun("sign0", sign);

Expand Down Expand Up @@ -992,6 +995,7 @@ tostringfun(e:Expr):Expr := (
is x:RRcell do toExpr(tostringRR(x.v))
is x:RRicell do toExpr(tostringRRi(x.v))
is z:CCcell do toExpr(tostringCC(z.v))
is x:CCicell do toExpr(tostringCCi(x.v))--toExpr(concatenate(array(string)(tostringRRi(x.v.re),"+",tostringRRi(x.v.im),"*ii")))
is Error do toExpr("<<an error message>>")
is Sequence do toExpr("<<a sequence>>")
is HashTable do toExpr("<<a hash table>>")
Expand Down Expand Up @@ -1404,39 +1408,112 @@ toRRi(e:Expr):Expr := (
else WrongArg(1,"a pair of integral, rational, or real numbers, with a precision"))
else WrongArg(1,"a pair of integral, rational, or real numbers, with a precision"))
else buildErrorPacket(EngineError("The first argument should be an integer")))
else WrongArg(1,"a pair or triple of integral, rational, or real numbers"));
else WrongArg(1,"a pair or triple of integral, rational, or real numbers"));
setupfun("toRRi",toRRi);


toCCi(e:Expr):Expr := (
when e
is x:ZZcell do toExpr(toCCi(toRRi(x.v,defaultPrecision),toRRi(0,defaultPrecision)))
is x:QQcell do toExpr(toCCi(toRRi(x.v,defaultPrecision),toRRi(0,defaultPrecision)))
is x:RRcell do toExpr(toCCi(toRRi(x.v),toRRi(0, precision(x.v))))
is x:RRicell do toExpr(toCCi(x.v,toRRi(0, precision(x.v))))
is x:CCcell do toExpr(toCCi(toRRi(realPart(x.v)),toRRi(imaginaryPart(x.v))))
is x:CCicell do e
is s:Sequence do (
if length(s) > 3 then WrongNumArgs(1,3) else
if length(s) == 2 then (
when s.0
is x:ZZcell do (
when s.1 is y:ZZcell do toExpr(toCCi(toRRi(x.v),toRRi(y.v)))
is y:QQcell do toExpr(toCCi(toRRi(x.v),toRRi(y.v)))
is y:RRcell do toExpr(toCCi(toRRi(x.v, precision(y.v)),toRRi(y.v)))
is y:RRicell do toExpr(toCCi(toRRi(x.v,precision(y.v)),y.v))
is y:CCcell do toExpr(toCCi(toRRi(realPart(y.v), toULong(x.v)),toRRi(imaginaryPart(y.v), toULong(x.v))))
is y:CCicell do toExpr(toCCi(toRRi(realPart(y.v), toULong(x.v)),toRRi(imaginaryPart(y.v), toULong(x.v))))
else WrongArg(1,"a pair of intervals, rational, real numbers, or interval"))
is x:QQcell do (
when s.1 is y:ZZcell do toExpr(toCCi(toRRi(x.v), toRRi(y.v)))
is y:QQcell do toExpr(toCCi(toRRi(x.v), toRRi(y.v)))
is y:RRcell do toExpr(toCCi(toRRi(x.v, precision(y.v)),toRRi(y.v)))
is y:RRicell do toExpr(toCCi(toRRi(x.v,precision(y.v)),y.v))
else WrongArg(1,"a pair of intervals, rational, real numbers, or interval"))
is x:RRcell do (
when s.1 is y:ZZcell do toExpr(toCCi(toRRi(x.v),toRRi(y.v,precision(x.v))))
is y:QQcell do toExpr(toCCi(toRRi(x.v),toRRi(y.v,precision(x.v))))
is y:RRcell do toExpr(toCCi(toRRi(x.v,min(precision(x.v),precision(y.v))),toRRi(y.v,min(precision(x.v),precision(y.v)))))
is y:RRicell do toExpr(toCCi(toRRi(x.v,min(precision(x.v),precision(y.v))),toRRi(y.v,min(precision(x.v),precision(y.v)))))
else WrongArg(1,"a pair of intervals, rational, real numbers, or interval"))
is x:RRicell do (
when s.1 is y:ZZcell do toExpr(toCCi(x.v,toRRi(y.v,precision(x.v))))
is y:QQcell do toExpr(toCCi(x.v,toRRi(y.v,precision(x.v))))
is y:RRcell do toExpr(toCCi(toRRi(x.v,min(precision(x.v),precision(y.v))),toRRi(y.v,min(precision(x.v),precision(y.v)))))
is y:RRicell do toExpr(toCCi(toRRi(x.v,min(precision(x.v),precision(y.v))),toRRi(y.v,min(precision(x.v),precision(y.v)))))
else WrongArg(1,"a pair of intervals, rational, real numbers, or interval"))
else WrongArg(1,"a pair of intervals, rational, real numbers, or interval"))
else (
when s.0
is prec:ZZcell do (
when s.1 is x:ZZcell do (
when s.2 is y:ZZcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:QQcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:RRcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:RRicell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
else WrongArg(1,"a pair of intervals, rational, real numbers, or interval"))
is x:QQcell do (
when s.2 is y:ZZcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:QQcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:RRcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:RRicell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
else WrongArg(1,"a pair of intervals, rational, real numbers, or interval"))
is x:RRcell do (
when s.2 is y:ZZcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:QQcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:RRcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:RRicell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
else WrongArg(1,"a pair of intervals, rational, real numbers, or interval"))
is x:RRicell do (
when s.2 is y:ZZcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:QQcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:RRcell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
is y:RRicell do toExpr(toCCi(toRRi(x.v,toULong(prec.v)),toRRi(y.v,toULong(prec.v)),toULong(prec.v)))
else WrongArg(1,"a pair of intervals, rational, real numbers, or interval"))
else WrongArg(1,"a pair or triple of integral, rational, or real numbers, with a precision"))
else WrongNumArgs(1,2)))
else WrongArg(1,"a pair or triple of integral, rational, or real numbers, with a precision"));
setupfun("toCCi",toCCi);

rightRR(e:Expr):Expr := (
when e
is x:RRicell do toExpr(rightRR(x.v))
else WrongArg("an interval"));
setupfun("right",rightRR);
setupfun("right0",rightRR);

leftRR(e:Expr):Expr := (
when e
is x:RRicell do toExpr(leftRR(x.v))
else WrongArg("an interval"));
setupfun("left",leftRR);
widthRR(e:Expr):Expr := (
setupfun("left0",leftRR);

width0(e:Expr):Expr := (
when e
is x:RRicell do toExpr(widthRR(x.v))
else WrongArg("an interval"));
setupfun("diameter",widthRR).Protected = false;

midpointRR(e:Expr):Expr := (
is x:CCicell do toExpr(sqrt(widthRR(realPart(x.v))*widthRR(realPart(x.v))+widthRR(imaginaryPart(x.v))*widthRR(imaginaryPart(x.v))))
else WrongArg("an interval or complex interval or ball"));
setupfun("diameter",width0).Protected = false;

midpoint0(e:Expr):Expr := (
when e
is x:RRicell do toExpr(midpointRR(x.v))
else WrongArg("an interval"));
setupfun("midpoint",midpointRR);

is x:CCicell do toExpr(toCC(midpointRR(realPart(x.v)),midpointRR(imaginaryPart(x.v))))
else WrongArg("an interval or ball"));
setupfun("midpoint0",midpoint0);

isEmptyRRi(e:Expr):Expr := (
when e
is x:RRicell do toExpr(isEmpty(x.v))
else WrongArg("an interval"));
setupfun("isEmptyRRi",isEmptyRRi);

subsetRRi(e:Expr):Expr := (
when e is s:Sequence do (
if length(s) > 3 then WrongNumArgs(1,3) else
Expand Down Expand Up @@ -1553,6 +1630,7 @@ precision(e:Expr):Expr := (
is x:RRcell do toExpr(precision(x.v))
is x:RRicell do toExpr(precision(x.v))
is x:CCcell do toExpr(precision(x.v))
is x:CCicell do toExpr(precision(x.v))
else WrongArgRR());
setupfun("precision0",precision);

Expand Down
Loading
Loading