Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.048 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'argument': 0.05; 'received:134': 0.05; 'arguments': 0.09; 'calculating': 0.09; 'modulo': 0.09; 'useless': 0.09; 'mardi': 0.16; 'subject:non': 0.16; 'value.': 0.19; '>>>': 0.22; 'example': 0.22; 'header:User- Agent:1': 0.23; 'typical': 0.24; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'expansion': 0.30; 'usually': 0.31; 'post.': 0.31; 'really,': 0.31; 'reduced': 0.31; 'steven': 0.31; '-----': 0.33; 'not.': 0.33; 'something': 0.35; 'point.': 0.35; 'but': 0.35; 'there': 0.35; 'adjust': 0.36; 'cancel': 0.36; 'subject:skip:d 10': 0.36; 'subject:?': 0.36; 'changing': 0.37; 'two': 0.37; 'to:addr:python-list': 0.38; 'previous': 0.38; 'to:addr:python.org': 0.39; 'first': 0.61; 'email addr:gmail.com': 0.63; 'more': 0.64; 'relatively': 0.65; 'within': 0.65; 'series': 0.66; 'yes': 0.68; 'pardon': 0.84; 'reducing': 0.93; '2013': 0.98 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAGYgE1KGuA9G/2dsb2JhbABZhyW8LIE3gxkBBSMPAUURCxoCBRYLAgIJAwIBAgEPNhMGAgKHegMPoQ6IUw1XgSmBKYw7gn8WglKBKgOVe4FphhaGF4Uogx4 Date: Tue, 20 Aug 2013 09:55:44 +0200 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Importing variables non-deterministic? References: <520f9054$0$30000$c3e8da3$5496439d@news.astraweb.com> <5211C5BD.5040209@rece.vub.ac.be> <5211D464.5090303@rece.vub.ac.be> <52125071$0$29986$c3e8da3$5496439d@news.astraweb.com> <52130335$0$29885$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376985351 news.xs4all.nl 15893 [2001:888:2000:d::a6]:56929 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52723 Op 20-08-13 09:31, wxjmfauth@gmail.com schreef: > Le mardi 20 août 2013 08:55:18 UTC+2, Antoon Pardon a écrit : >> >>> >> > >> >> >> >>> If you consider the implementation of sin and cos functions, they usually >> >>> reduce the argument modulo π to something in the first quadrant, and then >> >>> use symmetry to adjust the value. So changing the value of pi could, in >> >>> principle, change the implementation of sin, cos and tan. >> >> >> >> Yes there is this aspect, which is a fair point. >> >> >> >> -- >> >> Antoon Pardon > > ----- > > Not really, see my previous post. This is only a geometric > interpretation, useless for calculation. No it is not. Steven is correct that if for example you want the value of sin(10), that in a typical implementation this will be reduced to calculating -sin(10 - 3π). This for two reasons. It is faster to first reduce the argument within the first kwadrant, do the series expansion and then correct for sign than to expand the series with the original argument and it is more acurate because first reducing asures that all terms will stay relatively small while using the original arguments can intrduce some large terms that will have to cancel each other but that will reduce acuracy. -- Antoon Pardon