> I believe I can write payment tacitly, however I'm having a bad time finding a tacit > form for RootMe (yet another false position root finding method adverb) > > mean =: +/ % # > RootMe =: 1 :'({.~ _2 2"_ {~ _1 1 1"_ -: [: * u)@:({. , mean , {:)'
David, your adverb has a common form: it takes a verb and produces a one-liner verb in terms of only one instance of the argument verb. Once you know the trick, there is an easy (but sometimes tedious) way to produce a tacit version of the adverb. First, you start with the product; turning on the box representation helps (at least helps me). Beware of line-wrapping... (9!:3) 5 2 NB. Box (display) and linear representations... ({.~ (_2 2"_ {~ _1 1 1"_ -: [: * u))@:({. , mean , {:) ({.~ (_2 2"_ {~ _1 1 1"_ -: [: * u))@:({. , mean , {:) ┌──────────────────────────────────────────────────────┬──┬─ ─────────────────┐ │┌──────┬─────────────────────────────────────────────┐│@:│┌ ──┬─┬───────────┐│ ││┌──┬─┐│┌──────────┬─────┬──────────────────────────┐││ ││{.│,│┌────┬─┬──┐││ │││{.│~│││┌────┬─┬─┐│┌─┬─┐│┌────────────┬──┬────────┐│││ ││ │ ││mean│,│{:│││ ││└──┴─┘│││_2 2│"│_│││{│~│││┌──────┬─┬─┐│-:│┌──┬─┬─┐││││ ││ │ │└────┴─┴──┘││ ││ ││└────┴─┴─┘│└─┴─┘│││_1 1 1│"│_││ ││[:│*│u│││││ │└──┴─┴───────────┘│ ││ ││ │ ││└──────┴─┴─┘│ │└──┴─┴─┘││││ │ │ ││ ││ │ │└────────────┴──┴────────┘│││ │ │ ││ │└──────────┴─────┴──────────────────────────┘││ │ │ │└──────┴─────────────────────────────────────────────┘│ │ │ └──────────────────────────────────────────────────────┴──┴─ ─────────────────┘ The argument verb (u) is inside the box representation structure of the product and the task is to put it there via a tacit adverb. So, you start from the inside box and, layer by layer (unless you have enough practice), you build the product by piping adverbs, u ([:`*`) (`:6) [: * u ┌──┬─┬─┐ │[:│*│u│ └──┴─┴─┘ u ([:`*`) (`:6) (_1 1 1"_`-:`) (`:6) _1 1 1"_ -: [: * u ┌────────────┬──┬────────┐ │┌──────┬─┬─┐│-:│┌──┬─┬─┐│ ││_1 1 1│"│_││ ││[:│*│u││ │└──────┴─┴─┘│ │└──┴─┴─┘│ └────────────┴──┴────────┘ u ([:`*`) (`:6) (_1 1 1"_`-:`) (`:6) ( _2 2"_`({~)`) (`:6) _2 2"_ {~ _1 1 1"_ -: [: * u ┌──────────┬─────┬──────────────────────────┐ │┌────┬─┬─┐│┌─┬─┐│┌────────────┬──┬────────┐│ ││_2 2│"│_│││{│~│││┌──────┬─┬─┐│-:│┌──┬─┬─┐││ │└────┴─┴─┘│└─┴─┘│││_1 1 1│"│_││ ││[:│*│u│││ │ │ ││└──────┴─┴─┘│ │└──┴─┴─┘││ │ │ │└────────────┴──┴────────┘│ └──────────┴─────┴──────────────────────────┘ u ([:`*`) (`:6) (_1 1 1"_`-:`) (`:6) ( _2 2"_`({~)`) (`:6) ({.~`) (`:6) {.~ (_2 2"_ {~ _1 1 1"_ -: [: * u) ┌──────┬─────────────────────────────────────────────┐ │┌──┬─┐│┌──────────┬─────┬──────────────────────────┐│ ││{.│~│││┌────┬─┬─┐│┌─┬─┐│┌────────────┬──┬────────┐││ │└──┴─┘│││_2 2│"│_│││{│~│││┌──────┬─┬─┐│-:│┌──┬─┬─┐│││ │ ││└────┴─┴─┘│└─┴─┘│││_1 1 1│"│_││ ││[:│*│u││││ │ ││ │ ││└──────┴─┴─┘│ │└──┴─┴─┘│││ │ ││ │ │└────────────┴──┴────────┘││ │ │└──────────┴─────┴──────────────────────────┘│ └──────┴─────────────────────────────────────────────┘ u ([:`*`) (`:6) (_1 1 1"_`-:`) (`:6) ( _2 2"_`({~)`) (`:6) ({.~`) (`:6) (@:({. , mean , {:)) ({.~ (_2 2"_ {~ _1 1 1"_ -: [: * u))@:({. , mean , {:) ┌──────────────────────────────────────────────────────┬──┬─ ─────────────────┐ │┌──────┬─────────────────────────────────────────────┐│@:│┌ ──┬─┬───────────┐│ ││┌──┬─┐│┌──────────┬─────┬──────────────────────────┐││ ││{.│,│┌────┬─┬──┐││ │││{.│~│││┌────┬─┬─┐│┌─┬─┐│┌────────────┬──┬────────┐│││ ││ │ ││mean│,│{:│││ ││└──┴─┘│││_2 2│"│_│││{│~│││┌──────┬─┬─┐│-:│┌──┬─┬─┐││││ ││ │ │└────┴─┴──┘││ ││ ││└────┴─┴─┘│└─┴─┘│││_1 1 1│"│_││ ││[:│*│u│││││ │└──┴─┴───────────┘│ ││ ││ │ ││└──────┴─┴─┘│ │└──┴─┴─┘││││ │ │ ││ ││ │ │└────────────┴──┴────────┘│││ │ │ ││ │└──────────┴─────┴──────────────────────────┘││ │ │ │└──────┴─────────────────────────────────────────────┘│ │ │ └──────────────────────────────────────────────────────┴──┴─ ─────────────────┘ Once you have reproduced the verb that you want, the tacit adverb is just the train of successive adverbs, RootMe=. ([:`*`) (`:6) (_1 1 1"_`-:`) (`:6) ( _2 2"_`({~)`) (`:6) ({.~`) (`:6) (@:({. , mean , {:)) u RootMe ({.~ (_2 2"_ {~ _1 1 1"_ -: [: * u))@:({. , mean , {:) ┌──────────────────────────────────────────────────────┬──┬─ ─────────────────┐ │┌──────┬─────────────────────────────────────────────┐│@:│┌ ──┬─┬───────────┐│ ││┌──┬─┐│┌──────────┬─────┬──────────────────────────┐││ ││{.│,│┌────┬─┬──┐││ │││{.│~│││┌────┬─┬─┐│┌─┬─┐│┌────────────┬──┬────────┐│││ ││ │ ││mean│,│{:│││ ││└──┴─┘│││_2 2│"│_│││{│~│││┌──────┬─┬─┐│-:│┌──┬─┬─┐││││ ││ │ │└────┴─┴──┘││ ││ ││└────┴─┴─┘│└─┴─┘│││_1 1 1│"│_││ ││[:│*│u│││││ │└──┴─┴───────────┘│ ││ ││ │ ││└──────┴─┴─┘│ │└──┴─┴─┘││││ │ │ ││ ││ │ │└────────────┴──┴────────┘│││ │ │ ││ │└──────────┴─────┴──────────────────────────┘││ │ │ │└──────┴─────────────────────────────────────────────┘│ │ │ └──────────────────────────────────────────────────────┴──┴─ ─────────────────┘ One gets the impression that this process could even be automated and probably that is the case. Actually, I have written a (tacit, of course) adverb which can automatically produce a tacit version of RootMe using another method which also allows the verb produced to be in terms of several instances of the argument verb; moreover, a variant of this latter method allows to produce tacit adverbs automatically for even more complicated forms, more on that later. I hope it helps. On Fri, Sep 14, 2018 at 11:52 AM, David Lambert <b49p23t...@gmail.com> wrote: > I believe I can write payment tacitly, however I'm having a bad time > finding a tacit form for RootMe (yet another false position root finding > method adverb) > > mean =: +/ % # > RootMe =: 1 :'({.~ _2 2"_ {~ _1 1 1"_ -: [: * u)@:({. , mean , {:)' > > Also, given that 13 : is known to have bugs (or is it repaired in current > j versions?) Using 13 :literal forms need testing before trusted. > > left hook and right hook > monad hook, hook dyadic > yeah wonderful hook! > > Here's a fairly direct translation of > > pmt=: 3 : 0 > 0 pmt y > : > 'r t b'=. y > D=.(1 + r % 1200) ^ t > b*(r % 1200) * D % D - 1 > ) > ..................... > > r =: 0&{ > t =: 1&{ > b =: 2&{ > payment_tacit_dwl =: b * (r % 1200) * (% <:)@:((1 + r % 1200) ^ t) > > > NB. "And our paranoia test is:" > payment_tacit_dwl 5.75 240 12500 > 57.4868 > > ...................... > > > |Date: Thu, 13 Sep 2018 14:34:03 +0000 > |From: Linda Alvord <lindaalvor...@outlook.com> > |To: "programm...@jsoftware.com" <programm...@jsoftware.com> > |Subject: Re: [Jprogramming] Tacit form: How to handle intermediate > |Message-ID: > | <MWHPR06MB31521FE1003DD716F29C2529B51A0@MWHPR06MB3152.namprd > 06.prod.outlook.com> > | > |Content-Type: text/plain; charset="utf-8" > | > |Here are two tacit verb for pmt from Raul, > | > | > |pmt1200=:(%<:)@D * 1 0 1 */ .# ] > | pmt=: pmt1200@(%&1200 1 1) > | pmt 5.75 240 12500 > |87.7604 > | > | D > |[: (^~ >:)/ (2 3$0 1 0 1 0 0) +/ .* ] > | > | pmt1200 > |(% <:)@D * 1 0 1 */ .# ] > | > |Can anyone other than Raul or Rob) writ an explicit OR tacit single > sentence definition for: > | > |PMREX=: > | > |PMTTA=: > | > |Cheers, Linda > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm