(Note that this is not generating the most efficient possible code, because 
it is computing all of the polynomial terms independently, when in 
principle they could share multiplications.   A more efficient version 
would precompute x1^2,x1^3,x1^4,.... and so on for each of the variables, 
using repeated multiplication rather than ^, and then use these precomputed 
powers.   If N is large this will make a big difference in the speed.  The 
nice thing about code generation is that it is really practical to pull out 
all the tricks, without losing flexibility, when performance really 
matters.)

Reply via email to