C Floating point arithmetic

Mark Hinds zoro at fluke.UUCP
Sat Dec 7 11:35:48 AEST 1985


In article <42 at brl-tgr.ARPA> gwyn at brl-tgr.ARPA (Doug Gwyn <gwyn>) writes:

>I agree that in most cases where the loss of speed might really
>matter, double precision is usually needed anyway to get
>meaningful results.  Some people, though, judge code more on how
>fast it runs than on whether it performs a useful function
>correctly.

	I previously worked for a physics lab that did simulations
	of shock waves traveling through materials. The programs
	which blindly used double precision for everything invariably
	ran significantly slower (half or worse) than those which
	used only the doubles that were really needed.

	The programs which made judicious use of doubles were just as
	"accurate" as the all double programs. Accuracy in this case
	is measured by how well simualtion could predict experimental
	results. The usuall result of inappropriate singles is not
	inaccuracy, but wildly erroneuos results and/or programs which
	hang due to non-convergence.

	Mark Hinds
-- 
____________________________________________________________
Mark Hinds                     {decvax,ihnp4}!uw-beaver!--\
John Fluke Mfg. Co., Inc.                 {sun,allegra}!---> fluke!zoro
(206) 356-6264                 {ucbvax,hplabs}!lbl-csam!--/



More information about the Comp.lang.c mailing list