Ticket #1144 (closed defect: invalid)

Opened 1 year ago

Last modified 2 weeks ago

[is invalid?] mpfr to RQDF coercion

Reported by: zimmerma Assigned to: cwitty
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: basic arithmetic Keywords:
Cc:

Description

I do not understand the following in RQDF??:

The rings that canonically coerce to the real quad double field are:

  • the mpfr real field, if its precision is at least 212 bits

On the contrary, RealField?(p) should coerce to RQDF **exactly** for p <= 212 (in fact this should be 215 = 53 + 1 + 53 + 1 + 53 + 1 + 53 since if you round to nearest, then the remainder is smaller than 1/2 ulp of the most significant part).

Thus coercion from RealField?() to RQDF should always work.

Change History

11/11/2007 06:14:19 AM changed by mabshoff

  • owner changed from somebody to cwitty.
  • priority changed from minor to major.
  • milestone set to sage-2.8.13.

11/14/2007 06:46:38 PM changed by cwitty

This is the "canonical coercion", which is a somewhat different concept than coercion (the terminology is bad, and may change).

Canonical coercions are the coercions that Sage applies automatically, for instance when doing arithmetic. If you try to add (or multiply, etc.) an element of A and an element of B, sage will look for a canonical coercion from A to B and a canonical coercion from B to A. (Only one of these should exist.) It will apply this coercion, and then do the arithmetic.

In general, the Sage policy is to prefer to throw away information, rather than make up information; so the product of an RR and an RQDF is an RR.

Explicit coercions are more general; for instance, both RR(RQDF(1)) and RQDF(RR(1)) work.

So the fact that the canonical coercions seem "backward" is by design. However, the use of 212 instead of 215 does seem to be a bug.

12/04/2007 12:07:15 AM changed by robertwb

Even if one can represent 215 bit numbers exactly with RDQF, the arithmetic it seems is only done to 212 bits of precision according to the documentation, so this would seem to be the correct bound.

http://www.cs.berkeley.edu/~yozo/

12/06/2007 01:01:28 PM changed by mhansen

Should this be marked as invalid then?

12/06/2007 01:01:46 PM changed by mhansen

  • summary changed from mpfr to RQDF coercion to [is invalid?] mpfr to RQDF coercion.

03/11/2008 09:58:08 PM changed by rlm

  • milestone changed from sage-2.11 to sage-2.10.4.

11/14/2008 12:34:05 AM changed by mhansen

  • status changed from new to closed.
  • resolution set to invalid.
  • milestone changed from sage-3.2.1 to sage-duplicate/invalid/wontfix.

Since we are removing RQDF, I'm going to mark this as invalid.