You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ __Arithmetic Operations__
113
113
###Language-independent optimization
114
114
115
115
116
-
* __Re-arranging Expressions__ : More efficient code for the evaluation of an expression (or the computation of a process) can often be produced if the operations occuring in the expression are evaluated in a different order. This works because by re-arranging expression/operations, what gets added or multiplied to what, gets changed, including the relative number of additions and multiplications, and thus the (overall) relative (computational) costs of each operation. In fact, this is not restricted to arithmetic operations, but any operations whatsoever using symmetries of the process/operators and re-arrange to produce same result while having other advantages. That is it, so simple. Classic examples are Horner's Rule <sup> [12] </sup>, Karatsuba Multiplication <sup> [13] </sup>, fast complex multiplication <sup> [14] </sup>, fast matrix multiplication <sup> [15], [16] </sup>, fast exponentiation <sup> [29], [30] </sup>, fast factorials/binomials <sup> [40], [41] </sup>, fast fourier transform <sup> [53] </sup>, sorting by merging <sup> [51] </sup>, sorting by powers <sup> [52] </sup>.
116
+
* __Re-arranging Expressions__ : More efficient code for the evaluation of an expression (or the computation of a process) can often be produced if the operations occuring in the expression are evaluated in a different order. This works because by re-arranging expression/operations, what gets added or multiplied to what, gets changed, including the relative number of additions and multiplications, and thus the (overall) relative (computational) costs of each operation. In fact, this is not restricted to arithmetic operations, but any operations whatsoever using symmetries (eg commutative laws, associative laws and distributive laws, when they indeed hold, are actualy examples of arithmetic operator symmetries) of the process/operators and re-arrange to produce same result while having other advantages. That is it, so simple. Classic examples are Horner's Rule <sup> [12] </sup>, Karatsuba Multiplication <sup> [13] </sup>, fast complex multiplication <sup> [14] </sup>, fast matrix multiplication <sup> [15], [16] </sup>, fast exponentiation <sup> [29], [30] </sup>, fast factorials/binomials <sup> [40], [41] </sup>, fast fourier transform <sup> [53] </sup>, sorting by merging <sup> [51] </sup>, sorting by powers <sup> [52] </sup>.
117
117
118
118
119
119
*__Constant Substitution/Propagation__ : Many times an expression is under all cases evaluated to a single constant, the constant value can be replaced instead of the more complex and slower expression (sometimes compilers do that).
0 commit comments