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]

Re: Sine and Cosine Accuracy


>>>>> "Scott" == Scott Robert Ladd <scott.ladd@coyotegulch.com> writes:

 Scott> Dave Korn wrote:
 >> It's difficult to tell from that quote, which lacks sufficient
 >> context, but you *appear* at first glance to be conflating the
 >> fundamental trignometric *functions* with the trignometric
 >> *identities* that are generally built up from those functions.
 >> That is to say, you appear to be quoting a statement that says

 Scott> Perhaps I didn't say it as clearly as I should, but I do
 Scott> indeed know the difference between the implementation and
 Scott> definition of the trigonometric identifies.

 Scott> The tradeoff is between absolute adherence to the C standard
 Scott> and the need to provide fast, accurate results for people who
 Scott> know their math. 

I'm really puzzled by that comment, partly because the text book quote
you gave doesn't match any math I ever learned.  Does "knowing your
math" translates to "believing that trig functions should be applied
only to arguments in the range 0 to 2pi"?  If so, I must object.

What *may* make sense is the creation of a new option (off by default)
that says "you're allowed to assume that all calls to trig functions
have arguments in the range x..y".  Then the question to be answered
is what x and y should be.  A possible answer is 0 and 2pi; another
answer that some might prefer is -pi to +pi.  Or it might be -2pi to
+2pi to accommodate both preferences at essentially no cost.

     paul



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