Re: [Jprogramming] A couple of J805/806 issues

2017-05-16 Thread Jose Mario Quintana
Thank you On Tue, May 16, 2017 at 6:48 PM, David Mitchell wrote: > It ran in J64-804 > > > On 5/16/2017 18:09, Jose Mario Quintana wrote: > >> 0. Wicked Crash in JQt805/806 >> >> Cloak=. ((5!:1)@:<'Cloak')Cloak=. (0:`)(,^:) >> 'evoke fix amper'=. <@:Cloak "0@:;: '`: f. &' >> train=.

Re: [Jprogramming] A couple of J805/806 issues

2017-05-16 Thread David Mitchell
It ran in J64-804 On 5/16/2017 18:09, Jose Mario Quintana wrote: 0. Wicked Crash in JQt805/806 Cloak=. ((5!:1)@:<'Cloak')Cloak=. (0:`)(,^:) 'evoke fix amper'=. <@:Cloak "0@:;: '`: f. &' train=. evoke&6 f. an=. <@:((,'0') ,&< ]) indet=. '' ($ ,) 128!:5 NB. Is Indeterminate

[Jprogramming] A couple of J805/806 issues

2017-05-16 Thread Jose Mario Quintana
0. Wicked Crash in JQt805/806 Cloak=. ((5!:1)@:<'Cloak')Cloak=. (0:`)(,^:) 'evoke fix amper'=. <@:Cloak "0@:;: '`: f. &' train=. evoke&6 f. an=. <@:((,'0') ,&< ]) indet=. '' ($ ,) 128!:5 NB. Is Indeterminate? eval=. {. train@:, an@:((train :: ])&.>)@:}. body=. ([ amper >@:{

Re: [Jprogramming] Precision of modular multiplication of quite large numbers

2017-05-16 Thread Raul Miller
I suspect /\. beats /\ because \ does not have special code taking advantage of m&|@* being commutative. -- Raul On Tue, May 16, 2017 at 12:51 PM, 'Mike Day' via Programming wrote: > Yep - a blocky approach addresses the virtues of a vector approach and > > minimises the hit with extended. Cou

Re: [Jprogramming] Precision of modular multiplication of quite large numbers

2017-05-16 Thread 'Mike Day' via Programming
Yep - a blocky approach addresses the virtues of a vector approach and minimises the hit with extended. Could fine tune it but why bother!? I quite often end up using blocks in this sort of fashion, though overlooked it here. Note to self, though - must look into why /\. with reverse is bet

Re: [Jprogramming] Precision of modular multiplication of quite large numbers

2017-05-16 Thread Raul Miller
Oops, it's obvious why that version was bulkier. That said, this is much slower, for little advantage: timespacex'|. 281474976710656&|@*/&.x:\.1+2*i.-2^12' 8.45755 1.08915e6 I'll stick with my genseries proposal, I think. Thanks, -- Raul On Tue, May 16, 2017 at 12:04 PM, Raul Miller wr

Re: [Jprogramming] Precision of modular multiplication of quite large numbers

2017-05-16 Thread Raul Miller
Oops, need x: instead of <. |. 281474976710656&|@*/\.x:1+2*i.-2^24 Sorry about that, was using <. earlier to test whether that fixed the overflow issue (it does not), and grabbed that instance for this variant. This is bulkier, though, just like your */\ version: timespacex'|. 2814749767

Re: [Jprogramming] Precision of modular multiplication of quite large numbers

2017-05-16 Thread 'Mike Day' via Programming
It would be nice if it worked. Unfortunately (again!), for the actual size required, timer'_10{. |. 281474976710656&|@*/\.<.1+2*i.-2^24' +--+---+ |32.001|0 0 0 0 0 0 0 0 0 0| +--+---+ whereas the correct values are all > 0 This is why I needed specia

Re: [Jprogramming] Precision of modular multiplication of quite large numbers

2017-05-16 Thread Raul Miller
timespacex'|. 281474976710656&|@*/\.<.1+2*i.-2^12' 0.00096 331904 (281474976710656&|@*/\x:1+2*i.2^5) -: |. 281474976710656&|@*/\.<.1+2*i.-2^5 1 I hope this helps, -- Raul On Tue, May 16, 2017 at 10:31 AM, 'Mike Day' via Programming wrote: > Thanks again, Raul. > > Well - I'd actually m

Re: [Jprogramming] Precision of modular multiplication of quite large numbers

2017-05-16 Thread 'Mike Day' via Programming
Thanks again, Raul. Well - I'd actually meant ~2^24 odd numbers, 1... _1+2^25 - trust me to make a mistake in trying to simplify the presentation! Let's call it a typo. I don't think my post was a spoiler, as the problem needs quite a bit of insight elsewhere; this array helps in getting t

[Jprogramming] Jd 4.1

2017-05-16 Thread Eric Iverson
We are about to release Jd 4.1, a major Jd update. Details have been provided in the database forum. -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Precision of modular multiplication of quite large numbers

2017-05-16 Thread Raul Miller
Forgive me for asking, but isn't 33554431 = _1+2^25 ? Anyway, this seems to work for me: 281474976710656&|@*/x:1+2*i.2^23 I'll leave out the answer, out of respect for project euler (though maybe the rules allow that now?). timespacex'281474976710656&|@*/x:1+2*i.2^23' 12.457 1.67937e9 ..

Re: [Jprogramming] Precision of modular multiplication of quite large numbers

2017-05-16 Thread 'Mike Day' via Programming
Further info. I did solve the problem (Euler Project no 592). It needed the cumulative product of 2^23 odd numbers , 1 3 5 ...33554431, modulo 2^48 This verb works, but is pretty slow on my laptop, taking 5 to 6 minutes: cumoddprod =: 3 : 0 1 cumoddprod y : 'lo hi' =. y nc =. lo (>:@<.@-