I don't know for sure what it's meant to achieve.
But it achieves it as shown, if you simply omit ';'
newton=. -:@(+ 2e4&%)
newton newton newton 1
2502.62
newton ^:3 [ 1
2502.62
newton ^:(i.3 5) [ 1
1 10000.5 5001.25 2502.62 1255.31
635.62 333.543 196.753 149.202 141.624
141.422 141.421 141.421 141.421 141.421
newton ^:_ [ 1
141.421
...Maybe it's the Newton-Raphson algorithm (successive approximation)
applied to finding the square root of 2e4?
Just an idea.
141.421 ^2
19999.9
Ian
On Thu, Mar 31, 2011 at 11:30 PM, David Ward Lambert
<[email protected]> wrote:
> http://www.jsoftware.com/jwiki/Doc/J4APL
>
> The document claims this:
>
>
> newton=. -:@(+ 2e4&;%)
>
> newton newton newton 1
> 2502.62
>
>
>
> However, as you can tell, it won't work in current j version.
>
> newton 1
> |domain error: newton
> | newton 1
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm