operators - J: Tacit adverb of Newton's method -
i've found in 'addons/math/misc/brent.ijs'
implementation of brent's method , adverb. build newton's method adverb it's much harder building tacit verbs. here explicit version of newton's iteration:
newton_i =: 1 : '] - u % u d.1'
with such usage:
2&o. newton_i^:_ (1) nb. (-: 1p1) must found 1.5708 2 o. 1.5708 nb. after substitution 0 _3.67321e_6
and of course, convenience:
newton =: 1 : 'u newton_i^:_'
what's tacit equivalent?
per the comments, short answer; tacit equivalent original, explicit newton_i
, newton
are, respectively:
n_i =: d.0 1 (%/@:) (]`-`) (`:6) newton =: n_i (^:_)
some techniques how such translations obtained, in general, can found on the j forums.
operators j newtons-method tacit-programming
No comments:
Post a Comment