http://www.mathmarauder.com/archives/178

That function F, written in tacit J, might look like this:

   F=: ([: +/@:- [: */"1@:- [ ^/ (^"1 #:@i.@^~&2@#)@]) q:@]

Or, in explicit J, might look like this:

F=:dyad define
  t=. q:y
  +/-*/"1-x^/t^"1#:i.2^#t
)

As the explicit form is more compact than the tacit form, I think I
prefer it for this case.

Also, in this case, I think I prefer having an explicit variable
representing the factors (rather than simply relying on a hook to get
the needed two copies of them).

But I think composing both can be a worthwhile exercise.

Thanks,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to