The adverse provides a succinct solution and helps performance as well.  It
also gave me the idea of using "agenda", like this (to cap values at "2"
instead of "_"):

(( +*:`2: @. (2:<|)"0)^:250~)"0(24%~i:_24)j.~/36%~_72+i.88

Thanks.

On Sat, Nov 1, 2014 at 8:44 AM, Cliff Reiter <[email protected]> wrote:

> You can use adverse too
> {&'#.'@(2:<|)@ (((+*:) :: _:)^:250~)"0(24%~i:_24)j.~/36%~_72+i.88
>
>
> On 10/31/2014 1:18 PM, Devon McCormick wrote:
>
>> Yes - I don't see how either.  In any case, I fixed it by changing the
>> lovely, simple "(+*:)" to a "capped" version:
>> 2&((2j2,~]){~[<[:|])@:(+*:)"0).
>> So, anyone who's interested in this should try
>>
>>     {&'#.'@(2:<|)@((2&((2j2 ,~ ]) {~ [ < [: |
>> ])@:(+*:)"0)^:30~)(24%~i:_24)j.~/36%~_72+i.88
>>
>> or, even better, this
>>
>>     load 'viewmat'
>>     viewmat ((2&((2j2 ,~ ]) {~ [ < [: |
>> ])@:(+*:)"0)^:20~)(512%~i:_512)j.~/419%~_825+i.1024
>>
>>
>> On Fri, Oct 31, 2014 at 12:24 PM, Joe Bogner <[email protected]> wrote:
>>
>>  I may be stating the obvious, but it looks like the numbers are
>>> doubling per iteration
>>>
>>> {. 0 {"1 ((+*:)^:8~)(12%~i:_12)j.~/18%~_36+i.44
>>> 4.41152e66j_1.05844e67
>>>
>>> {. 0 {"1 ((+*:)^:9~)(12%~i:_12)j.~/18%~_36+i.44
>>> _9.25685e133j_9.33868e133
>>>
>>> {. 0 {"1 ((+*:)^:10~)(12%~i:_12)j.~/18%~_36+i.44
>>> _1.52155e266j1.72894e268
>>>
>>> It overflows at 11
>>>
>>> I don't see how it could have worked with the same inputs above 10 before
>>>
>>> On Fri, Oct 31, 2014 at 11:54 AM, Aai <[email protected]> wrote:
>>>
>>>> Lowering the iteration to 11 gives me a result.
>>>>
>>>> Devon McCormick schreef op 31-10-14 om 16:49:
>>>>
>>>>  I don't know when it worked or on what version - I just have a snippet
>>>>>
>>>> in
>>>
>>>> a
>>>>> file.
>>>>>
>>>>> On Fri, Oct 31, 2014 at 10:51 AM, Joe Bogner <[email protected]>
>>>>>
>>>> wrote:
>>>
>>>> Hi Devon - any idea what version / platform it worked on? I tried
>>>>>> j6.02 and j8.01 32bit along with j8.03 64 bit and all reported the
>>>>>> same
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Oct 31, 2014 at 10:26 AM, Devon McCormick <[email protected]
>>>>>> >
>>>>>> wrote:
>>>>>>
>>>>>>> Hi -
>>>>>>>
>>>>>>> I think that this expression
>>>>>>>
>>>>>>>      {&'#.'@(2:<|)@((+*:)^:250~)(12%~i:_12)j.~/18%~_36+i.44
>>>>>>>
>>>>>>> used to work but now fails with "NaN error" if the value of the power
>>>>>>> iteration, shown as 250 here, is any greater than 10 or 11.
>>>>>>>
>>>>>>> Is anyone familiar with this?  Any idea why it used to work but now
>>>>>>>
>>>>>> fails?
>>>>>>
>>>>>>> Any idea on how to get it to work with more than 10 iterations?
>>>>>>>
>>>>>>> It's potentially a nice illustration of the power of J - or of the
>>>>>>>
>>>>>> power
>>>
>>>> of
>>>>>>
>>>>>>> "power".
>>>>>>>
>>>>>>> --
>>>>>>> Devon McCormick, CFA
>>>>>>> ------------------------------------------------------------
>>>>>>> ----------
>>>>>>> For information about J forums see
>>>>>>>
>>>>>> http://www.jsoftware.com/forums.htm
>>>
>>>> ----------------------------------------------------------------------
>>>>>> For information about J forums see http://www.jsoftware.com/
>>>>>> forums.htm
>>>>>>
>>>>>>
>>>>>  --
>>>> Met vriendelijke groet,
>>>> @@i = Arie Groeneveld
>>>>
>>>>
>>>> ----------------------------------------------------------------------
>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>>
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>>>
>>
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to