From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Sun, 02 Oct 2011 20:28:46 +0200." <20111002182846.GA20646@polynum.com> References: <20111002163800.GA12773@polynum.com> <20111002175227.2D7F1B856@mail.bitblocks.com> <20111002182846.GA20646@polynum.com> Date: Sun, 2 Oct 2011 12:06:18 -0700 From: Bakul Shah Message-Id: <20111002190618.54195B852@mail.bitblocks.com> Subject: Re: [9fans] circular fonctions: precision? Topicbox-Message-UUID: 2f9a0d62-ead7-11e9-9d60-3106f5b1d025 On Sun, 02 Oct 2011 20:28:46 +0200 tlaronde@polynum.com wrote: > > 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. I meant only the kernel but with your definition, yes. > 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.) Portability, accuracy and speed. Can't have all three! If you are lucky you get two out of three :-) Alternatively you can figure out what accuracy you can live with and see if you can get it cheaply and efficiently. Comparison with bc for a few (random) values only to tell you how good are the libraries. There are probably numerical analytical papers on such things if you are so inclined... > 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... double precision seems enough for most things. ieee754-2008 has quad precision... Symbolic math package Macsyma (& Maxima) has had bigfloats (arbitray precision floating point) for decades. Supposedly some Common Lisp implementation have those as well. Mechanical CAD packages would probably get more benefit from symbolic math capabilities than just scaled integers (keep everything in formulas until when you absolutely need numerical results!).