Vincent Delecroix wrote:
> As I already mentioned on tickets, the semantic of equality is a bit
> different for intervals and balls. This is annoying since they
> basically represent the same objects (=intervals with diadic bounds).
> This is my only objection for having it standard right now.

If I understand correctly, you disagree with some of the choices made in 
the high-level sage bindings for arb, that is, ball fields and their 
elements. But I'd say this is largely independent of whether arb is a 
dependency of sage or not. Isn't it?

Regarding the technical issue, I am not convinced that intervals and 
balls should be interchangeable.

Sure, they represent similar objects, but it seems to me that their 
typical use cases are different: basically, intervals represented by 
their endpoints are more convenient to do bisection, bound the range of 
a function on a “large” box, or similar things, while balls are better 
if you want to do arithmetic on real numbers and keep track of roundoff 
errors (though of course both balls and intervals *can* be used in both 
cases). To put it another way, I think of (real) intervals as ranges of 
real numbers, and of balls as specific reals known imprecisely.

This makes a difference for instance in code like

  interval = ...
  f = x - y
  f(x=interval, y=interval)

If you think of 'interval' as a range, say [0,1], you expect an interval 
enclosing the range of 'f' over [0,1]². While if you think of it as a 
single number, say pi ± 1e-10, it is acceptable (and better) to 
return 0. In the first case, 'interval == interval' should return False 
unless 'interval' is a point interval; in the second, you can have it 
return True when 'interval is interval' (but of course 'interval == 
copy(interval)' should still be False). And so on.

The differences between the underlying libraries (arb and mpfi) in this 
respect are the main reason for the slightly different semantics of 
equality between Sage real balls and real intervals (as discussed in 
more detail on the same tickets you mention).

I personally find it is useful to have separate parents supporting the 
“intervals-as-ranges” model and the “intervals-as-points” model. That 
being say, I too was skeptical about the semantics of ball equality at 
first, and I wouldn't be opposed to making RBF closer to RIF in this 
respect.

-- 
Marc

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to