I am trying to evaluate a function, which has simplified form as below.
f[a_] := 5*a
X[a_, b_]:=Module[{A= f[a], g[b] = 6*b, x = A + g[b]}, x];
Table[ParallelTable[X[a, b], {b, 1, 6400}], {a, 1, 40}]
Now, my problem is that for 6400 runs over "b", f[a] is calculated every time, in spite of being put under the module. This is what, I want to avoid as for all the runs over 'b', f[a] to remain same. I am not able to figure out how to achieve this. Will appreciate any help.
ClearAll[X];X[a_, b_]:=Module[{A= f[a], g[b] = 6*b}, A + g[b]];? – kglr Feb 05 '21 at 12:52ParallelTable[5 a + 6 b, {b, 1, 6400}, {a, 1, 40}]? Seems there are only simple calculation? – AsukaMinato Feb 05 '21 at 12:53