Boost logo

Boost :

Subject: Re: [boost] Looking for some "real world" extended precision integer arithmetic tests
From: Andrii Sydorchuk (sydorchuk.andriy_at_[hidden])
Date: 2012-03-21 15:50:04


John,

>From your benchmark I see that you didn't provide results for
boost::multiprecision::fixed_int, but rather for boost::multiprecision::**
backends::cpp_int_backend. I tried to update boost multiprecision branch,
but boost/mutliprecision/backends directory appeared to be empty.

Many thanks for the use case - in point of fact it's proved pretty hard to
> get a general purpose solution anywhere near your special-purpose code -
> simply because your code is so simple

I wouldn't say so. The only simple thing about my extended_int
implementation is that it implements 3 basic operations: addition,
subtraction and multiplication. But I don't see any problems on extending
it to support division and other arithmetic operations. My point is that
for fixed integer class it's not a good idea to represent negative numbers
as two's complement. The main point of my benchmark was to compare fixed
int implementations. And those should not have much performance difference
in construction of temporary variables.

 I think what we are seeing in Andrii's use case may generalize across
> quite a few different big number use cases.

Exactly, the main point of usage of fixed big integer class is that it
doesn't require you to think about temporaries creation (except overflowing
stack, but that's another topic). I would say that for math computations it
is the best option in 90% of cases.

It would be good for Boost to have both big int implementations: with stack
allocated backend and heap allocated backend. I was able to contact Arseniy
Kapoulkine, who's big int implementation is under /sandbox/SOC/2007/bigint.
Arseniy agreed to work with Boost group to solve any problems that prevent
the standardization. I will try to come up with benchmarks of the current
implementation based on the Voronoi code. It would be very nice to combine
that implementation with boost multiprecision.

Cheers,
Andrii

Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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