This is the mail archive of the
`gcc@gcc.gnu.org`
mailing list for the GCC project.

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |

Other format: | [Raw text] |

*From*: Vincent Lefevre <vincent+gcc at vinc17 dot org>*To*: gcc at gcc dot gnu dot org*Date*: Fri, 3 Feb 2012 16:55:23 +0100*Subject*: Re: weird optimization in sin+cos, x86 backend*References*: <CADn89gRRwQ5uPGCDMGZo28ofnAQsvU5PURKxPuvOPF1+ZbvO8g@mail.gmail.com> <CAFiYyc1oLgmP-bs2eyvW134SEzLONUxpcgiXMS4XnmamrUZ-9Q@mail.gmail.com> <Pine.LNX.4.64.1202031535030.25409@wotan.suse.de> <4F2BF9B6.20903@adacore.com> <20120203152858.GC5312@xvii.vinc17.org> <4F2BFE66.8000802@adacore.com>

On 2012-02-03 10:33:58 -0500, Robert Dewar wrote: > On 2/3/2012 10:28 AM, Vincent Lefevre wrote: > >If the user requested such a computation, there should at least be > >some intent. Unless an option like -ffast-math is given, the result > >should be accurate. > > What is the basis for that claim? to me it seems useless to expect > anything from such absurd arguments. Can you site a requirement to > the contrary (other than your (to me) unrealistic expectations). > In particular, such large numbers are of course represented > imprecisely. Actually you don't know. Of course, the value probably comes from somewhere, where it is imprecise. But there are codes that assume that their input values should be regarded as exact or they will no longer work. Reasons can be that algorithms are designed in such a way and/or that consistency is important. A particular field is computational geometry. For instance, you have a point and a line given by their coordinates, which are in general imprecise. Nevertheless, one generally wants to consider that the point is always seen as being on one fixed side of the line (or exactly on the line). If some parts of the program, because they do not compute with high precision enough, behave as if the point were on some side and other parts behave as if the point were on the other side, this can yield important problems. Another property that one may want is "correct rounding", mainly for reproducibility. For instance, this was needed by the LHC@home project of CERN (to check results performed on different machines, IIRC), even though the results were complete chaos. -- Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

**Follow-Ups**:**Re: weird optimization in sin+cos, x86 backend***From:*Robert Dewar

**References**:**weird optimization in sin+cos, x86 backend***From:*Konstantin Vladimirov

**Re: weird optimization in sin+cos, x86 backend***From:*Richard Guenther

**Re: weird optimization in sin+cos, x86 backend***From:*Michael Matz

**Re: weird optimization in sin+cos, x86 backend***From:*Robert Dewar

**Re: weird optimization in sin+cos, x86 backend***From:*Vincent Lefevre

**Re: weird optimization in sin+cos, x86 backend***From:*Robert Dewar

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |