0

Just wanted to confirm my answer here again:

Q: Evaluate $$p(x)=1-\frac{x^3}{3!}+\frac{x^6}{6!}-\frac{x^9}{9!}+\frac{x^{12}}{12!}-\frac{x^{15}}{15!}$$ as efficiently as possible. How many multiplications are necessarY? Assume all coefficients have been computed and stored for later use.

My answer: $u=x^3$ and evaluate: $$p(u)=1-\frac{u}{6}+\frac{u^2}{720}-\frac{u^3}{362880}+\frac{u^4}{479001600}-\frac{u^5}{1307674368000}$$ Necessary Multiplications: $6$.

Thanks for any and all help!

2 Answers2

1

$$ y = x^3/6 $$

$$ p(x)=1-y \left(1 - \frac{y}{20} \left(1 - \frac{y}{84} \left(1 -\frac{y}{220} \left(1 - \frac{y}{455}\right)\right)\right) \right) $$

MartinG
  • 978
1

You would need a few less multiplications if you apply Horner's rule. See for example, http://mathworld.wolfram.com/Polynomial.html .

MasB
  • 1,151