3 ms·
TLDR: Due to loop-carried dependencies preventing parallelized execution: https://en.wikipedia.org/wiki/Loop_dependence_analysis#Loop-carried_dependence_vs._loo
by layer8 4y ago
TLDR: Due to loop-carried dependencies preventing parallelized execution: https://en.wikipedia.org/wiki/Loop_dependence_analysis#Loop-carried_dependence_vs._loop_independent_dependence https://en.wikipedia.org/wiki/Loop_dependence_analysis#Loop-...
In the 2 additions version, computation of the next iteration depends on the results of the preceding iteration. In the multiplication version, the computations are independent for each iteration, enabling parallel execution (by SIMD and/or pipelined/superscalar execution).