Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: Fast exponent and logarithm, given initial estimate
Posted:
Oct 20, 2004 4:30 AM
|
|
Glen Low wrote (snipped): > Still, I find it intriguing that you can evaluate a polynomial of > degree 6 with just 4 multiplications (instead of 5)... any sample > code? (It might save me a multiplication if I use x * 2^-2 on a degree > 6 polynomial...)
For degree 6, you can evaluate a real polynomial in x using 4 multiplications and 7 additions with the code
z = (x + a0)*x + a1 w = (x + a2)*z + a3 the value of the polynomial = ((w + z + a4)*w + a5) * a6
You need to solve a cubic equation to work out the constants a0-a6 given the initial coefficients; however there will always be a real solution.
You mentioned fused multiply-adds. This algorithm requires 4 multiplies/fused multiply-adds and just 4 additions. I don't know if you can get the number of additions down even further.
|
|
|
|