Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ucla-cs.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!ucla-cs!jimc From: jimc@ucla-cs.UUCP Newsgroups: net.lang.c Subject: Re: C Floating point arithmetic Message-ID: <7935@ucla-cs.ARPA> Date: Mon, 9-Dec-85 18:14:04 EST Article-I.D.: ucla-cs.7935 Posted: Mon Dec 9 18:14:04 1985 Date-Received: Thu, 12-Dec-85 05:18:38 EST References: <706@lasspvax.UUCP> <4614@alice.UUCP> <2487@cal-dbb.fluke.UUCP> Reply-To: jimc@ucla-cs.UUCP (Jim Carter) Organization: UCLA Computer Science Department Lines: 26 In article <4614@alice.UUCP> ark@alice.UucP (Andrew Koenig) writes: >No -- on most machines, single-precision does not offer enough significance >for serious number-crunching, so people tend to use double-precision >anyway if they care about the results. Once I worked on a polynomial root package. I found that real roots from double real coefficients could be found with just about equal performance as complex roots from single precision complex coefficients. That is, the speed of the (two different) algorithms as a function of polynomial order was about the same, the errors in the roots were similar, and the maximum order before errors made the roots useless was about the same. Obviously :-) it's because the number of bits per coefficient was about the same in both cases. Here's a "valid" use of single precision. In another project, I cleaned up a brute-force polynomial fitter by using suitably selected orthogonal polynomials. I can't quite remember the numbers, but I think the error was acceptable up to order only 4 with x**j for a basis, but I could do 8th order using an orthogonal basis. This was in single precision, and 8th order was far beyond what the measurement accuracy could justify. Numerical performance is very sensitive to the method, and sometimes you really need the speed and/or compactness of single precision, so it behooves you to be serious in choosing the method. James F. Carter (213) 206-1306 UCLA-SEASnet; 2567 Boelter Hall; 405 Hilgard Ave.; Los Angeles, CA 90024 UUCP:...!{ihnp4,ucbvax,{hao!cepu}}!ucla-cs!jimc ARPA:jimc@locus.UCLA.EDU