Hi,

On Tue, Mar 18, 2014 at 08:22:44AM -0700, Marco Streng wrote:
[...]
> So the choices are:
>
> 1) explicit conversion RR --> RIF: allow / disallow
> 2) explicit conversion RIF --> RR: allow / disallow
> 3) automatic coercisions: disallow / (RR-->RIF) / (RIF-->RR)

It seems there are more precise cases to consider: 

- How do you plan to coerce a RIF element with non-trivial diameter to a
  RR element ?

- How do you plan to convert 
  - from RealIntervalField(2) to RealField(100) ?
  - from RealIntervalField(100) to RealField(2) ?
  - from RealField(100) to RealIntervalField(2) ?
  - from RealField(2) to RealIntervalField(100) ?

- How do you mix both (do you plan to deal with possible compensations
  between number of bits of precision of the field and the diameter of
  the intervals) ? 

For example, in which case do you allow (silent) coercion, and what
should be the result of the (explicit) conversion:

- RIF(-1,1) -> RR 
- RealIntervalField(100)(1.000000001,1.000000002)) -> RealField(2)
- RealField(2)(pi) -> RIF  [which diameter, which endpoints ?]
- and so on


As for me, 
- it is clear that RIF(pi) should be coerced to RR(pi)
- i agree with coercing from x in RealIntervalField(a) to RealField(b)
  when the endpoints of x are the same in RealField(b)
- i have no problem for explicit conversion from RIF(-1,1) to RR, but it
  should be well specified in the doc, since there is no canonical way.
- i am not sure wether RIF(-1,1) should coerce to RR

Is Sage able to allow a coercion from A to B, but the coercion map is
not the same as the conversion map there (i mean, could the coercion be
a partial map of the conversion) ?

As for me, i am against RR -> RIF coercion because some Sage code (not
user code) could convert from RIF to RR because of some internal
multiplication, and then silently back to RIF (if the coercion RR->RIF
were allowed), leading to a false sense of precision and even the
experienced user will not noticing it (no none can be assumed to know
all Sage source code), and will not be able to hand-check this as
suggested in the comment, since not all computations are done by the
user.

BUT, i find the second example of tcoffee quite convincing (i am also
doing some RIF stuff to understand the loss of precision along a
computation), so perhaps could there be an easy way to let the user tune
such a convenient coercion easily at her own risks, and a way to learn
about this. Or perhaps could there be a special parent for this kind of
experiments.

Ciao,
Thierry

-- 
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