Purpose: to minimize the amount to mul calls in a program.
Examples | |||
---|---|---|---|
Before | Total Mul calls | After | Total Mul calls |
5x^3 + 4x^2 + 3x + 2 | 6 | ((5x + 4)x + 3)x + 2 | 3 |
6x^4 + 3x^2 + 8x + 1 | 7 | ((6x^2 + 3)x + 8)x + 1 | 4 |
6x^4 + 2x^3 + 3x^2 + 8x + 1 | 10 | ((6x + 2)x + 3)x + 8)x + 1 | 4 |