Boost logo

Boost :

Subject: Re: [boost] [math] & [random] distribution object compatibility
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2014-04-16 15:33:58


AMDG

On 04/14/2014 11:46 AM, Paul A. Bristow wrote:
>
> Indeed - but the requirements are quite different.
>
> Boost.Math aims to be accurate (and with extension to use Boost.Multiprecision
> and <cstdfloat> , very, very accurate).
>
> Boost.Random must be very fast, but need not be accurate - indeed it may be
> rather inaccurate?
>

I've considered ways to make Boost.Random more
accurate for years. I think it's generally
possible to achieve near perfect accuracy
without a huge performance cost by iteratively
tightening the squeeze steps. Since the expected
number of iterations is only slightly greater
than one, this won't materially affect performance.
The primary increase in cost would come from generating
the initial guess, as there's no way to get k bits
of accuracy without getting at least k bits from
the underlying PRNG.

The biggest problem is that it's nearly impossible to
test as it requires a ridiculous number of samples to
detect the inaccuracy. If you have k bits of accuracy,
you would need at least \Omega(2^k) and possibly as
many as \Omega(2^{2k}) samples before the bias becomes
apparent.

> So I doubt if changing either is a good idea.
>
> (And anyway they are by different authors developed at different times - so NIH
> probably applies).
>

In Christ,
Steven Watanabe


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