Re: double vs real

2013-05-31 Thread Timon Gehr
On 05/31/2013 01:28 PM, Shriramana Sharma wrote: On Fri, May 31, 2013 at 4:31 PM, Timon Gehr wrote: If double uses xmm registers and real uses the fpu registers (as is standard on x64), then double multiplication has twice the throughput of real multiplication on recent intel microarchitecture

Re: double vs real

2013-05-31 Thread Timon Gehr
On 05/31/2013 09:08 PM, John Colvin wrote: On Friday, 31 May 2013 at 16:17:28 UTC, Ali Çehreli wrote: On 05/31/2013 04:28 AM, Shriramana Sharma wrote: > On Fri, May 31, 2013 at 4:31 PM, Timon Gehr wrote: >> >> If double uses xmm registers and real uses the fpu registers (as is standard >> on x

Re: double vs real

2013-05-31 Thread John Colvin
On Friday, 31 May 2013 at 16:17:28 UTC, Ali Çehreli wrote: On 05/31/2013 04:28 AM, Shriramana Sharma wrote: > On Fri, May 31, 2013 at 4:31 PM, Timon Gehr wrote: >> >> If double uses xmm registers and real uses the fpu registers (as is standard >> on x64), then double multiplication has twice th

Re: double vs real

2013-05-31 Thread Ali Çehreli
On 05/31/2013 04:28 AM, Shriramana Sharma wrote: > On Fri, May 31, 2013 at 4:31 PM, Timon Gehr wrote: >> >> If double uses xmm registers and real uses the fpu registers (as is standard >> on x64), then double multiplication has twice the throughput of real >> multiplication on recent intel mic

Re: double vs real

2013-05-31 Thread Shriramana Sharma
On Fri, May 31, 2013 at 4:31 PM, Timon Gehr wrote: > > If double uses xmm registers and real uses the fpu registers (as is standard > on x64), then double multiplication has twice the throughput of real > multiplication on recent intel microarchitectures. Hi can you clarify that? I'm interested b

Re: double vs real

2013-05-31 Thread Timon Gehr
On 05/30/2013 06:45 PM, bearophile wrote: ... If you have to store many reals, they require more memory than doubles (how much is relative to the operating system). Regarding speed in theory double and real should give the same, ... If double uses xmm registers and real uses the fpu registers (

Re: double vs real

2013-05-30 Thread Marco Leise
Am Fri, 31 May 2013 07:02:11 +0530 schrieb Shriramana Sharma : > Thanks to all who replied. > > On Thu, May 30, 2013 at 10:07 PM, Diggory wrote: > > > > Since D does all operations at highest possible precision anyway (even for > > double or float) it only makes a difference when the value is be

Re: double vs real

2013-05-30 Thread Shriramana Sharma
Thanks to all who replied. On Thu, May 30, 2013 at 10:07 PM, Diggory wrote: > > Since D does all operations at highest possible precision anyway (even for > double or float) it only makes a difference when the value is being stored > to memory and then read back again. But isn't this true for ev

Re: double vs real

2013-05-30 Thread Joseph Rushton Wakeling
On 05/30/2013 06:45 PM, bearophile wrote: > Regarding speed in theory double and real > should give the same, but in practice theory and practice often differ. In my experience, using real slows things down, though the degree depends on use-case (mine involves lots of iterations and calculations o

Re: double vs real

2013-05-30 Thread Marco Leise
Am Thu, 30 May 2013 17:47:14 +0530 schrieb Shriramana Sharma : > Hello. I like that D exposes to me the real type to maximally utilize > the machine's numerical precision. Since I am writing a program > (currently in C++ but I am thinking of moving to D) that has to handle > lots of fractional num

Re: double vs real

2013-05-30 Thread bearophile
Shriramana Sharma: Hello. I like that D exposes to me the real type to maximally utilize the machine's numerical precision. Since I am writing a program (currently in C++ but I am thinking of moving to D) that has to handle lots of fractional numbers (calculating offset curves and such) I am

Re: double vs real

2013-05-30 Thread Diggory
On Thursday, 30 May 2013 at 16:18:44 UTC, Shriramana Sharma wrote: Hello. I like that D exposes to me the real type to maximally utilize the machine's numerical precision. Since I am writing a program (currently in C++ but I am thinking of moving to D) that has to handle lots of fractional numb

double vs real

2013-05-30 Thread Shriramana Sharma
Hello. I like that D exposes to me the real type to maximally utilize the machine's numerical precision. Since I am writing a program (currently in C++ but I am thinking of moving to D) that has to handle lots of fractional numbers (calculating offset curves and such) I am wondering whether/when I