🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs
Article #166

Re: C log function inaccurate (with fix) (many UNIX versions)

#166
From: Geoffrey Collyer
Date: Sat, 07 Jan 1984 22:37
41 lines
2164 bytes
DDT
	BAD:  p2 = -.963769093368686593e1;
	GOOD: p2 = -.963769093377840513e1;
	                       ^^^^^^^^

	Related question: the source states
		"The coefficients are #2705 from Hart & Cheney. (19.38D)".
	We cannot locate this reference in our institute's library.
	Does someone know what this references, and give us a more precise pointer?

	Guido van Rossum, {philabs,decvax}!mcvax!guido
	Centre for Mathematics and Computer Science, (CWI, formerly MC), Amsterdam
---
The oft-cited Hart & Cheney is

	Computer Approximations
	John F. Hart, E. W. Cheney, Charles L. Lawson, Hans J. Maehly,
	Charles K. Mesztenyi, John R. Rice, Henry G. Thacher, Jr.,
	Christoph Witzgall
	Robert E. Kreiger Publishing Company, 645 New York Avenue,
	Huntington, New York 11743, 1978
	Copyright 1968 by John Wiley & Sons, Inc.
	Original edition 1968
	Reprint 1978 with corrections
	Library of Congress: QA297.C64 1978
	ISBN 0-88275-642-7

This book appears to have been used as a source of coefficients
throughout the mathematical library (-lm).

The ``BAD'' p2 coefficient above is from table 2705 on p. 195.
p. 111 explains that this table is coefficients for computing
ln(x) as approximately z*(zP(z^2)/Q(z^2)), z=(x-1)/(x+1)
where x is on the range [1/sqrt(2), sqrt(2)]
and yields a precision of 19.38, where precision is defined as
``the range of validity of the approximation (-log10(maximum error))''
(p. 83).  I'm *certainly* no numerical analyst, but I read that to
mean that precision is the number of significant digits that may
be assumed to be correct.

Geoff Collyer, U. of Toronto
Technical Details
Message-ID: <1620@utcsstat.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utcsstat!geoff
References: <5582@mcvax.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site utcsstat.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utcsstat!geoff
From: geoff@utcsstat.UUCP (Geoffrey Collyer)
Newsgroups: net.bugs
Subject: Re: C log function inaccurate (with fix) (many UNIX versions)
Message-ID: <1620@utcsstat.UUCP>
Date: Sat, 7-Jan-84 17:37:59 EST
Article-I.D.: utcsstat.1620
Posted: Sat Jan  7 17:37:59 1984
Date-Received: Sat, 7-Jan-84 18:44:23 EST
References: <5582@mcvax.UUCP>
Organization: U. of Toronto, Canada
Lines: 41