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


Groups > comp.lang.python > #52730

Re: Importing variables non-deterministic?

Newsgroups comp.lang.python
Date 2013-08-20 02:15 -0700
References (7 earlier) <mailman.40.1376944517.19984.python-list@python.org> <52130335$0$29885$c3e8da3$5496439d@news.astraweb.com> <mailman.49.1376981719.19984.python-list@python.org> <c5e3e122-06df-49d0-846d-365525cd6380@googlegroups.com> <mailman.51.1376985351.19984.python-list@python.org>
Message-ID <3875e747-d33d-46ac-94ac-8f03ec5f9736@googlegroups.com> (permalink)
Subject Re: Importing variables non-deterministic?
From wxjmfauth@gmail.com

Show all headers | View raw


Le mardi 20 août 2013 09:55:44 UTC+2, Antoon Pardon a écrit :
> 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

Ok. Fine. I was aware of the serie expansion, not
about the reduction.

jmf

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


Thread

Importing variables non-deterministic? tmellman@googlemail.com - 2013-08-17 07:25 -0700
  Re: Importing variables non-deterministic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-17 15:01 +0000
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 09:14 +0200
    Re: Importing variables non-deterministic? Dave Angel <davea@davea.name> - 2013-08-19 07:45 +0000
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 10:16 +0200
      Re: Importing variables non-deterministic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-19 16:57 +0000
        Re: Importing variables non-deterministic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-19 17:16 +0000
          Re: Importing variables non-deterministic? Chris Angelico <rosuav@gmail.com> - 2013-08-19 18:25 +0100
        Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 19:40 +0200
    Re: Importing variables non-deterministic? Chris Angelico <rosuav@gmail.com> - 2013-08-19 09:32 +0100
      Re: Importing variables non-deterministic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-19 17:05 +0000
        Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 22:34 +0200
          Re: Importing variables non-deterministic? Steven D'Aprano <steve@pearwood.info> - 2013-08-20 05:48 +0000
            Re: Importing variables non-deterministic? wxjmfauth@gmail.com - 2013-08-19 23:40 -0700
            Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-20 08:55 +0200
              Re: Importing variables non-deterministic? wxjmfauth@gmail.com - 2013-08-20 00:31 -0700
                Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-20 09:55 +0200
                Re: Importing variables non-deterministic? wxjmfauth@gmail.com - 2013-08-20 02:15 -0700
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 11:03 +0200
    Re: Importing variables non-deterministic? Chris Angelico <rosuav@gmail.com> - 2013-08-19 10:18 +0100
    Re: Importing variables non-deterministic? Peter Otten <__peter__@web.de> - 2013-08-19 11:49 +0200
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 13:54 +0200
    Re: Importing variables non-deterministic? Dave Angel <davea@davea.name> - 2013-08-19 12:33 +0000
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 16:55 +0200
    Re: Importing variables non-deterministic? Chris Angelico <rosuav@gmail.com> - 2013-08-19 16:04 +0100
    Re: Importing variables non-deterministic? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-08-19 19:25 +0200
    Re: Importing variables non-deterministic? Ben Finney <ben+python@benfinney.id.au> - 2013-08-20 11:14 +1000

csiph-web