Jump to content
Erik@Grijjy

High-Precision Floating-Point Types for Delphi

Recommended Posts

Some benchmarks comparing the performance of the DD and QD types to the native Single and Double types would be appreciated, if you have them.

I've searched for performance numbers on the QD C++ library but couldn't find any relevant ones. The pdf contains some numbers but they are very old (Pentium II) and quite meaningless since the only comparison made is to the MPFUN Fortran library.

 

Also the QD page you link to state that the C++ library isn't thread safe. Is the same true for your implementation?

Share this post


Link to post
10 minutes ago, Anders Melander said:

Also the QD page you link to state that the C++ library isn't thread safe

Well, Delphi's floating point library isn't threadsafe so they can have a party together!!

  • Haha 3

Share this post


Link to post
1 minute ago, Anders Melander said:

Some benchmarks comparing the performance of the DD and QD types to the native Single and Double types would be appreciated, if you have them.

I've searched for performance numbers on the QD C++ library but couldn't find any relevant ones. The pdf contains some numbers but they are very old (Pentium II) and quite meaningless since the only comparison made is to the MPFUN Fortran library.

 

Also the QD page you link to state that the C++ library isn't thread safe. Is the same true for your implementation?

I have attached a spreadsheet I created a couple of years ago, comparing DD and QD to Single and Double, as well as to some well-known arbitrary precision libraries.

Results may be a bit different now if I would run these tests again, but I think will still be in the same ballpark.

 

In short, DD is 2-10 times slower than Double, but 5-100 times faster than other arbitrary precision libraries using the same precision.

Likewise, QD is 4-100 times slower than Double, but 5-250 times faster than other libraries.

 

You can also do some simple benchmarking by running the included Mandelbrot sample at different levels of precision (for a magnification level that works at Double precision).

 

Since this library directly uses the QD C++ library, it has the same limitations (such as thread safety). Although I would assume that most operations would be thread safe since as long as you don't mutate the same DD/QD value from multiple threads. But I haven't checked the C++ source code for this, so I am not sure.

MultiPrecisionSpeed.xlsx

  • Like 3
  • Thanks 2

Share this post


Link to post
6 minutes ago, Erik@Grijjy said:

In short, DD is 2-10 times slower than Double, but 5-100 times faster than other arbitrary precision libraries using the same precision.

Likewise, QD is 4-100 times slower than Double, but 5-250 times faster than other libraries.

Thanks. Ballpark numbers are fine. Much appreciated.

I just wanted to get an impression of what impact using this might have. 2-10 times slower for DD is much better than what I expected.

That said, I can see that multiplication is one if the slower operations. That surprises me but I guess it must be because native multiplication is highly optimized in hardware.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×