Boost logo

Boost :

From: Michael Marcin (mike_at_[hidden])
Date: 2007-05-17 15:52:32


Anthony Williams wrote:
>
> If you fancy writing a template metaprogram to calculate atan or logarithms,
> go ahead! Actually calculating the values from scratch in a reasonable length
> of time is more than I could manage in a *run-time* solution --- the lookup
> tables make it several orders of magnitude faster. I think the extra compile
> time complexity would either make the compiler keel over, or the compile take
> ridiculously long.
>

Yes it is silly to calculate the values from scratch on every call or
every compile. If they could be put in a static library they would only
need to be calculated when you would need to regenerate the tables
anyway. The benefit is that I don't need to install yet another tool to
regenerate them.

> Anyway, I was suggesting that the code generator be run exactly once (unless
> it needed to be modified for some reason, e.g. to change the rounding rules
> for better overall accuracy, or change the values for which the atan and
> natural log are calculated), and then the generated code kept in CVS.
>

Different situations call for different amounts of resolution in the
tables and fixed-point types. It would be hard if not impossible to
have tables to fit every need in CVS. For it to be useable it needs to
be readily configurable to get the "right" behavior for the application
with reasonable defaults to get things up and running when it's not yet
time for fine tuning.

Thanks,

Michael Marcin


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