[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #42071] complex trig functions differ from Mat
From: |
Michael Godfrey |
Subject: |
[Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab |
Date: |
Tue, 08 Apr 2014 11:05:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0 |
URL:
<http://savannah.gnu.org/bugs/?42071>
Summary: complex trig functions differ from Matlab
Project: GNU Octave
Submitted by: godfrey
Submitted on: Tue 08 Apr 2014 11:05:55 AM GMT
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Inaccurate Result
Status: None
Assigned to: None
Originator Name: Godfrey
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: GNU/Linux
_______________________________________________________
Details:
I noticed the following:
exp(i*n*pi)
produces results which are significantly
different from and less accurate than Matlab.
For example:
function Octave Matlab
exp(i*pi) -1.0000e+00 + 1.2246e-16i -1.0000 + 0.0000i
Using format hex shows the differences more clearly
And, the relative error increases for increasing n
in exp(i*n*pi)
The problem also shows up for sin(i*n*pi), but the
error is much less.
While I am reporting this as a bug, the issue deserves
systematic and careful study. I do not know what math library
Matlab uses, but I would have expected the results between
Octave and Matlab to be quite close.
Note that in a number of cases, the signs of the results
differ between Octave and Matlab. This will, for
instance, affect iterative improvement type code at
values approaching multiples of i*pi.
So far I have only tried experiments with sin and exp.
And, for real arguments the results are much closer.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?42071>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab,
Michael Godfrey <=
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, Mike Miller, 2014/04/08
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, Michael Godfrey, 2014/04/08
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, Mike Miller, 2014/04/08
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, John W. Eaton, 2014/04/08
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, Michael Godfrey, 2014/04/08
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, Michael Godfrey, 2014/04/09
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, Mike Miller, 2014/04/09
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, John W. Eaton, 2014/04/09
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, Mike Miller, 2014/04/09
- [Octave-bug-tracker] [bug #42071] complex trig functions differ from Matlab, Michael Godfrey, 2014/04/09