trig functions

David R. Blythe drb at eecg.toronto.edu
Sat Nov 17 14:07:19 AEST 1990


In article <11609 at alice.att.com> allan at alice.att.com (Allan R. Wilks) writes:
>
>Is it reasonable to expect the cosine of (exactly) 0 to be (exactly) 1?

No it is not.  Its reasonable to expect a result which meets the accuracy
specification for that routine.  In the case of libm43 cos() has an
accuracy of one unit in the last place (1 ulp) which for ieee double precision
is 1.1e-16.  This is documented in the intro manual pages for the math library
(i.e man math).  The faster cody&waite implementation of cos() in the libm 
library has an accuracy of 2 ulps.
	-drb
	drb at clsc.utoronto.ca




More information about the Comp.sys.sgi mailing list