log function implementation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joshuabraham
    New Member
    • May 2008
    • 2

    log function implementation

    Greetings everyone,
    Does anyone know the best or most commonly used polynomial that approximates the log function (base 2 ,base10..) apart from taylor series.thanks.
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    Can you use non-polynomial exponents instead? eg x^(0.5)? What end of the polynomial do you want to approximate, before 1 or after 1? Can you use a different polynomial for each side?

    Comment

    • jay albert

      #3
      Thanks for replying.Yes to all those questions.In the one or greater than one case i'd prefer greater than one, but any case that's easier would be fine with me i just want insight.Thanks.

      Comment

      • Oralloy
        Recognized Expert Contributor
        • Jun 2010
        • 988

        #4
        joshuabraham,

        The choice of function depends on the accuracy that you need and what range you need it over.

        There is a whole body of knowledge on this subject, as the "chip manufacturers" use this technique to implement high-performance transcendental and algebraic functions on chip. In general, they use a spline of polynomial approximations which are accurate to some number of bits. I read a really good discussion of the Cray implementation once, but that was a long while back. I think they were using sixth order polynomials to approximate the square root in their hardware, with an accuracy of three bits or better in their 64 bit floating point representation.

        So....why do you need to do this, and what are your constraints? Those two questions will drive your polynomial selection.

        Good Luck!

        Comment

        Working...