Greetings back atcha Michael, I am guessing that by using
ssq=. +/ @: *: it would be even quicker. :-) You may want to look into the f. adverb (Fix). http://www.jsoftware.com/help/dictionary/dfdot.htm Henry Riches has a good section in "J for C Programmers" on f. and may further help you understand what is going on. http://www.jsoftware.com/help/jforc/readable_tacit_definitions.htm#_Toc191734593 Cheers, bob > On Apr 17, 2017, at 1:51 PM, Michael Goodrich <[email protected]> > wrote: > > Greetings: > > Got a nasty surprise today. have a non-trivial J app with the following > supporting original definitions: > > sum =. +/ > dot =. +/ . * > sqrd =. *: > ssq =. +/ @: sqrd > > > Which I changed (thinking I was being elegant) to > > sum =. +/ > dot =. sum . * > sqrd =. *: > ssq =. sum @: sqrd > > After this change the run time increased by a factor of 5! > > Insights? > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
