[Fwd: Re: random variate from power exponential distribution: continue]

Giulio Bottazzi giulio.bottazzi@libero.it
Fri Oct 22 17:59:00 GMT 2004


On Fri, 22 Oct 2004 16:04:39 +0100
Brian Gough <bjg@network-theory.co.uk> wrote:

> For GSL, the goal is to have simple generic algorithms that perform
> reasonably on any machines.  Optimising for one platform tends to make
> things worse on others, as they have different strengths and
> weaknesses.


Dear Brian,
the problem is exactly this. It seems that the actual code in
randist/exppow.c is already optimized. Optimized for an Intel processor.
Indeed, there are three different algorithms for the generation of power
exponential variates that are implemented inside GSL. The function
exported to external programs, gsl_ran_exppow, makes a choice among
these three algorithms based on the value of a parameter. The presence
of these if-else branches DOES NOT make the code simpler. And, it
turned out, it doesn't make it more "generic" too. The choice between
different algorithms leads to faster code on some platforms and to
slower code on others.

If I understood correctly the gsl philosophy, probably a better approach
would be to implement three distinct functions

gsl_ran_exppow_gs
gsl_ran_exppow_ed
gsl_ran_exppow_en

and let the user makes her choice (depending on her architecture). Of
course, one could leave a "would be generic" gsl_ran_exppow for backward
compatibility, adding the needed "caveat" in the manual.

If you think this approach is reasonable, I would be happy to try to
put together the necessary code and the necessary additions to the
manual.

Best,
	G.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gsl-discuss/attachments/20041022/ae59c040/attachment.sig>


More information about the Gsl-discuss mailing list