#15114: disallow coercions from RR to RIF
--------------------------------------------+------------------------
       Reporter:  mstreng                   |        Owner:
           Type:  defect                    |       Status:  new
       Priority:  major                     |    Milestone:  sage-6.2
      Component:  coercion                  |   Resolution:
       Keywords:  RIF RR interval coercion  |    Merged in:
        Authors:                            |    Reviewers:
Report Upstream:  N/A                       |  Work issues:
         Branch:                            |       Commit:
   Dependencies:                            |     Stopgaps:
--------------------------------------------+------------------------

Comment (by tcoffee):

 I think this change will cause many more problems than it solves.

 In practice: I expect this will break a lot of existing code. I often use
 the RR --> RIF coercion intentionally, because it makes it more convenient
 to do exactly what I want. For instance:

 * In an interval branch-and-bound code, cell widths in a geometric
 decomposition are expressed as reciprocal powers of two, which can be
 efficiently stored and used as EXACT floating-point numbers. Combining
 these in arithmetic operations with intervals gives the same results as
 explicitly converting them to RIF, without having to do the explicit
 conversion.

 * Interval arithmetic is a fast way to obtain approximate bounds on
 floating-point calculations over ranges of parameters, by simply replacing
 the parameter of interest with an interval. To do this without RR --> RIF,
 one would have to add explicit conversions of *all* other parameters
 appearing in combination with this parameter *everywhere* it occurs.

 In theory: I think the motivation is flawed. The change was proposed to
 avoid accidental coercion of exact ring values to RIF via potentially
 inexact RR. But the problem in this case is the first step, not the
 second, and reflects the need for a direct coercion from the exact ring to
 RIF. In such a case, the lack of such a coercion is the bug. Whereas each
 value in RR *does* have a valid coercion to RIF, and the lack of this
 coercion would also be a bug.

 Realistically, I think anyone who is actually

 1. using RIF to do reliable computing *and*
 2. coercing values from other exact rings that *don't* have direct
 coercions to RIF *and* are not expressible exactly in RR,

 is going to be sufficiently aware of the potential problem that they will
 handle/check the conversion explicitly. Better to expect this than to
 inconvenience many users who use this coercion in far less arcane
 circumstances.

--
Ticket URL: <http://trac.sagemath.org/ticket/15114#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

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

Reply via email to