Real Quad Double Field

11 views
Skip to first unread message

William Stein

unread,
Jul 25, 2008, 3:53:35 PM7/25/08
to sage-devel, Paul Zimmermann
Hi,

Does anybody actually use Sage's RQDF (real quad double field) code in Sage?
I want to scrap it.

Right now the *only* code in all Sage that uses RQDF is Bober's
number_of_partions in
some case, which could easily be modified to not use it.

On Solaris x86 RQDF has massive precision loss in some cases (e.g.,
only 170 bits right
out of 212).

RQDF is on flimsy theoretical footings, to put it mildly. It also
fails make check on Solaris
with precision errors.

It's sole reason for existence is (1) it is a simple data structure
and (2) it is supposed to
be faster than MPFR. In fact, it is only very slightly faster than
MPFR, and (1) basically
doesn't matter for Sage.

Basically MPFR just kicks RQDF's butt in every way from our
perspective, so why have
RQDF in Sage?

-- William


--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

John Cremona

unread,
Jul 25, 2008, 3:55:51 PM7/25/08
to sage-...@googlegroups.com
I vote to scrap it, provided that the effect on the partitions counter
is really not serious.

John

2008/7/25 William Stein <wst...@gmail.com>:

Nick Alexander

unread,
Jul 25, 2008, 7:00:18 PM7/25/08
to sage-...@googlegroups.com

On 25-Jul-08, at 12:53 PM, William Stein wrote:

>
> Hi,
>
> Does anybody actually use Sage's RQDF (real quad double field) code
> in Sage?

I use every other RR and CC like type, but not RQDF.

> I want to scrap it.

+1.

Nick

Paul Zimmermann

unread,
Jul 26, 2008, 3:54:59 AM7/26/08
to William Stein, sage-...@googlegroups.com
> Does anybody actually use Sage's RQDF (real quad double field) code in Sage?
> I want to scrap it.
>
> Right now the *only* code in all Sage that uses RQDF is Bober's
> number_of_partions in
> some case, which could easily be modified to not use it.
>
> On Solaris x86 RQDF has massive precision loss in some cases (e.g.,
> only 170 bits right
> out of 212).
>
> RQDF is on flimsy theoretical footings, to put it mildly. It also
> fails make check on Solaris
> with precision errors.
>
> It's sole reason for existence is (1) it is a simple data structure
> and (2) it is supposed to
> be faster than MPFR. In fact, it is only very slightly faster than
> MPFR, and (1) basically
> doesn't matter for Sage.
>
> Basically MPFR just kicks RQDF's butt in every way from our
> perspective, so why have
> RQDF in Sage?

I have no problem in replacing RQDF by MPFR everywhere in Sage. It can only
help to better test MPFR. On the other hand maybe some Sage users did develop
some code using RQDF. This raises a general question: what is the policy about
upward compatibility?

Paul

mabshoff

unread,
Jul 26, 2008, 12:14:18 PM7/26/08
to sage-devel


On Jul 26, 12:54 am, Paul Zimmermann <Paul.Zimmerm...@loria.fr> wrote:

<SNIP>


> > Basically MPFR just kicks RQDF's butt in every way from our
> > perspective, so why have
> > RQDF in Sage?
>
> I have no problem in replacing RQDF by MPFR everywhere in Sage. It can only
> help to better test MPFR. On the other hand maybe some Sage users did develop
> some code using RQDF. This raises a general question: what is the policy about
> upward compatibility?

Usually we add a deprecation warning and then remove the offending
code after 6 months. In this case we should actually do something more
drastic since "make check" does not even pass on a number of x86
Solaris boxen I played around with. qd is numerical and does not give
any guarantees, but I think some people might still not know that and
so use it.

> Paul

Cheers,

Michael

Bill Hart

unread,
Jul 26, 2008, 12:16:29 PM7/26/08
to sage-devel
I vote +1 for getting rid of it (and I was one of the people
advocating its use in the first place for Bober's partition counting).

Bill.

Jonathan Bober

unread,
Jul 27, 2008, 9:22:16 PM7/27/08
to sage-...@googlegroups.com
The arguments for getting rid of it sound compelling, but I'm not sure
whether the statement that it is "only very slightly faster than MPFR"
is true. For large input, using quad_double and double_double and MPFR
to compute number_of_partitions takes roughly %60 of the time that it
takes when using only MPFR (on my laptop).

However, if it's broken, then it's broken. Besides, I suspect that
having number_of_partitions() take twice as long to run doesn't really
matters for anything except bragging purposes.

I do wonder what makes it so broken on Solaris x86, though. It might
just be that some flags need to be passed to the compiler regarding the
handling of 53/64 bit doubles on x86 machines or to tell the compiler
that SSE should be used for all floating point arithmetic.

-Bober

Reply all
Reply to author
Forward
0 new messages