Roger Hui <[email protected]> writes:

> The following was written by Ken Iverson in 1966
> http://www.jsoftware.com/papers/EvalOrder.htm
> and is relevant to your example.

Thanks.  I'd seen that before, when experimenting some with polynomials.
It certainly demonstrates that APL-like notation is precise and concise,
but (at least for now) I find it a little harder to manipulate.

> For example, instead of +/(y-ym)^2 , write
> +/ *: y-ym
>
> +/((y-f)-(ym-f))^2
> +/ *: (y-f) - (ym-f)
>
> (+/(y-f)^2)+(+/(f-ym)^2)+2*+/(y-f)*(f-ym)
> (+/*:y-f) + (+/*:f-ym) + +: +/ (y-f) * (f-ym)

That does look clearer.  While I don't find the replacement of 2* with
+: to help, replacing ()^2 with *:() definitely does.

> Another advantage of J notation over CMN,
> is that you can begin by assigning typical
> values for y, ym, and f, and as you are evolving
> the line you can enter each line into the 
> computer and verify that they give the same
> results from line to line.

I did this exact thing, and I definitely found it to be helpful.  In
addition, it gave me some rough magnitude intuition into the various
components of the sums that I wouldn't have if just writing out the
algebra.

Regards,
Johann

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

Reply via email to