Re: [Jprogramming] Comparing J speed

2015-09-02 Thread aai
The main reason for speed difference is that big integer calculation in Haskell is based on the GNU Multiple Precision Arithmetic Library (/GMP/), much faster than J's extended precision number calculation. Op 2-9-2015 om 02:32 schreef Jon Hough: In this talk

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Jon Hough
e: Wed, 2 Sep 2015 00:04:17 -0400 > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] Comparing J speed > > There's a variety of fibonacci implementations at > http://www.jsoftware.com/jwiki/Essays/Fibonacci%20Sequence > > I haven't looked at their timings, b

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Raul Miller
On Wed, Sep 2, 2015 at 10:56 AM, Mike Day wrote: > The Haskell implementation must be really tight, though. > Rademacher talks about lazy evaluation, but his function > _appears_ to employ a list of all prior Fibonacci numbers > to produce the required element. I

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Vijay Lulla
Fibonacci number (F_31). >> >> 1346269 is the hypotenuse of 2 primitive Pythagorean triples: >> 1346269^2 = 184981^2+1333500^2 = 602069^2+1204140^2 >> >> >>> Date: Wed, 2 Sep 2015 01:32:45 +0100 >>> From: Jon Hough<jgho...@outlook.com> >>&g

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Raul Miller
On Wed, Sep 2, 2015 at 1:17 PM, 'Pascal Jasmin' via Programming > sslp =: IFWIN pick '';'D:\OpenSSL-Win64\bin\' I don't have that directory on any of my machines. This probably belongs in some other thread, also? Thanks, -- Raul

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread 'Pascal Jasmin' via Programming
To: programm...@jsoftware.com Cc: Sent: Wednesday, September 2, 2015 3:50 AM Subject: Re: [Jprogramming] Comparing J speed The main reason for speed difference is that big integer calculation in Haskell is based on the GNU Multiple Precision Arithmetic Library (/GMP/), much faster than

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Joe Bogner
Here's another one that mimics the zip/tail from the talk fib=: [: {. [: _2&{. [: ([: +/"1 [: (}: ,. }.) 1,1,]) / [: i. 1&- Slow though: timespacex 'fib 1000' 0.0179245 59648 timespacex 'fib 1' 0.638343 919808 I killed it after an hour running 475000 You can play with it with

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Jose Mario Quintana
> - Original Message - > From: Jon Hough <jgho...@outlook.com> > To: "programm...@jsoftware.com" <programm...@jsoftware.com> > Cc: > Sent: Tuesday, September 1, 2015 8:35 PM > Subject: Re: [Jprogramming] Comparing J speed > > Apologies for the messed

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Mike Day
Pace Raul, I'll post this here as it compares a J verb's speed with yet another Haskell fib function, and is arguably relevant to thoughts about efficient implementations of exact integer calculations in our language of choice. I don't really want to learn Haskell Google easily leads to a

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread aai
; To: "programm...@jsoftware.com" <programm...@jsoftware.com> Cc: Sent: Tuesday, September 1, 2015 8:35 PM Subject: Re: [Jprogramming] Comparing J speed Apologies for the messed up fib2, I'm seriously considering dumping outlook.com. From: jgho...@outlook.com To: programm...@jsof

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Murray Eisenberg
J does seem very awfully slow in executing, e.g., fib3 475000. On my iMac, that gives a timing of over 38 seconds. By contrast -- and to the extent that the timers involved can reasonably be compared -- on the same system, running the Wolfram Language looping definition fib[n_] :=

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Jose Mario Quintana
may, I wonder how the >> Haskell version compares to f7/f7a in the same machine... Does anyone >> know? >> >> >> >> >> On Tue, Sep 1, 2015 at 10:34 PM, 'Pascal Jasmin' via Programming < >> programm...@jsoftware.com> wrote: >> &g

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Joe Bogner
Some additional timings on my machine and comparison to MIcroJ In J: fib3=. ({: @:(({: , +/)@:]^:(2-~[))&1 1x) NB. For y >: 3! 6!:2 'fib3 475000' 60.7922 NB. fib test fibtest =: 3 : 0 x1 =. 1x x2 =. 1x c =. 0 while. c < (y-2) do. tmp =. x1 x1 =. x2 x2 =. tmp

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread 'Pascal Jasmin' via Programming
;programm...@jsoftware.com> Cc: Sent: Wednesday, September 2, 2015 4:53 PM Subject: Re: [Jprogramming] Comparing J speed That is a big factor but perhaps it is not quite a surprise to some members of this forum. Yes, I would like to see the Haskell version please; thanks in advance. It seems that

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Raul Miller
But of course, J is GPL'd now, so it's now legal to use GMP in J. Someone's still going to need to do the integration work, of course... (And it may very well be that that will expose some difficult corner cases.) -- Raul On Wed, Sep 2, 2015 at 3:50 AM, aai wrote: >

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread David Lambert
oftware.com" <programm...@jsoftware.com> Subject: [Jprogramming] Comparing J speed Message-ID:<dub125-w26a3268198fcd76285843ac...@phx.gbl> Content-Type: text/plain; charset="iso-8859-1" In this talkhttps://www.youtube.com/watch?v=apBWkBDVlow the presenter attempts t

Re: [Jprogramming] Comparing J speed

2015-09-02 Thread Mike Day
ftware.com> Subject: [Jprogramming] Comparing J speed Message-ID:<dub125-w26a3268198fcd76285843ac...@phx.gbl> Content-Type: text/plain; charset="iso-8859-1" In this talkhttps://www.youtube.com/watch?v=apBWkBDVlow the presenter attempts to show Haskell hasn't sacrificed speed for expres

Re: [Jprogramming] Comparing J speed

2015-09-01 Thread 'Pascal Jasmin' via Programming
<jgho...@outlook.com> To: "programm...@jsoftware.com" <programm...@jsoftware.com> Cc: Sent: Tuesday, September 1, 2015 8:35 PM Subject: Re: [Jprogramming] Comparing J speed Apologies for the messed up fib2, I'm seriously considering dumping outlook.com. > From: jgho...@o

Re: [Jprogramming] Comparing J speed

2015-09-01 Thread Jon Hough
Apologies for the messed up fib2, I'm seriously considering dumping outlook.com. > From: jgho...@outlook.com > To: programm...@jsoftware.com > Date: Wed, 2 Sep 2015 01:32:45 +0100 > Subject: [Jprogramming] Comparing J speed > > In this talk https://www.youtube.com/w

Re: [Jprogramming] Comparing J speed

2015-09-01 Thread Raul Miller
Actually, thinking about this, the performance for finding the 475000th fibonacci number is going to be dominated by the performance of extended precision addition (it's much larger than the largest representable floating point number). And J's current implementation while rather portable is not

Re: [Jprogramming] Comparing J speed

2015-09-01 Thread Raul Miller
There's a variety of fibonacci implementations at http://www.jsoftware.com/jwiki/Essays/Fibonacci%20Sequence I haven't looked at their timings, but you might find something interesting there. Good luck, -- Raul On Tue, Sep 1, 2015 at 8:32 PM, Jon Hough wrote: > In this