Here's another way to express your concept:

   ((+/ .* 1&|.) % */) 2 3 5

1.03333


Thanks,


-- 

Raul




On Wed, Oct 30, 2013 at 8:59 AM, Jan-Pieter Jacobs <
[email protected]> wrote:

> I'd write it tacitly like this:
>
>  (+/@(*/)@(,: 1&|.) % */) a b c
>
> This is mainly motivated by the fact that a * b + b* c + c*a  can be
> expressed as multiplying with a shifted version, then summing.
>
> Jan-Pieter
>
>
> 2013/10/30 Raul Miller <[email protected]>
>
> > On Wed, Oct 30, 2013 at 2:51 AM, Don Kelly <[email protected]> wrote:
> >
> > > You are right but it is a bit of serendipity  What I wanted is (a*b+
> > > b*c+c*a ) % c a b .
> > > it doesn't matter how the pairs are formed in the numerator ac+ba+cb is
> > > the same.
> > >
> >
> > Like this?
> >
> >    F=: +/ .* (</~i.3) +/ .* ] % */
> >
> > That's probably awful for speed, but it does express the idea.
> >
> > Thanks,
> >
> > --
> > Raul
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to