From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sun, 2 Oct 2011 20:28:46 +0200 From: tlaronde@polynum.com To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20111002182846.GA20646@polynum.com> References: <20111002163800.GA12773@polynum.com> <20111002175227.2D7F1B856@mail.bitblocks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20111002175227.2D7F1B856@mail.bitblocks.com> User-Agent: Mutt/1.4.2.3i Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] circular fonctions: precision? Topicbox-Message-UUID: 2f51d0ba-ead7-11e9-9d60-3106f5b1d025 On Sun, Oct 02, 2011 at 10:52:27AM -0700, Bakul Shah wrote: > On Sun, 02 Oct 2011 18:38:00 +0200 tlaronde@polynum.com wrote: > > Hello, > >=20 > > Is there some documentation about the precision of the circular (i.e > > trigonometric) fonctions, depending on the (plan9) implementation and > > the hardware? >=20 > Do you mean precision (number of significant bits) or accuracy > (closeness to true value)? For a double the precision is 52 > bits, for a float 23. Sorry, I meant accuracy. >=20 > > To my limited knowledge, an OS is integer based, so the floating > > point support is mainly "user space" and is, despite IEEE754 and due = to > > the interaction between hardware, software, and programmer, really > > floating, but is there a range given for the association of OS/hardwa= re > > telling that say sin(r) or asin(s) is accurate, at worst, at some=20 > > epsilon near? >=20 > It depends on the algorithm used, not on the OS. The C > standard leaves accuracy upto the implementation. If you care, > you can compare the result of a C function with what bc(1) > computes for the same function (by using a suitably large > scale). Here, I mean by "OS" not the kernel, but the whole soft-system, i.e. here the implementation of libc and the direct use of sin(3) etc. It seems you've answered my badly formulated question: if I want to know exactly what I use, I must rely on some defined library linked against my software that implements directly the fonctions. (Testing against bc(1) is probably worth for having an idea; but the problem is that 1) the results depend on the system/implementation; 2) there may be singularities and testing the whole range with a small granularity is probably not an option.) I sometimes wonder if the more common 64bits will not someday see CAD or related software go back to scaled integer arithmetic =E0 la Intergraph dgn, where 64bits is enough for the range of coordinates and precision used... Thanks for the answer. --=20 Thierry Laronde http://www.kergis.com/ Key fingerprint =3D 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C