octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #43349] asin behaves differently from Matlab f


From: Ricardo Biloti
Subject: [Octave-bug-tracker] [bug #43349] asin behaves differently from Matlab for arguments larger than 1
Date: Mon, 06 Oct 2014 11:58:18 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0

Follow-up Comment #2, bug #43349 (project octave):

Below I quote some examples comparing Octave (3.8.1) with Matlab 8.0.0.783
(R2012b). I also have access to Matlab 7.8.0.347 (R2009a), which behaves just
like the newer Matlab.

Octave
======
octave:1> version
ans = 3.8.1
octave:2> asin([-2 -1 1 2]')
ans =

  -1.5708 + 1.3170i
  -1.5708 + 0.0000i
   1.5708 + 0.0000i
   1.5708 + 1.3170i

octave:3> sin(asin([-2 -1 1 2]'))
ans =

  -2.0000 + 0.0000i
  -1.0000 + 0.0000i
   1.0000 + 0.0000i
   2.0000 + 0.0000i

octave:4> cos(asin([-2 -1 1 2]'))
ans =

   0.00000 + 1.73205i
   0.00000 + 0.00000i
   0.00000 - 0.00000i
   0.00000 - 1.73205i


Matlab
======
>> version

ans =

8.0.0.783 (R2012b)

>> asin([-2 -1 1 2]')

ans =

  -1.5708 + 1.3170i
  -1.5708          
   1.5708          
   1.5708 - 1.3170i

>> sin(asin([-2 -1 1 2]'))

ans =

  -2.0000 + 0.0000i
  -1.0000          
   1.0000          
   2.0000 - 0.0000i

>> cos(asin([-2 -1 1 2]'))

ans =

   0.0000 + 1.7321i
   0.0000          
   0.0000          
   0.0000 + 1.7321i


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43349>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]