From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-04-15 02:02:00
Several implementations (like Moshier's Cephes and NR in C++) often use some
sort of polynomial to estimate the functions like the erfs. The inverse
functions mostly use some iterative root finding algorithm. So I am not clear
where the random numbers are needed to evaluate the suggested functions.
Although some functions are easy, others, in particular the incomplete beta are
more tricky and have been the subject of extensive research. There is lots of
scope to balance size of code, complexity, accuracy overall and accuracy at
limits, and speed, not to mention the need for float, double and long double
versions with 32 to 128-bit precisions.
For some functions there will be scope for many different implementations.
Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]]On Behalf Of Tarjei Knapstad
> Sent: Monday, April 14, 2003 3:40 PM
> To: Boost mailing list
> Subject: Re: [boost] C++ Standard Library proposal - Math functions
> On Wed, 2003-04-09 at 21:42, Paul A. Bristow wrote:
> > Following discussions with Walter Brown, who made a previous
> proposal for some
> > math functions (adding to the C99 functions proposed by P J Plauger),
> > I have prepared a draft of a new proposal to add a good number of
> other 'special
> > functions' which I believe have even greater practical utility (but
> perhaps more
> > difficulty in implementation).
> Most of these aren't too hard to implement IIRC, but I have one remark.
> In your proposal you state that overloads would be preferable to
> function templates. To my knowledge though, all these functions sooner
> or later relies on a uniform random number generator (for instance the
> normally distributed number is usually computed using two uniformly
> random numbers).
> My question is, which random number generator should be used in the
> implementation of these distributions? IMHO, ideally this should be left
> to the user to decide. Wouldn't that facilitate something more in the
> ways of:
> template<typename T, class Functor = DefaultRNG>
> T normal_distribution(T z);
> and so on? (I understand you want to keep interoperability with C, this
> is just a C++ example)
> Tarjei Knapstad
> 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