Path: utzoo!attcan!uunet!samsung!noose.ecn.purdue.edu!mentor.cc.purdue.edu!seaman.cc.purdue.edu!ags From: ags@seaman.cc.purdue.edu (Dave Seaman) Newsgroups: comp.sys.handhelds Subject: Re: Interestring Property of HP-* Calculators Keywords: 48SX,COS Message-ID: <15610@mentor.cc.purdue.edu> Date: 24 Oct 90 17:29:36 GMT References: <2821@uc.msc.umn.edu> Sender: news@mentor.cc.purdue.edu Reply-To: ags@seaman.cc.purdue.edu (Dave Seaman) Organization: Purdue University Lines: 37 In article <2821@uc.msc.umn.edu> fin@norge.unet.umn.edu (Craig A. Finseth) writes: >This article describes an interesting *artifact*[1] of the mechanism >use for computing COS and ACOS. It has been tested on an HP-48SX and >TI-PROCALC (don't ask). It is *NOT* a bug report! It is not a property of HP calculators or of the "mechanism" used for computing COS and ACOS. It is merely a property of floating point arithmetic in general. The fixed point of COS (computed in degrees) and of ACOS (computed in degrees) is the same. The common value, to 20 places, is x0 = 0.99984774153108811295 which means that the HP48 computed the best 12-digit approximation, x1 = 0.999847741531 where the error x1-x0 is approximately -8.8 * 10^-14. Letting g(x) = 180/pi * arccos(x) we get the linear approximation g(x1) ~= g(x0) + (x1-x0)*g'(x0) where the g'(x0) term is approximately -3283.47, which explains why g(x1)-g(x0) is unexpectedly large. The linear approximation gives g(x1) ~= 0.999847741820 to twelve places, which agrees with the HP48 result to the very last digit. There is no way that any twelve-digit decimal-based machine could possibly give better results for this example than the HP48 does. -- Dave Seaman ags@seaman.cc.purdue.edu