Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
March 13, 2004 [Bug?] dmd floating point precision | ||||
---|---|---|---|---|
| ||||
One of the results in the thread "[Performance] dmd outperforms gcc C and several others in trigonometric functions" is that dmd is slow in long arithmetic. One result I did not mention there: the output of the double arithmetic differs from gcc to dmd. I once read that the output of floating point operations is defined to the bit. If true, then the question is which of both is buggy. To have some ground to this I have run a bc script with scale set to thirty for some hours. The outputs: gcc: 10011632717.388229 dmd: 10011632717.505636 bc : 10011632717.40994285037819773240630676856 Needless to say, that the output from dmc is the same as that from dmd. The maximal error for a single fp operation for numbers in this magnitude is in the order of 2.22302903141305656980e-06. Comments? So long. |
March 13, 2004 Re: [Bug?] dmd floating point precision | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | Do you have a site where your posting the results of these tests ? C On Sat, 13 Mar 2004 01:03:26 +0100, Manfred Nowak <svv1999@hotmail.com> wrote: > One of the results in the thread "[Performance] dmd outperforms gcc C and > several others in trigonometric functions" is that dmd is slow in long > arithmetic. > > One result I did not mention there: the output of the double arithmetic > differs from gcc to dmd. I once read that the output of floating point > operations is defined to the bit. If true, then the question is which of > both is buggy. > > To have some ground to this I have run a bc script with scale set to > thirty for some hours. The outputs: > > gcc: 10011632717.388229 > dmd: 10011632717.505636 > bc : 10011632717.40994285037819773240630676856 > > Needless to say, that the output from dmc is the same as that from dmd. > > The maximal error for a single fp operation for numbers in this magnitude > is in the order of 2.22302903141305656980e-06. > > Comments? > > So long. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
March 13, 2004 Re: [Bug?] dmd floating point precision | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | There could be many reasons for the differences. Without seeing the code, there's no way to tell. "Manfred Nowak" <svv1999@hotmail.com> wrote in message news:c2tjre$2ve5$1@digitaldaemon.com... > One of the results in the thread "[Performance] dmd outperforms gcc C and several others in trigonometric functions" is that dmd is slow in long arithmetic. > > One result I did not mention there: the output of the double arithmetic differs from gcc to dmd. I once read that the output of floating point operations is defined to the bit. If true, then the question is which of both is buggy. > > To have some ground to this I have run a bc script with scale set to thirty for some hours. The outputs: > > gcc: 10011632717.388229 > dmd: 10011632717.505636 > bc : 10011632717.40994285037819773240630676856 > > Needless to say, that the output from dmc is the same as that from dmd. > > The maximal error for a single fp operation for numbers in this magnitude is in the order of 2.22302903141305656980e-06. > > Comments? > > So long. |
March 14, 2004 Re: [Bug?] dmd floating point precision | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote: > There could be many reasons for the differences. Without seeing the code, there's no way to tell. Because of the copyright of the code here is the link again: http://www.ocf.berkeley.edu/~cowell/research/benchmark/code/ The adaption D is straight forward, if needed at all. So long! |
March 14, 2004 Re: [Bug?] dmd floating point precision | ||||
---|---|---|---|---|
| ||||
Posted in reply to C | C wrote:
> Do you have a site where your posting the results of these tests ?
No. I do not want neither, not disqualify dmd in the public nor attract customers to M$.
So long!
|
March 21, 2004 Re: [Bug?] dmd floating point precision | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | "Manfred Nowak" <svv1999@hotmail.com> wrote in message news:c2tjre$2ve5$1@digitaldaemon.com... > One of the results in the thread "[Performance] dmd outperforms gcc C and several others in trigonometric functions" is that dmd is slow in long arithmetic. > > One result I did not mention there: the output of the double arithmetic differs from gcc to dmd. I once read that the output of floating point operations is defined to the bit. If true, then the question is which of both is buggy. > > To have some ground to this I have run a bc script with scale set to thirty for some hours. The outputs: > > gcc: 10011632717.388229 > dmd: 10011632717.505636 > bc : 10011632717.40994285037819773240630676856 > > Needless to say, that the output from dmc is the same as that from dmd. > > The maximal error for a single fp operation for numbers in this magnitude is in the order of 2.22302903141305656980e-06. > > Comments? The results differ likely because of how long the 80 bit temporaries are kept around. If you do it with long doubles, the answer comes pretty close to the bc one. |
March 22, 2004 Re: [Bug?] dmd floating point precision | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
[...]
>> gcc: 10011632717.388229
>> dmd: 10011632717.505636
>> bc : 10011632717.40994285037819773240630676856
> The results differ likely because of how long the 80 bit temporaries are kept around.
[...]
This answer implies that gcc is somehow better suited to problems that fall into the same category.
So long!
|
March 23, 2004 Re: [Bug?] dmd floating point precision | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak | "Manfred Nowak" <svv1999@hotmail.com> wrote in message news:c3llth$qgd$2@digitaldaemon.com... > Walter wrote: > > [...] > >> gcc: 10011632717.388229 > >> dmd: 10011632717.505636 > >> bc : 10011632717.40994285037819773240630676856 > > The results differ likely because of how long the 80 bit temporaries are kept around. > [...] > > This answer implies that gcc is somehow better suited to problems that fall into the same category. The "somehow" could be little more than a random side effect, not something to be relied on. If you want to rely on better precision, use long double instead of double. |
Copyright © 1999-2021 by the D Language Foundation