This is the mail archive of the 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]

Re: weird optimization in sin+cos, x86 backend

On 2/3/2012 1:12 PM, Konstantin Vladimirov wrote:

I agree, that this case have no practical value. It was autogenerated
between other thousands of tests and showed really strange results, so
I decided to ask. I thought, this value fits double precision range
and, according to C standard, all double-precision arithmetics must be
avaliable for it.

Yes, indeed and it was available. There was nothing "really strange" about the results. The only thing strange was your expectations here :-)

Thanks everybody for explanation, I will constrain trig function arguments, according to "x is separable with x+pi/4" rule. It seems, everything works inside this range.

Yes, it is a good idea to only generate useful tests when you are autogenerating, otherwise you will get garbage in garbage out :-)

--- With best regards, Konstantin

On Fri, Feb 3, 2012 at 7:13 PM, Robert Dewar<> wrote:
On 2/3/2012 10:01 AM, Michael Matz wrote:

No normal math library supports such an extreme range, even basic
identities (like cos^2+sin^2=1) aren't retained with such inputs.

I agree: the program is complete nonsense. It would be useful to know
what the intent was.

Ciao, Michael.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]