Importing variables non-deterministic?

Antoon Pardon antoon.pardon at rece.vub.ac.be
Tue Aug 20 03:55:44 EDT 2013


Op 20-08-13 09:31, wxjmfauth at 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



More information about the Python-list mailing list