Expressions, Operators & Types

Answer & solution
Official answer: 7
Our answer: At most 6; official 7 is not minimal under algebraic refactoring
Step 1: Sparse Horner form is X((X²+4)X²+6)+5. An evaluation recomputing X² with one temporary can use seven additions/multiplications, explaining the official key 7. Step 2: However, expand X[(X²+2)²+2]+5: the square is X⁴+4X²+4, so multiplying X(X⁴+4X²+6)+5 gives the same polynomial. Step 3: Execute t=X*X; t=t+2; t=t*t; t=t+2; t=t*X; t=t+5. This uses only X and one temporary t, with three multiplications and three additions. Step 4: Six operations suffice, so 7 cannot be the unrestricted minimum. This is an upper-bound counterexample, not a proof that 6 is globally minimal. Keep the official answer and the open discrepancy separate; no unstated ban on algebraic refactoring has been supplied.