Induction Variable - Non-linear Induction Variables

Non-linear Induction Variables

The same optimizations can be applied to induction variables that are not necessarily linear functions of the loop counter; for example, the loop

j = 1; for (i=0; i < 10; ++i) { j = j << 1; }

may be converted to

for (i=0; i < 10; ++i) { j = 1 << i+1; }

Read more about this topic:  Induction Variable

Famous quotes containing the words induction and/or variables:

    One might get the impression that I recommend a new methodology which replaces induction by counterinduction and uses a multiplicity of theories, metaphysical views, fairy tales, instead of the customary pair theory/observation. This impression would certainly be mistaken. My intention is not to replace one set of general rules by another such set: my intention is rather to convince the reader that all methodologies, even the most obvious ones, have their limits.
    Paul Feyerabend (1924–1994)

    The variables of quantification, ‘something,’ ‘nothing,’ ‘everything,’ range over our whole ontology, whatever it may be; and we are convicted of a particular ontological presupposition if, and only if, the alleged presuppositum has to be reckoned among the entities over which our variables range in order to render one of our affirmations true.
    Willard Van Orman Quine (b. 1908)