Boost logo

Boost :

Subject: Re: [boost] [review] Multiprecision review (June 8th - 17th, 2012)
From: Matthieu Schaller (matthieu.schaller_at_[hidden])
Date: 2012-06-24 19:25:37


 Here is my late review. Apologies for the delays.

   What is your evaluation of the design?

Boost.Multiprecision is interesting as it brings boost into area of
computer science where it is not very present yet. Providing a high-level
fixed/arbitrary precision integer/float type library to numerical scientist
is a great move.

The library is easy to use and behaves as one could expect when looking at
the function name or operator. One can thus easily move any mathematical
calculation from a usual POD double to a cpp_dec_float or mpf_float. A
beginner will understand rapidly what a given piece of code using this
library does.
I especially like the wrapper around GMP which is a standard among
numerical scientists.

The conversions are however sometimes tricky to understand but I do not
know if there is a solution to this issue which would satisfy everyone in
every situation.

     What is your evaluation of the implementation?

As already mentioned, I really like the ability to use pre-existing
libraries such as GMP which are well-known and well-tested. The speed
difference is really minimal and is probably worth the comfort.
All functions do what you expect and the list of supported functions and
constants is really comprehensive. Everyday use should be a problem. The
support of numeric_limits is also a good thing for re-use in other
libraries.

The decomposition in front-end and back-end is particularly good for future
extensions.

The optional use of expression template is a great feature. The proposed
improvements present on the TODO list aiming at improving the speed of the
implementation will reduce the difference between cpp_int and the GMP
equivalent even further.

     What is your evaluation of the documentation?

 The documentation is really comprehensive and presents interesting
examples. The tricky points (conversions, ... ) are discussed and a
beginner should be able to write a code without loosing his time reading an
obscure documentation

    What is your evaluation of the potential usefulness of the library?

 Useful to anyone needing high precision mathematical computations.

    Did you try to use the library? With what compiler? Did you have any
problems?

 Used with GCC 4.6 and ICC 12.1 to test my own library proposal (complex
numbers). No problems nor warnings.
The results obtained always agreed with the values given by Maple.
As mentioned by others, one must still be careful with conversions. But any
user of extended precision libraries should be aware of these caveats
anyway. Furthermore, these are well documented.

It was easy to use the cpp_dec_float or gmp_float classes in the context of
complex numbers.

    How much effort did you put into your evaluation? A glance? A quick
reading? In-depth study?

 Good effort at understanding and testing most of the floating point
library in the context presented above. Tested the integer types for this
review.

    Are you knowledgeable about the problem domain?

 Yes. See the extended complex number class proposal.

    Do you think the library should be accepted as a Boost library?

 If boost wants to move into the realm of extended precision numbers, then
yes.

Lastly, please consider that John and Christopher have compiled a TODO list
[1] based on pre-review comments. Feel free to comment on the priority and
necessity of such TODO items, and whether any might be show-stoppers or
warrant conditional acceptance of the library.

In my opinion, these are not show-stoppers. Adding more back-ends is always
good but the main library in this field (GMP) can already be used. So this
should not be a reason to reject this library.
The same is true with the possible improvements to cpp_int_backend. Users
wanting a really fast code can use the GMP back-end. Users in the real
world may also make suggestions for other possible improvements or express
their needs.
Having a version of this library in the real world is a good thing to spot
its possible weaknesses and will also allow the authors to work on the
elements of their TODO lists.

Regards,

Matthieu

-- 
Matthieu Schaller

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk