[Jprogramming] arithmetic sequence
Bo Jacoby
bojacoby at yahoo.dk
Sun Dec 23 19:21:55 UTC 2012
Skips special data does not justify his general conclusion: "The brute force solution is the fastest by several orders of magnitude. The closed form solution is slow AND uses lots of space". Other data give other conclusions.
closed
[: (,. (3r4 * <:)) 5&^
(10) 6!:2'closed 5'
1.82306e_5
(10) 6!:2'((0 3+*&5)^:5)1 0x'
8.04365e_5
(10) 6!:2'closed 50'
3.68924e_5
(10) 6!:2'((0 3+*&5)^:50)1 0x'
0.000332709
(10) 6!:2'closed 500'
2.99943e_5
(10) 6!:2'((0 3+*&5)^:500)1 0x'
0.00487965
It cannot be concluded that 'closed' is generally slower than the brute force computation. In the above cases 'closed' is faster.
- Bo
>________________________________
> Fra: Boyko Bantchev <boykobb at gmail.com>
>Til: programming at jsoftware.com
>Sendt: 18:21 søndag den 23. december 2012
>Emne: Re: [Jprogramming] arithmetic sequence
>
>On 23 December 2012 18:06, Bo Jacoby <bojacoby at yahoo.dk> wrote:
>> Skip's conclusion did not follow from his data in the first place.
>
>His conclusion is based on his data for producing a 5000-items long
>sequence. Not only is it valid but in fact it holds for *all* lengths
>where extended numbers are needed, i.e. practically always.
>----------------------------------------------------------------------
>For information about J forums see http://www.jsoftware.com/forums.htm
>
>
>
More information about the Programming
mailing list