How can I prevent mathematica from using the previous computation in new one? How do I make the code below to compute same amount of time without memorizing previous computation.

  In[25]:= AbsoluteTiming@Sum[i^3 + 4. i^2, {i, 1000000}]

Out[25]= {2.9587, 2.50002*10^23}

In[26]:= AbsoluteTiming@Sum[i^3 + 4. i^2, {i, 1000000}]

Out[26]= {2.64804, 2.50002*10^23}

closed as off-topic by Jason B., user9660, dr.blochwave, MarcoB, m_goldberg Oct 21 '15 at 15:01

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Jason B., Community, dr.blochwave, MarcoB, m_goldberg
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    $\begingroup$ Look up ClearSystemCache[]. $\endgroup$ – J. M. is away Oct 21 '15 at 7:05
  • 1
    $\begingroup$ How reproducible is this? I don't find the same thing happening here $\endgroup$ – Jason B. Oct 21 '15 at 7:09
  • $\begingroup$ I made a mistake, in the first I used 4. in the second 4. So the expressions were not equivalent. Corrected. Seems to be little memorization going on here. Still good to know the ClearSystemCache[] $\endgroup$ – Al Guy Oct 21 '15 at 7:16

Browse other questions tagged or ask your own question.