[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45339] sind, cosd don't do range reduction ac
From: |
Charles Karney |
Subject: |
[Octave-bug-tracker] [bug #45339] sind, cosd don't do range reduction accurately |
Date: |
Wed, 17 Jun 2015 10:13:09 +0000 |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 |
URL:
<http://savannah.gnu.org/bugs/?45339>
Summary: sind, cosd don't do range reduction accurately
Project: GNU Octave
Submitted by: karney
Submitted on: Wed 17 Jun 2015 10:13:08 AM GMT
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Inaccurate Result
Status: None
Assigned to: None
Originator Name: karney
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.8.2
Operating System: GNU/Linux
_______________________________________________________
Details:
One of the reasons for working with degrees instead of radians
is that range reduction is exact. However, the octave trig
functions in terms of degrees don't make use of this. Thus
sind(1e9) + sind(80) returns 2e-10 instead of 0.
I attach replacements for these functions which remove this
deficiency and obey identities such as cosd(89) = sind(1).
Although the problems the atan2d are nearly as bad, I also
provide a replacement for this function which enforces the
quadrant symmetries.
The Matlab implementation of sind, cosd, atan2d behave
similarly to these attached versions.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Wed 17 Jun 2015 10:13:08 AM GMT Name: sindx.m Size: 319B By: karney
Replacements for sind, cosd, and atan2d
<http://savannah.gnu.org/bugs/download.php?file_id=34242>
-------------------------------------------------------
Date: Wed 17 Jun 2015 10:13:08 AM GMT Name: cosdx.m Size: 323B By: karney
Replacements for sind, cosd, and atan2d
<http://savannah.gnu.org/bugs/download.php?file_id=34243>
-------------------------------------------------------
Date: Wed 17 Jun 2015 10:13:08 AM GMT Name: atan2dx.m Size: 480B By:
karney
Replacements for sind, cosd, and atan2d
<http://savannah.gnu.org/bugs/download.php?file_id=34244>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45339>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #45339] sind, cosd don't do range reduction accurately,
Charles Karney <=