Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!hofbauer From: hofbauer@utcsri.UUCP (John Hofbauer) Newsgroups: net.micro Subject: Re: Arctan approximation for generating pi Message-ID: <1878@utcsri.UUCP> Date: Wed, 1-Jan-86 19:34:46 EST Article-I.D.: utcsri.1878 Posted: Wed Jan 1 19:34:46 1986 Date-Received: Wed, 1-Jan-86 19:42:30 EST References: <1122@brl-tgr.ARPA> Organization: CSRI, University of Toronto Lines: 43 > > > Of course there are many better types of approximations than power series: > > .... > > about a point very close to zero, as some people suggested. > > I quite agree. I did not, however, want to clog the net with discussions > of numeric analysis considerations: I mildly disagree with you here. As a former numerical analyst I am constantly amused and appauled by the naive use of formulas from mathematics texts. George Forsythe wrote a delightful paper titled "Pitfalls in Computation or Why a Math book isn't Enough" on this subject. It appeared in the American Mathematical Monthly in November 1971. While I agree with you that we shouldn't clog net.micro with discussions of numerical analysis, people who read it do compute and so should be made aware of pitfalls they may inadvertently fall into, and evaluating approximating formulas with floating point numbers is fraught with pitfalls. > I'm not sure whether the practices of IBM Fortran compilers > constitute recommendations. ... > ... Furthermore, I'm sure none of us wants to > encourage programming techniques based on knowledge of how our > favourite compiler implements feature x. > While regretable, it is wise to know as much as possible about what compilers do to your programs, if for no other reason than self-preservation! I cited the IBM Fortran compiler as an example of a good implementation but that, of course, says nothing about other compilers. > > Wirth probably didn't include exponentiation in Pascal because of > > Wirth's design considerations for Pascal were more oriented around > human than machine. I'm now inclined to agree with you that the exclusion of exponentiation from Pascal was not specifically due to funny arithmetic on the CDC6600 but rather to the unpredictable, and unsafe, way exponentiation may be implemented in different compilers. At least this way user must use the the appropriate formula explicitly; unfortunately it doesn't follow that he will be any more aware of the pitfalls. On the other hand, he will be forced to discover that formal exponentiation is often unnecessary.