Path: csiph.com!usenet.pasdenom.info!news.etla.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!feeds.news.ox.ac.uk!news.ox.ac.uk!zen.net.uk!hamilton.zen.co.uk!reader01.nrc01.news.zen.net.uk.POSTED!not-for-mail From: Nobody Subject: Re: Short-circuit Logic Date: Thu, 30 May 2013 23:55:25 +0100 User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.python References: <5f101d70-e51f-4531-9153-c92ee2486fd9@googlegroups.com> <51a1fc7b$0$30002$c3e8da3$5496439d@news.astraweb.com> <2abf4e9c-8c3b-4e2f-80c9-50c1f1d75c9d@googlegroups.com> <51a4b5a1$0$29966$c3e8da3$5496439d@news.astraweb.com> <04b90c02-833a-4bad-88ad-ab71178b8f79@googlegroups.com> <48519aa0-d0cd-4ffc-a2f5-2107465321d8@qn4g2000pbc.googlegroups.com> <51a6b969$0$29966$c3e8da3$5496439d@news.astraweb.com> <51a6e6b8$0$11118$c3e8da3@news.astraweb.com> <51a70df4$0$11118$c3e8da3@news.astraweb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lines: 19 Organization: Zen Internet NNTP-Posting-Host: 79bcb7e2.news.zen.co.uk X-Trace: DXC=@@Q<9VLcJ`j]TR9CI`A?^ja0UP_O8AJol=dR0\ckLKG`WeZ<[7LZNRfd8ZBjHUl7NmM2Z^cWRFGAk50YC[@beFHo X-Complaints-To: abuse@zen.co.uk Xref: csiph.com comp.lang.python:46551 On Thu, 30 May 2013 12:07:40 +0300, Jussi Piitulainen wrote: > I suppose this depends on the complexity of the process and the amount > of data that produced the numbers of interest. Many individual > floating point operations are required to be within an ulp or two of > the mathematically correct result, I think, and the rounding error > when parsing a written representation of a number should be similar. Elementary operations (+, -, *, /, %, sqrt) are supposed to be within +/- 0.5 ULP (for round-to-nearest), i.e. the actual result should be the closest representable value to the exact result. Transcendental functions should ideally be within +/- 1 ULP, i.e. the actual result should be one of the two closest representable values to the exact result. Determining the closest value isn't always feasible due to the "table-maker's dilemma", i.e. the fact that regardless of the number of digits used for intermediate results, the upper and lower bounds can remain on opposite sides of the dividing line.