p. represents my idea of polynomial evaluation in general. And of course if J incorporated special code for (+ *&y)/x then the #. implementation time might be exactly the same for the two sentences.
So while I do not object to your change, I still feel that the task itself is fundamentally flawed. In other words, if the task asked for the result of (+ *&y)/\.x then your implementation would be clearly superior. [And I think that if the tasked asked for this sequence that it would be a clear improvement over the current task - but I that kind of change would make existing implementations invalid, regardless of language.] -- Raul On Tue, May 14, 2013 at 9:54 AM, Elton Wang <[email protected]> wrote: > Raul, The task is on Horner rule, which does not mean polynomial evaluation > in general. > Anyway, I added a direct solution to the wiki as horner =: 4 : ' (+ *&y)/x'. > > On May 14, 2013, at 7:54 AM, Elton Wang <[email protected]> wrote: > >> In Rosetta code Horner code item, it uses (#.|.)~ as a solution. Is this >> right? I thought this is plain polynominal sum rather than horner rule, >> since for x#.y, the product scan of x is calculated first? > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
