trig functions

Lance M. Optican - LMO lmo at lsr-vax.UUCP
Wed Nov 14 06:59:27 AEST 1990


----- Begin Included Message -----

>From uunet!vmb.brl.mil!info-iris-request Tue Nov 13 03:06:31 1990
Return-Path: <uunet!vmb.brl.mil!info-iris-request>
Received: from uunet.UUCP by  (4.1/SMI-4.0)
	id AA21136; Tue, 13 Nov 90 03:06:20 EST
Received: from VMB.BRL.MIL by uunet.uu.net (5.61/1.14) with SMTP 
	id AA15087; Tue, 13 Nov 90 01:37:08 -0500
Received: from vmb.brl.mil by VMB.brl.MIL id aa10955; 13 Nov 90 0:36 EST
Received: from vgr.brl.mil by VMB.BRL.MIL id aa10926; 13 Nov 90 0:23 EST
Received: from ucbvax.Berkeley.EDU by VGR.BRL.MIL id aa06765; 13 Nov 90 0:10 EST
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA06726; Mon, 12 Nov 90 21:10:44 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-iris at brl.mil (info-iris at brl.mil)
	(contact usenet at ucbvax.Berkeley.EDU if you have questions)
Date: 12 Nov 90 15:48:57 GMT
From: "Allan R. Wilks" <uunet!ucbvax.berkeley.edu!alice!allan>
Organization: AT&T Bell Laboratories, Murray Hill NJ
Subject: trig functions
Message-Id: <11609 at alice.att.com>
Sender: uunet!BRL.MIL!info-iris-request
To: info-iris at BRL.MIL
Status: R


Is it reasonable to expect the cosine of (exactly) 0 to be (exactly) 1?

$ cat > a.c <<!
#include <math.h>
main()
{
	printf("%g\n", 1.0-cos(0.0));
}
!
$ cc a.c -lm
$ a.out
1.11022e-16
$ cc a.c -lm43
$ a.out
0

Allan R. Wilks
AT&T Bell Labs
allan at research.att.com


----- End Included Message -----

It is reasonable to expect the maht library to perform well!  I
tried Allan Wilks program on both Sun/3 and Sun/4 machines, and
they both gave "0" as the difference between 1.0 and cos(0.0).
Who at SGI is responsible for the math library?  What standards
of compatibility are enforced with other machine architectures?

---------------------------------------------------+-----------------------
	Lance M. Optican			   |	uunet!lsr-vax!lmo 
	National Eye Institute, NIH, Bethesda, MD  |	(301) 496-3549    
---------------------------------------------------+-----------------------



More information about the Comp.sys.sgi mailing list