Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12891

Re: Floating point multiplication in python

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'received:verizon.net': 0.07; 'terry': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:python': 0.11; 'am,': 0.12; 'float': 0.13; 'reedy': 0.16; 'values:': 0.16; 'zero,': 0.16; 'this:': 0.16; 'wrote:': 0.16; 'jan': 0.19; 'assume': 0.22; 'header:In-Reply-To:1': 0.22; 'fairly': 0.30; 'important,': 0.30; 'usual': 0.31; 'error': 0.32; 'error.': 0.32; 'to:addr:python-list': 0.33; 'header:User- Agent:1': 0.34; 'header:X-Complaints-To:1': 0.35; 'subject:skip:m 10': 0.37; 'received:org': 0.38; 'steven': 0.38; 'subject:: ': 0.39; 'enough': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'square': 0.67; 'exact': 0.68; 'increases': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Floating point multiplication in python
Date Wed, 07 Sep 2011 05:37:32 -0400
References <mailman.790.1315289581.27778.python-list@python.org> <j44rre$e4c$1@r03.glglgl.eu> <2204592.egLE2XKegd@PointedEars.de> <4e66f843$0$29969$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-74-109-121-73.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0
In-Reply-To <4e66f843$0$29969$c3e8da3$5496439d@news.astraweb.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.830.1315388323.27778.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1315388323 news.xs4all.nl 2462 [2001:888:2000:d::a6]:42988
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:12891

Show key headers only | View raw


On 9/7/2011 12:51 AM, Steven D'Aprano wrote:

> So given a float x, when you square it you get this:
>
> Exact values: a*a = a**2
>
> Float values: x*x = (a+e)(a+e)
>                    = a**2 + 2*a*e + e**2
>
> So the error term has increased from e to (2*a*e+e**2). It is usual to
> assume that e**2 is small enough that it underflows to zero, so we have the
> error term e increasing to 2*a*e as a fairly simple estimate of the new
> error.

And the relative error, which is what is often important, increases from 
e/a to 2e/a.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Floating point multiplication in python xyz <xyzhtml@163.com> - 2011-09-06 13:57 +0800
  Re: Floating point multiplication in python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-06 17:11 +1000
  Re: Floating point multiplication in python Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-09-06 12:14 +0200
    Re: Floating point multiplication in python Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-09-06 18:07 +0200
      Re: Floating point multiplication in python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-07 14:51 +1000
        Re: Floating point multiplication in python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-09-06 23:35 -0700
        Re: Floating point multiplication in python Gelonida N <gelonida@gmail.com> - 2011-09-07 10:57 +0200
        Re: Floating point multiplication in python Terry Reedy <tjreedy@udel.edu> - 2011-09-07 05:37 -0400

csiph-web