On Mon, Apr 28, 2008 at 10:47 PM, Jonathan Bober <[EMAIL PROTECTED]> wrote:
>
> I'm not sure exactly what the speed differences are, but I think that
> they are quite significant. When writing the partition counting code,
> which uses quaddouble, I recall that things ran much slower if "sloppy"
> multiplication and division were not enabled. (However, I have no hard
> benchmarks to back this up right now, so this statement shouldn't be
> taken too seriously, and I could be wrong -- it would be nice if I had
> some real data.)
>
> Anyway, I don't think that this isn't necessarily an issue of
> correctness vs. noncorrectness. It's an issue of precision -- in one
> implementation multiplication/division is correct to within X bits, and
> in the other it is correct to within (X + a few more) bits, but it takes
> [a lot?] longer. In at least some applications, it is very desirable to
> accept a small loss of precision in exchange for a large speedup.
>
> Also, regarding benchmarking, I wonder what the speed difference is
> between quaddouble with IEEE error bounds vs. mprf at 212 bits. And
> while I'm wondering, I also wonder whether there is any even any reason
> for RQDF to exist:
>
> sage: def f(x):
> ...: for i in xrange(1000000):
> ...: y = x * x
> ...:
> sage: x = RQDF(1/1000)
> sage: timeit("f(x)")
> 5 loops, best of 3: 802 ms per loop
> sage: x = RealField(212)(1/1000)
> sage: timeit("f(x)")
> 5 loops, best of 3: 872 ms per loop
>
> quaddouble is certainly faster than mpfr, but it seems likely that in
> any application from with sage the python overhead will eat up most of
> the speed difference. (quaddouble is certainly good thing to have
> "underneath the hood", but I just don't know that there is much use to
> having it externally visible.)
>
I have also questioned having quaddouble in Sage via Python
and wondered about it. There might be some overhead because
of C++ being involved in the wrapping. Also, though arithmetic
is the same speed, special functions (e.g., trig functions) are twice
as fast with quad double as with mpfr.
William
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---