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

Geoffrey Collyer geoff at utcsstat.UUCP
Sun Jan 8 08:37:59 AEST 1984


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



More information about the Net.bugs mailing list