|
Boost : |
From: Peder Holt (peder.holt_at_[hidden])
Date: 2005-11-03 01:05:57
> Excellent!
>
> I've now added a power function to the mix,
> implemented in terms of exponential and logarithm. A
> more efficient implementation that uses fractions or
> other series functions may come later.
>
> Cromwell D. Enage
Great!
I tried implementing a power using fractions, but it turned out that
for larger exponents its convergence rate was very poor. (I needed
~100 recursions for something like 10^20)
What we should do, is add a specialization for power with integral
exponent. This is a very fast algorithm (also in respect to
compile-time efficiency)
What we could do, is to split power(z,a) into two:
power(z,floor(a))*power(z,a-floor(a));
Regards,
Peder
>
>
>
>
> __________________________________
> Start your day with Yahoo! - Make it your home page!
> http://www.yahoo.com/r/hs
> _______________________________________________
> 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