Predefinition of often used values in computations - does it change anything?
问题 I'm auto generating C code to compute large expressions and try to figure out with simple examples whether it makes sense to predefine certain subparts in separate variables. As a simple example, say we compute something of the form: #include <cmath> double test(double x, double y) { const double c[9][9] = { ... }; // constants properly initialized, irrelevant double expr = c[0][0]*x*y + c[1][0]*pow(x,2)*y + ... + c[8][0]*pow(x,9)*y + c[1][1]*pow(x,2)*pow(y,2) + ... + c[8][1]*pow(x,9)*pow(y,2