Re: Geometric average: how to compute it: best approach ?



pamela fluente a écrit :

So, assuming the above block recursive computation,
what is more advisable: using the multiplication with powers, or the
sum with the logarithm?

The first 2 are quite slow, but, on the other hand, the logarithm has
to be taken n times.

Which way should be better and accurate ?

-P


Perhaps combining multiplications (without powers!) and taking the logarithm after a fixed number of multiplications (to avoid the cost of a comparison) that doing something like :
log(X[0]*X[1]*...*X[19])+log(X[20]*X[21]*...*X[39])+...

This is detailed in my answer to your last post of yesterday.

Stopping my evangelism attempt now! :-)
Raymond
.



Relevant Pages

  • Re: A Simplified Number System
    ... I don't think that your logarithm objection matters. ... Using the even powers you can express the real component of the number ... Using the odd powers we can express the imaginary component similarly ...
    (sci.lang)
  • shifting bits
    ... result I chose to shift the variables' bits using multiplications and ... divisions by powers of two. ...
    (comp.lang.ada)
  • Re: Opening
    ... part of the definition of a logarithm. ... you can also use the square root instead to go the ... operation that most calculators have a special square root button ... It's because the number system we use is based on powers of 10. ...
    (rec.arts.sf.composition)
  • Re: How to solve (2x + 3y)^3?
    ... involved in computing the binomial coefficients ... to compute,(quite a few multiplications and divisions ... You're probably right about the powers of 2 and 3, but I guess anyone reasonably well-versed in arithmetic knows the first few by heart. ... practise with it, ...
    (sci.math)
  • Re: converting float to ascii w/o printf
    ... this without this error induced by my multiplications by 10 (and still ... or divide by a power of 10, so you only get one roundoff error. ... What I mean is that if you do the normalization multiply/divide using ... This gives you larger powers of 10 that can be ...
    (comp.arch.embedded)