TL DR
Per comments , short answer; the exact equivalent of the original, explicit newton_i and newton , respectively:
n_i =: d.0 1 (%/@:) (]`-`) (`:6) newton =: n_i (^:_)
Some methods for obtaining such translations can generally be found on the J Forums .
Construction
The key considerations here are that (a) the function is identical to its “zero derivative” and that (b) we can calculate the “zero” and the first derivative of the function from J at the same time, thanks to the language-oriented character. The rest is just collecting stamps.
In an ideal world defined by the function f , we would like to create a verb similar to (] - f % f d. 1) . The problem is that silent adverbial programming in J restricts us to creating a verb that mentions the input function ( f ) once and only once.
So, instead, we use a tricky trick: we simultaneously compute two derivatives of f : the “zero” derivative (which is the identity function) and the first derivative.
load 'trig' sin NB. Sine function (special case of the "circle functions", o.) 1&o. sin d. 1 f. NB. First derivative of sine, sin'. 2&o. sin d. 0 f. NB. "Zeroeth" derivative of sine, ie sine. 1&o."0 sin d. 0 1 f. NB. Both, resulting in two outputs. (1&o. , 2&o.)"0 znfd =: d. 0 1 NB. Packaged up as a re-usable name. sin znfd f. (1&o. , 2&o.)"0
Then we just insert the separation between them:
dh =: znfd (%/@) NB. Quotient of first-derivative over 0th-derivattive sin dh %/@(sin d.0 1) sin dh f. %/@((1&o. , 2&o.)"0) sin dh 1p1 NB. 0 _1.22465e_16 sin 1p1 NB. sin(pi) = 0 1.22465e_16 sin d. 1 ] 1p1 NB. sin'(pi) = -1 _1 sin dh 1p1 NB. sin(pi)/sin'(pi) = 0/-1 = 0 _1.22465e_16
(%/@) is to the right of znfd , because silent adverbial programming in J is LIFO (i.e., from left to right, where the "normal" J is from right to left).
Stamp collection
As I said, the remaining code is a simple collection of stamps using standard tools for constructing a verb train that subtracts this ratio from the original input:
ssub =: (]`-`) (`:6) NB. x - f(x) +: ssub NB. x - double(x) ] - +: -: ssub NB. x - halve(x) ] - -: -: ssub 16 NB. 16 - halve(16) 8 +: ssub 16 NB. 16 - double(16) _16 *: ssub 16 NB. 16 - square(16) _240 %: ssub 16 NB. 16 - sqrt(16) 12
In this way:
n_i =: znfd ssub NB. x - f'(x)/f(x)
And finally, using apply to the fixed point function ^:_ , we have:
newton =: n_i (^:_)
Voila.