Re: Fixed Point Taylor Approximation of a Non-Integer Power



On Jul 28, 2:50 pm, "alos" <los.aleksan...@xxxxxxxxxxxxxx> wrote:
... I am working on a way to approximate
a non-integer power in fixed point. For example, x^(2.5).

While a lookup table can work, it can get rather large depending on my
range of x.

and the error constraints you may have. you can reduce error in an
LUT by interpolating. linear interpolation is the simplest (other
than zeroeth-order interpolation or "drop-sample" interpolation) and
the most common, but higher order, like 3rd-order Hermite or Lagrange
interpolation have been done also.

So I was considering a simple low-order (4-6 coefficients)
Taylor Series approximation. Its natural MAC-like structure made it seem
efficient, and would only require storing a few pre-calculated
coefficients (powers of x0) to start.

But before I dive too deep into implementing that technique, I wanted to
see what you all thought. Is this a poor choice? Is there a standard
technique for this that I am just plain missing?

there might be a couple:

1. least square-error fit
2. least max-error fit

the latter is the "equiripple approximation" or "remes exchange
algorithm", Alek alludes to.


Keep in mind that Taylor is usually poor choice for approximation.
Better choices are:
 - Economization of long Taylor expansion (see. Numerical Recipes in C)
 - Interpolation on Chebyshev nodes (can be close to optimal).
 - Equiripple approximation - best approximation in the L_infinity
   norm sense.

For example polynomial with following coefficients (const term last),
obtained with the remez exchange algorithm:

probably Alek has one also, but every engineer should have a MATLAB or
Octave program that fits a finite-order polynomial to some given
function over a given range. in either the least-square or equiripple
approximation, you should be able to weight the error function so that
it fits tighter in areas where it is more important. for equiripple,
i have a MATLAB/Octave program (remes exchange) for that, if you want
it. lemme know.

if they accept my proposal, i am hoping to do a tutorial about this
topic at the next AES convention in October. but i haven't yet heard
back from the powers that be regarding that. maybe i missed the
rejection email.

r b-j
.



Relevant Pages

  • Re: Can someone please explain - real numbers
    ... You have to look at it like the computer does, as a string of bits, not a string of decimal digits. ... The 1 bits represent powers of 2 that are included in the sum; the 0 bits represent the powers that are not included. ... As I replied before, the 2.21 value that you store in the Real variable begins as an Extended value, and then the compiler converts it to the best approximation as a Real value. ...
    (comp.lang.pascal.delphi.misc)
  • Re: tetration and logaritms
    ... first another word on the matrix-method: ... then you have a matrix (of coefficients). ... This is then simply "my" matrix-method..(I collect like powers ... You gave a polynomial interpolation approach, ...
    (sci.math)
  • Re: Minimax approximation for cosine
    ... >with even powers only will be a better fit than one with all powers. ... >= k, then you can't do a minimax approximation on f, but you have ... >Glen Low, Pixelglow Software ... This yields the expansion coefficients for the Chebyshev polynomials ...
    (sci.math.num-analysis)
  • Re: Why do I get calculation errors with Athlon and Excel 2003?
    ... the binary approximation to 1/10 based on the IEEE standard for double precision is equivalent to ... Does anyone know of a problem with Excel 2003 and the Athlon 64 3200+ processor? ... Except for numbers that can be represented accurately as the sum of powers of 2, non-integral numbers are stored only approximately. ... This results in computation errors of the type that you described. ...
    (microsoft.public.excel.misc)
  • Re: VB6 Type Conversion Errors
    ... Floating point values can't represent numbers not based on powers of 2 (this ... As it turns out, that approximation is ... When you perform the calculation first and assign it to a Double, ...
    (comp.lang.basic.visual.misc)

Loading