Oleg Homenko a ?crit :> Hi, > I started to optimize math_approx fixed point functions to ARM CPU. And > found out that approximations are not Taylor series,That's right. for example:> spx_exp2(x) = D0 + D1*x + D2*x^2 +D3*x^3, > where D0 = 1, D1 = log(2), D2 = (log(2))^2 / 2, D3 = (log(2))^3 / 6 for > Taylor serie, > but Speex source code uses different coefficients: > D0 = 1, D1 = log(2), D2 = 3 - 4*log(2), D3 = 3*log(2) - 2 > > Can anyone explain the difference? Was it done to equalize error along > range? How were obtained D2 and D3?It's actually a polynomial fit. That's better than Taylor series because, as you say, the error is better distributed. Jean-Marc
Jean-Marc Valin wrote on 8/1/2007 2:26 PM:>> Hi, >> I started to optimize math_approx fixed point functions to ARM CPU. And >> found out that approximations are not Taylor series, >> > > That's right. > > for example: > >> spx_exp2(x) = D0 + D1*x + D2*x^2 +D3*x^3, >> where D0 = 1, D1 = log(2), D2 = (log(2))^2 / 2, D3 = (log(2))^3 / 6 for >> Taylor serie, >> but Speex source code uses different coefficients: >> D0 = 1, D1 = log(2), D2 = 3 - 4*log(2), D3 = 3*log(2) - 2 >> >> Can anyone explain the difference? Was it done to equalize error along >> range? How were obtained D2 and D3? >> > > It's actually a polynomial fit. That's better than Taylor series > because, as you say, the error is better distributed. > > Jean-MarcThanks Jean-Marc! Could you please give me any links to the pages with theory? Oleg
> Thanks Jean-Marc! > Could you please give me any links to the pages with theory?Actually, I got the coefficients from some web page somewhere, but I forgot where. If you find it, let me know so I can actually give credit where credit is due. Jean-Marc