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
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
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
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
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
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
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
> - 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
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
;
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
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_] :=
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
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
;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
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:
>
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
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
<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
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
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
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
21 matches
Mail list logo